diff --git a/frontend/src/adk/client.ts b/frontend/src/adk/client.ts index b6fd90d2..fd9adc69 100644 --- a/frontend/src/adk/client.ts +++ b/frontend/src/adk/client.ts @@ -1620,6 +1620,33 @@ export async function generateAgentProject( return res.json(); } +export interface GeneratedAgentDraftResult { + draft: AgentDraft; + summary: string; + unresolvedItems: string[]; +} + +const GENERATED_AGENT_DRAFT_TIMEOUT_MS = 190_000; + +export async function generateAgentDraftFromRequirement( + requirement: string, +): Promise { + const res = await apiFetch( + "/web/generated-agent-drafts", + { + method: "POST", + headers: { "Content-Type": "application/json" }, + body: JSON.stringify({ requirement }), + }, + {}, + GENERATED_AGENT_DRAFT_TIMEOUT_MS, + ); + if (!res.ok) { + throw new Error(await httpErrorMessage(res, "生成 Agent 配置失败")); + } + return parseJsonResponse(res, "生成 Agent 配置失败"); +} + export async function createGeneratedAgentTestRun( draft: AgentDraft, ): Promise { diff --git a/frontend/src/create/CustomCreate.css b/frontend/src/create/CustomCreate.css index 79fd96ea..5068852c 100644 --- a/frontend/src/create/CustomCreate.css +++ b/frontend/src/create/CustomCreate.css @@ -188,6 +188,364 @@ overflow: hidden; background: #fff; } +.cw-build-workspace { + flex: 1; + min-width: 0; + min-height: 0; + display: flex; + flex-direction: column; +} +.cw-ai-compose { + position: relative; + z-index: 3; + flex: 0 0 auto; + margin: 8px var(--cw-workspace-gutter) 0; + overflow: hidden; + padding: 14px; + border: 0; + border-radius: 20px; + background: + radial-gradient(ellipse at 12% 10%, rgba(225, 217, 255, 0.72), transparent 43%), + radial-gradient(ellipse at 88% 88%, rgba(238, 223, 255, 0.58), transparent 42%), + radial-gradient(ellipse at 54% 36%, rgba(245, 239, 255, 0.82), transparent 56%), + rgba(248, 246, 252, 0.74); +} +.cw-ai-compose::before, +.cw-ai-compose::after { + position: absolute; + inset: -85% -20%; + content: ""; + pointer-events: none; + opacity: 0; + filter: blur(22px); + will-change: transform, opacity; +} +.cw-ai-compose::before { + background: + radial-gradient(circle at 30% 50%, rgba(176, 154, 255, 0.62), transparent 30%), + radial-gradient(circle at 66% 42%, rgba(226, 178, 255, 0.52), transparent 29%); +} +.cw-ai-compose::after { + background: + radial-gradient(circle at 38% 58%, rgba(153, 214, 255, 0.42), transparent 24%), + radial-gradient(circle at 74% 48%, rgba(200, 181, 255, 0.58), transparent 31%); +} +.cw-ai-compose.is-generating::before { + opacity: 0.62; + animation: cw-ai-banner-smoke-a 7s ease-in-out infinite alternate; +} +.cw-ai-compose.is-generating::after { + opacity: 0.54; + animation: cw-ai-banner-smoke-b 8.5s ease-in-out infinite alternate; +} +.cw-ai-compose-entry { + position: relative; + z-index: 1; + min-width: 0; +} +.cw-ai-compose-form { + min-width: 0; + display: grid; + grid-template-columns: minmax(0, 1fr) auto; + align-items: end; + gap: 10px; + padding: 6px 7px 6px 16px; + border-radius: 16px; + background: rgba(255, 255, 255, 0.92); + box-shadow: + 0 10px 28px rgba(65, 48, 100, 0.07), + 0 1px 3px rgba(65, 48, 100, 0.04); + backdrop-filter: blur(12px); + transition: background-color 220ms ease, box-shadow 220ms ease; +} +.cw-ai-compose.is-generating .cw-ai-compose-form { + background: rgba(235, 235, 240, 0.9); + box-shadow: + 0 10px 28px rgba(65, 48, 100, 0.05), + inset 0 0 0 1px rgba(84, 76, 100, 0.04); +} +.cw-ai-compose-note { + margin: 7px 12px 0; + color: hsl(var(--muted-foreground) / 0.76); + font-size: 11px; + line-height: 16px; +} +.cw-ai-compose-success { + min-height: 54px; + display: flex; + align-items: center; + justify-content: center; + gap: 10px; + padding: 6px 8px 6px 14px; + border-radius: 16px; + background: rgba(255, 255, 255, 0.92); + box-shadow: + 0 10px 28px rgba(35, 105, 67, 0.07), + 0 1px 3px rgba(35, 105, 67, 0.04); + backdrop-filter: blur(12px); +} +.cw-ai-compose-success strong { + color: hsl(149 48% 28%); + font-size: 14px; + font-weight: 650; +} +.cw-ai-success-check { + position: relative; + width: 28px; + height: 28px; + flex: 0 0 28px; + border-radius: 50%; + background: hsl(147 55% 42%); + box-shadow: 0 6px 16px hsl(147 55% 42% / 0.2); + animation: cw-ai-success-pop 360ms cubic-bezier(0.22, 1, 0.36, 1) both; +} +.cw-ai-success-check::after { + position: absolute; + top: 6px; + left: 9px; + width: 6px; + height: 10px; + border: solid #fff; + border-width: 0 2px 2px 0; + content: ""; + transform: rotate(45deg); +} +.cw-ai-regenerate { + height: 28px; + margin-left: 2px; + padding: 0 12px; + border: 0; + border-radius: 10px; + background: hsl(147 38% 93%); + color: hsl(149 48% 27%); + cursor: pointer; + font: inherit; + font-size: 12px; + font-weight: 620; + transition: background-color 150ms ease, transform 150ms ease; +} +.cw-ai-regenerate:hover { + background: hsl(147 38% 89%); + transform: translateY(-1px); +} +.cw-ai-compose-form input { + min-width: 0; + height: 42px; + padding: 10px 0; + border: 0; + border-radius: 0; + outline: none; + background: transparent; + color: hsl(var(--foreground)); + font: inherit; + font-size: 14px; + line-height: 22px; +} +.cw-ai-compose-form input::placeholder { + color: hsl(var(--muted-foreground) / 0.72); +} +.cw-ai-compose.is-generating .cw-ai-compose-form input { + color: hsl(var(--muted-foreground) / 0.78); + cursor: wait; +} +.cw-ai-compose-form button { + height: 38px; + display: inline-flex; + align-items: center; + justify-content: center; + gap: 6px; + padding: 0 16px; + border: 0; + border-radius: 12px; + background: hsl(250 12% 18%); + color: #fff; + cursor: pointer; + font: inherit; + font-size: 12px; + font-weight: 650; + white-space: nowrap; + transition: transform 150ms ease, opacity 150ms ease, background-color 150ms ease; +} +.cw-ai-compose-form button:hover:not(:disabled) { + background: hsl(258 16% 25%); + transform: translateY(-1px); +} +.cw-ai-compose-form button:disabled { + cursor: not-allowed; + opacity: 0.34; +} +.cw-ai-compose.is-generating .cw-ai-compose-form button:disabled { + width: 42px; + padding: 0; + border-radius: 50%; + background: transparent; + box-shadow: + 0 0 18px rgba(134, 101, 255, 0.2), + 0 0 30px rgba(77, 191, 255, 0.12); + opacity: 1; + overflow: hidden; + animation: cw-ai-orb-button 2.4s ease-in-out infinite; +} +.cw-ai-compose-form button .cw-i { + width: 14px; + height: 14px; +} +.cw-ai-orb { + position: relative; + width: 34px; + height: 34px; + display: block; + border-radius: 50%; + background: + radial-gradient(circle at 48% 48%, #fff 0 4%, transparent 13%), + conic-gradient( + from 20deg, + #8ae6ff, + #6c61ff 22%, + #e47cff 46%, + #7c5cff 68%, + #74dcff 88%, + #8ae6ff + ); + filter: saturate(1.2); + animation: cw-ai-orb-spin 2.15s linear infinite; +} +.cw-ai-orb::before, +.cw-ai-orb::after, +.cw-ai-orb > span { + position: absolute; + border-radius: 50%; + content: ""; +} +.cw-ai-orb::before { + inset: 3px; + background: + radial-gradient(circle at 68% 28%, rgba(255, 255, 255, 0.94), transparent 18%), + radial-gradient(circle at 35% 70%, rgba(106, 226, 255, 0.9), transparent 28%), + radial-gradient(circle at 50% 50%, rgba(202, 112, 255, 0.92), rgba(83, 57, 206, 0.42) 58%, transparent 76%); + filter: blur(2px); + animation: cw-ai-smoke-drift 1.65s ease-in-out infinite alternate; +} +.cw-ai-orb::after { + inset: -3px; + border: 1px solid rgba(185, 227, 255, 0.55); + filter: blur(1px); + animation: cw-ai-smoke-ring 2s ease-out infinite; +} +.cw-ai-orb > span { + inset: 8px; + background: rgba(255, 255, 255, 0.88); + box-shadow: + 0 0 8px #fff, + 0 0 13px #9de7ff; + filter: blur(2px); + animation: cw-ai-core-pulse 1.15s ease-in-out infinite alternate; +} +@keyframes cw-ai-orb-button { + 0%, + 100% { + transform: scale(0.96); + } + 50% { + transform: scale(1.04); + } +} +@keyframes cw-ai-orb-spin { + to { + transform: rotate(360deg); + } +} +@keyframes cw-ai-smoke-drift { + from { + transform: translate(-1px, 1px) scale(0.92) rotate(-12deg); + } + to { + transform: translate(1px, -1px) scale(1.08) rotate(16deg); + } +} +@keyframes cw-ai-smoke-ring { + 0% { + opacity: 0.72; + transform: scale(0.78); + } + 100% { + opacity: 0; + transform: scale(1.16); + } +} +@keyframes cw-ai-core-pulse { + from { + opacity: 0.6; + transform: scale(0.72); + } + to { + opacity: 1; + transform: scale(1.08); + } +} +@keyframes cw-ai-banner-smoke-a { + from { + transform: translate3d(-9%, 6%, 0) rotate(-5deg) scale(0.88); + } + to { + transform: translate3d(8%, -5%, 0) rotate(7deg) scale(1.08); + } +} +@keyframes cw-ai-banner-smoke-b { + from { + transform: translate3d(8%, -7%, 0) rotate(6deg) scale(1.06); + } + to { + transform: translate3d(-7%, 6%, 0) rotate(-8deg) scale(0.9); + } +} +@keyframes cw-ai-success-pop { + from { + opacity: 0; + transform: scale(0.55); + } + to { + opacity: 1; + transform: scale(1); + } +} +@media (prefers-reduced-motion: reduce) { + .cw-ai-compose.is-generating .cw-ai-compose-form button:disabled, + .cw-ai-orb, + .cw-ai-orb::before, + .cw-ai-orb::after, + .cw-ai-orb > span, + .cw-ai-compose.is-generating::before, + .cw-ai-compose.is-generating::after { + animation-duration: 6s; + } + .cw-ai-success-check { + animation: none; + } +} +.cw-ai-error-dialog { + width: 460px; + font-family: inherit; +} +.cw-ai-error-message { + max-height: min(320px, 50vh); + margin: 10px 0 18px; + overflow: auto; + color: hsl(var(--foreground) / 0.78); + font-family: inherit; + font-size: 13px; + line-height: 1.65; + overflow-wrap: anywhere; + white-space: pre-wrap; +} +.cw-ai-error-close { + border-color: transparent; + background: hsl(var(--foreground)); + color: hsl(var(--background)); +} +.cw-ai-error-close:hover { + background: hsl(var(--foreground) / 0.86); +} .cw-workspace-alert { position: absolute; z-index: 30; diff --git a/frontend/src/create/CustomCreate.tsx b/frontend/src/create/CustomCreate.tsx index 1eb1fa41..fccd725b 100644 --- a/frontend/src/create/CustomCreate.tsx +++ b/frontend/src/create/CustomCreate.tsx @@ -67,6 +67,7 @@ import { import { displayDescription } from "./displayText"; import { localPickerMatches } from "./localPickerSearch"; import { draftToYaml } from "./configYaml"; +import { normalizeDraft } from "./normalizeDraft"; import type { AgentProject } from "./project"; import { AgentBuildCanvas } from "./AgentBuildCanvas"; import type { SkillSource } from "./skills/types"; @@ -94,6 +95,7 @@ import { createGeneratedAgentTestSession, deleteGeneratedAgentTestRun, deployAgentkitProject, + generateAgentDraftFromRequirement, generateAgentProject, runGeneratedAgentTestSSE, } from "../adk/client"; @@ -2278,6 +2280,10 @@ export function CustomCreate({ const [draft, setDraft] = useState( () => initialDraft ?? emptyDraft(), ); + const [aiRequirement, setAiRequirement] = useState(""); + const [aiGenerating, setAiGenerating] = useState(false); + const [aiGenerated, setAiGenerated] = useState(false); + const [aiErrorDialog, setAiErrorDialog] = useState(null); const initialDraftSnapshotRef = useRef(JSON.stringify(draft)); const lastNotifiedDraftSnapshotRef = useRef(initialDraftSnapshotRef.current); const draftSnapshot = JSON.stringify(draft); @@ -2465,6 +2471,37 @@ export function CustomCreate({ if (select) setSelectedPath(select); }; + const handleGenerateDraft = async () => { + const requirement = aiRequirement.trim(); + if (!requirement || aiGenerating) return; + if ( + draftDirty && + !window.confirm("生成的新配置会替换当前画布和属性,确定继续吗?") + ) { + return; + } + + setAiGenerating(true); + setAiGenerated(false); + setAiErrorDialog(null); + setBuildErr(""); + try { + const result = await generateAgentDraftFromRequirement(requirement); + setDraft(normalizeDraft(result.draft)); + setSelectedPath([]); + setProject(null); + setShowErrors(false); + setBuildErr(""); + setAiGenerated(true); + } catch (error) { + setAiErrorDialog( + error instanceof Error ? error.message : "生成 Agent 配置失败", + ); + } finally { + setAiGenerating(false); + } + }; + const addCanvasStep = (path: NodePath) => { const parent = getNode(draft, path); if (!nodeAcceptsChildren(parent) || path.length >= MAX_TREE_DEPTH) return; @@ -3089,6 +3126,83 @@ export function CustomCreate({ )}
{workspaceMode === "build" && ( +
+
+ + {aiGenerated ? ( + + + 生成成功 + + + ) : ( + +
{ + event.preventDefault(); + void handleGenerateDraft(); + }} + > + setAiRequirement(event.target.value)} + onKeyDown={(event) => { + if (event.key === "Enter") { + event.preventDefault(); + void handleGenerateDraft(); + } + }} + /> + +
+

+ 使用 doubao-seed-2-0-lite-260428 模型生成,将会产生 Token 消耗 +

+
+ )} +
+
{/* cw-detail */}
+
)} {workspaceMode === "validate" && ( @@ -3984,6 +4099,37 @@ export function CustomCreate({ )} + {aiErrorDialog && ( +
setAiErrorDialog(null)}> +
event.stopPropagation()} + > +
+ 智能生成失败 +
+
+ {aiErrorDialog} +
+
+ +
+
+
+ )} ); } diff --git a/frontend/src/create/normalizeDraft.ts b/frontend/src/create/normalizeDraft.ts index 1f58d0ff..5a71f97d 100644 --- a/frontend/src/create/normalizeDraft.ts +++ b/frontend/src/create/normalizeDraft.ts @@ -80,6 +80,9 @@ function parseSubAgents(v: unknown): AgentDraft[] { if (!Array.isArray(v)) return []; return v.map((s) => { const so = (s && typeof s === "object" ? s : {}) as Record; + const mem = ( + so.memory && typeof so.memory === "object" ? so.memory : {} + ) as Record; const a2aRegistry = asA2aRegistry(so.a2aRegistry); const parsedType = asAgentType(so.agentType); const agentType = @@ -92,11 +95,30 @@ function parseSubAgents(v: unknown): AgentDraft[] { agentType, maxIterations: asMaxIterations(so.maxIterations), a2aUrl: asString(so.a2aUrl), + modelName: asString(so.modelName), + modelProvider: asString(so.modelProvider), + modelApiBase: asString(so.modelApiBase), builtinTools: asStringArray(so.builtinTools).filter((t) => TOOL_IDS.has(t)), customTools: asCustomTools(so.customTools), + memory: { shortTerm: asBool(mem.shortTerm), longTerm: asBool(mem.longTerm) }, + shortTermBackend: pick(so.shortTermBackend, STM_IDS, "local"), + longTermBackend: pick(so.longTermBackend, LTM_IDS, "local"), + autoSaveSession: asBool(so.autoSaveSession), + knowledgebase: asBool(so.knowledgebase), + knowledgebaseBackend: pick( + so.knowledgebaseBackend, + KB_IDS, + DEFAULT_KB_BACKEND, + ), + knowledgebaseIndex: asString(so.knowledgebaseIndex), + tracing: asBool(so.tracing), + tracingExporters: asStringArray(so.tracingExporters).filter((e) => + EXPORTER_IDS.has(e), + ), a2aRegistry: agentType === "a2a" ? { ...a2aRegistry, enabled: true } : a2aRegistry, subAgents: parseSubAgents(so.subAgents), + selectedSkills: parseSelectedSkills(so), }; }); } diff --git a/frontend/tests/generatedAgentPlanner.test.mjs b/frontend/tests/generatedAgentPlanner.test.mjs new file mode 100644 index 00000000..e1f7333a --- /dev/null +++ b/frontend/tests/generatedAgentPlanner.test.mjs @@ -0,0 +1,67 @@ +import assert from "node:assert/strict"; +import { readFileSync } from "node:fs"; +import test from "node:test"; + +const normalizeSource = readFileSync( + new URL("../src/create/normalizeDraft.ts", import.meta.url), + "utf8", +); +const createSource = readFileSync( + new URL("../src/create/CustomCreate.tsx", import.meta.url), + "utf8", +); +const clientSource = readFileSync( + new URL("../src/adk/client.ts", import.meta.url), + "utf8", +); +const createStyles = readFileSync( + new URL("../src/create/CustomCreate.css", import.meta.url), + "utf8", +); + +test("preserves generated capabilities on every nested Agent", () => { + const start = normalizeSource.indexOf("function parseSubAgents"); + const end = normalizeSource.indexOf("function parseSelectedSkills"); + const parser = normalizeSource.slice(start, end); + + for (const field of [ + "modelName", + "builtinTools", + "memory", + "shortTermBackend", + "longTermBackend", + "autoSaveSession", + "knowledgebase", + "knowledgebaseBackend", + "tracing", + "tracingExporters", + "subAgents", + ]) { + assert.match(parser, new RegExp(`\\b${field}:`)); + } + assert.match(parser, /subAgents: parseSubAgents\(so\.subAgents\)/); +}); + +test("feeds normalized generated tool ids into the checklist selection", () => { + assert.match(createSource, /setDraft\(normalizeDraft\(result\.draft\)\)/); + assert.match(createSource, /items=\{BUILTIN_TOOLS\}/); + assert.match(createSource, /selected=\{builtinTools\}/); +}); + +test("allows Agent generation to outlive the default request timeout", () => { + assert.match(clientSource, /GENERATED_AGENT_DRAFT_TIMEOUT_MS = 190_000/); + assert.match( + clientSource, + /apiFetch\([\s\S]*?"\/web\/generated-agent-drafts"[\s\S]*?GENERATED_AGENT_DRAFT_TIMEOUT_MS/, + ); +}); + +test("dims the input and animates the smoke while generation is active", () => { + assert.match( + createStyles, + /\.cw-ai-compose\.is-generating \.cw-ai-compose-form\s*\{[\s\S]*?background: rgba\(235, 235, 240, 0\.9\)/, + ); + assert.match(createStyles, /\.cw-ai-compose\.is-generating::before/); + assert.match(createStyles, /animation: cw-ai-banner-smoke-a 7s/); + assert.match(createStyles, /animation: cw-ai-banner-smoke-b 8\.5s/); +}); diff --git a/tests/cli/test_generated_agent_backend_codegen_extended.py b/tests/cli/test_generated_agent_backend_codegen_extended.py index a3d4b590..f39b77fe 100644 --- a/tests/cli/test_generated_agent_backend_codegen_extended.py +++ b/tests/cli/test_generated_agent_backend_codegen_extended.py @@ -31,6 +31,7 @@ from veadk.cli.cli_frontend import ( _redact_debug_text, _run_frontend_server, + _safe_exception_detail, _studio_deploy_run_script, ) from veadk.cli.generated_agent_codegen import ( @@ -718,6 +719,27 @@ def test_debug_text_redacts_environment_and_inline_markers( assert "Bearer ***" in redacted +def test_model_error_detail_preserves_cause_and_redacts_credentials() -> None: + api_key = "model-api-key-123456" + access_key = "model-access-key-123456" + try: + try: + raise RuntimeError( + "Ark request failed: model access denied; " + f"api_key={api_key}; access_key={access_key}" + ) + except RuntimeError as cause: + raise ValueError("模型请求失败") from cause + except ValueError as error: + detail = _safe_exception_detail(error) + + assert "模型请求失败" in detail + assert "model access denied" in detail + assert api_key not in detail + assert access_key not in detail + assert detail.count("***") == 2 + + def test_generated_project_and_debug_run_api_lifecycle( monkeypatch: pytest.MonkeyPatch, tmp_path: Path, diff --git a/tests/cli/test_generated_agent_planner.py b/tests/cli/test_generated_agent_planner.py new file mode 100644 index 00000000..5939ccf7 --- /dev/null +++ b/tests/cli/test_generated_agent_planner.py @@ -0,0 +1,357 @@ +# Copyright (c) 2025 Beijing Volcano Engine Technology Co., Ltd. and/or its affiliates. +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +from __future__ import annotations + +import json +import os +import re +from pathlib import Path +from typing import Any + +import pytest + +from veadk.cli.generated_agent_codegen import AgentDraft, generate_project_from_draft +from veadk.cli.generated_agent_planner import ( + DEFAULT_GENERATED_MODEL_NAME, + PLANNER_INSTRUCTION, + GeneratedAgentDraftPlan, + _to_agent_draft, + generate_agent_draft, +) + +TOOL_IDS = { + "web_search", + "parallel_web_search", + "link_reader", + "web_scraper", + "image_generate", + "image_edit", + "video_generate", + "text_to_speech", + "run_code", + "vesearch", +} + + +def _leaf( + name: str, + tools: list[str], + *, + short_term: bool = False, + tracing_exporters: list[str] | None = None, +) -> dict[str, Any]: + return { + "name": name, + "description": f"{name} 的职责说明", + "instruction": (f"你是 {name},严格完成分配给你的步骤并返回结构化结果。"), + "agentType": "llm", + "maxIterations": 3, + "modelName": DEFAULT_GENERATED_MODEL_NAME, + "builtinTools": tools, + "customTools": [], + "memory": { + "shortTerm": short_term, + "longTerm": False, + "autoSaveSession": False, + }, + "shortTermBackend": "local", + "longTermBackend": "local", + "knowledgebase": False, + "knowledgebaseBackend": "viking", + "tracingExporters": tracing_exporters or [], + "subAgents": [], + } + + +def _orchestrator( + name: str, + agent_type: str, + children: list[dict[str, Any]], + *, + max_iterations: int = 3, +) -> dict[str, Any]: + return { + "name": name, + "description": f"{name} 的流程编排", + "instruction": "", + "agentType": agent_type, + "maxIterations": max_iterations, + "modelName": "", + "builtinTools": [], + "customTools": [], + "memory": { + "shortTerm": False, + "longTerm": False, + "autoSaveSession": False, + }, + "shortTermBackend": "local", + "longTermBackend": "local", + "knowledgebase": False, + "knowledgebaseBackend": "viking", + "tracingExporters": [], + "subAgents": children, + } + + +def _video_plan() -> dict[str, Any]: + media_assets = _orchestrator( + "media_assets", + "parallel", + [ + _leaf("visual_creator", ["image_generate", "image_edit"]), + _leaf("voice_creator", ["text_to_speech"]), + ], + ) + review_loop = _orchestrator( + "video_review_loop", + "loop", + [ + _leaf("video_reviewer", []), + _leaf("video_reviser", ["video_generate"]), + ], + max_iterations=4, + ) + return _orchestrator( + "video_production", + "sequential", + [ + _leaf("trend_researcher", ["web_search", "link_reader"]), + _leaf("script_writer", [], short_term=True), + media_assets, + _leaf("video_renderer", ["video_generate"]), + review_loop, + ], + ) + + +def _image_plan() -> dict[str, Any]: + concepts = _orchestrator( + "concept_variants", + "parallel", + [ + _leaf("hero_image_creator", ["image_generate"]), + _leaf("alternate_image_creator", ["image_generate"]), + ], + ) + return _orchestrator( + "image_campaign", + "sequential", + [ + _leaf("visual_researcher", ["web_search", "link_reader"]), + concepts, + _leaf("image_editor", ["image_edit"]), + _leaf("brand_reviewer", []), + ], + ) + + +def _ops_plan() -> dict[str, Any]: + remediation_loop = _orchestrator( + "remediation_loop", + "loop", + [ + _leaf("remediation_executor", ["run_code"]), + _leaf("health_verifier", ["run_code"]), + ], + max_iterations=5, + ) + return _orchestrator( + "operations_assistant", + "sequential", + [ + _leaf( + "incident_triage", + ["web_search", "link_reader"], + short_term=True, + tracing_exporters=["apmplus"], + ), + _leaf("diagnostic_runner", ["run_code"]), + remediation_loop, + _leaf("incident_reporter", []), + ], + ) + + +SCENARIOS = [ + ( + "video", + _video_plan, + {"image_generate", "image_edit", "video_generate", "text_to_speech"}, + ), + ("image", _image_plan, {"image_generate", "image_edit"}), + ("ops", _ops_plan, {"web_search", "link_reader", "run_code"}), +] + + +LIVE_REQUIREMENTS = [ + ( + "video", + ( + "创建一个复杂短视频生产 Agent。根流程按顺序完成趋势调研、" + "脚本编写、素材生产、视频生成和质量复核。素材阶段并行生成" + "主视觉图片和中文配音;主视觉需要支持后续图片编辑;视频由图片、" + "脚本和配音生成。最后最多循环 4 次检查画面、配音和脚本一致性," + "并重新生成不合格视频。联网调研必须阅读原始网页," + "不要为只做审查的 Agent 配置媒体生成工具。" + ), + { + "web_search", + "link_reader", + "image_generate", + "image_edit", + "video_generate", + "text_to_speech", + }, + ), + ( + "image", + ( + "创建一个品牌图片生产 Agent。先联网调研视觉趋势并阅读原始页面," + "再并行生成两套主视觉方案,随后由独立 Agent 使用图片编辑工具" + "完成品牌色和版式调整,最后由不带生成工具的审核 Agent 做质量检查。" + "必须体现有顺序和并行关系的" + "嵌套 Agent。" + ), + {"web_search", "link_reader", "image_generate", "image_edit"}, + ), + ( + "ops", + ( + "创建一个生产运维助手。根流程按顺序完成告警研判、诊断脚本执行、" + "最多 5 轮的修复与健康检查循环,最后生成事故报告。告警研判需要" + "联网查阅官方故障文档并保留短期上下文,诊断、修复和验证都在" + "代码沙箱中执行;告警研判开启 APMPlus " + "链路观测。不要虚构监控系统地址或凭据。" + ), + {"web_search", "link_reader", "run_code"}, + ), +] + + +def _walk_plan(node: Any) -> list[Any]: + nodes = [node] + for child in node.subAgents: + nodes.extend(_walk_plan(child)) + return nodes + + +def _walk_draft(node: AgentDraft) -> list[AgentDraft]: + nodes = [node] + for child in node.subAgents: + nodes.extend(_walk_draft(child)) + return nodes + + +@pytest.mark.parametrize(("name", "plan_factory", "required_tools"), SCENARIOS) +def test_complex_plans_validate_and_generate_runnable_projects( + name: str, + plan_factory: Any, + required_tools: set[str], +) -> None: + plan = GeneratedAgentDraftPlan.model_validate( + { + "summary": f"{name} complex Agent", + "rootAgent": plan_factory(), + "unresolvedItems": [], + } + ) + nodes = _walk_plan(plan.rootAgent) + leaves = [node for node in nodes if node.agentType == "llm"] + orchestrators = [node for node in nodes if node.agentType != "llm"] + selected_tools = {tool for node in leaves for tool in node.builtinTools} + + assert plan.rootAgent.agentType == "sequential" + assert len(nodes) >= 6 + assert all(node.modelName == DEFAULT_GENERATED_MODEL_NAME for node in leaves) + assert all(node.instruction.strip() for node in leaves) + assert all(not node.subAgents for node in leaves) + assert all(not node.modelName and not node.builtinTools for node in orchestrators) + assert required_tools <= selected_tools <= TOOL_IDS + + draft = _to_agent_draft(plan.rootAgent) + project = generate_project_from_draft(draft) + python_files = [file for file in project.files if file.path.endswith(".py")] + assert python_files + for file in python_files: + compile(file.content, file.path, "exec") + + +def test_planner_schema_and_frontend_use_the_same_builtin_tool_ids() -> None: + schema = json.dumps(GeneratedAgentDraftPlan.model_json_schema()) + frontend_catalog = ( + Path(__file__).parents[2] / "frontend/src/create/veadkCatalog.ts" + ).read_text(encoding="utf-8") + frontend_tool_ids = set(re.findall(r'\bid:\s*"([a-z_]+)"', frontend_catalog)) + + assert '"$ref"' in schema + assert schema.count('"additionalProperties": false') >= 4 + assert TOOL_IDS <= frontend_tool_ids + assert all(tool_id in schema for tool_id in TOOL_IDS) + assert all(tool_id in PLANNER_INSTRUCTION for tool_id in TOOL_IDS) + + +def test_orchestrator_fields_are_normalized_before_strict_validation() -> None: + raw = _orchestrator( + "review_flow", + "sequential", + [_leaf("reviewer", [])], + ) + raw.update( + instruction="模型错误生成的编排提示词", + modelName=DEFAULT_GENERATED_MODEL_NAME, + builtinTools=["web_search"], + customTools=[{"name": "invalid_tool", "description": "invalid"}], + memory={"shortTerm": True, "longTerm": True, "autoSaveSession": True}, + knowledgebase=True, + tracingExporters=["apmplus"], + ) + + plan = GeneratedAgentDraftPlan.model_validate( + {"summary": "normalized", "rootAgent": raw, "unresolvedItems": []} + ) + + assert plan.rootAgent.instruction == "" + assert plan.rootAgent.modelName == "" + assert plan.rootAgent.builtinTools == [] + assert plan.rootAgent.customTools == [] + assert not plan.rootAgent.memory.shortTerm + assert not plan.rootAgent.memory.longTerm + assert not plan.rootAgent.memory.autoSaveSession + assert not plan.rootAgent.knowledgebase + assert plan.rootAgent.tracingExporters == [] + + +@pytest.mark.asyncio +@pytest.mark.parametrize(("name", "requirement", "required_tools"), LIVE_REQUIREMENTS) +async def test_live_planner_generates_complex_scenarios( + name: str, + requirement: str, + required_tools: set[str], +) -> None: + if os.getenv("RUN_LIVE_ARK_PLANNER_TESTS") != "1": + pytest.skip("set RUN_LIVE_ARK_PLANNER_TESTS=1 to call the live Ark model") + + result = await generate_agent_draft(requirement) + draft = AgentDraft.model_validate(result["draft"]) + nodes = _walk_draft(draft) + leaves = [node for node in nodes if node.agentType == "llm"] + selected_tools = {tool for node in leaves for tool in node.builtinTools} + + assert draft.agentType == "sequential", name + assert len(nodes) >= 6, name + assert any(node.agentType in {"parallel", "loop"} for node in nodes), name + assert all(node.modelName == DEFAULT_GENERATED_MODEL_NAME for node in leaves), name + assert all(node.instruction.strip() for node in leaves), name + assert required_tools <= selected_tools, name diff --git a/veadk/cli/cli_frontend.py b/veadk/cli/cli_frontend.py index bee381e9..2a54f27d 100644 --- a/veadk/cli/cli_frontend.py +++ b/veadk/cli/cli_frontend.py @@ -123,8 +123,10 @@ def _redact_debug_text(text: str) -> str: redacted, ) return re.sub( - r"(?i)((?:api[_-]?key|auth[_-]?token|access[_-]?token|secret|" - r"password|token)\s*[:=]\s*)(?:[\"'][^\"']*[\"']|[^\s,;]+)", + r"(?i)((?:api[_-]?key|access[_-]?key(?:[_-]?id)?|secret[_-]?key|" + r"auth[_-]?token|access[_-]?token|client[_-]?secret|credential|" + r"signature|secret|password|token)\s*[:=]\s*)" + r"(?:[\"'][^\"']*[\"']|[^\s,;]+)", r"\1***", redacted, ) @@ -1381,6 +1383,10 @@ async def _agentkit_proxy(request: Request, path: str): validate_debug_policy, validate_project_policy, ) + from veadk.cli.generated_agent_planner import ( + GeneratedAgentDraftRequest, + generate_agent_draft, + ) from veadk.cli.generated_agent_skills import materialize_selected_skills _TEST_RUN_MAX_FILES = 100 @@ -1928,6 +1934,28 @@ async def _generate_agent_project(request: Request): project = await _generate_project_from_request(data, debug=False) return project.model_dump() + @app.post("/web/generated-agent-drafts") + async def _generate_agent_draft(request: Request): + _require_agent_management(request) + try: + payload = GeneratedAgentDraftRequest.model_validate(await request.json()) + except ValidationError as error: + raise HTTPException(status_code=422, detail=error.errors()) from error + + try: + return await generate_agent_draft(payload.requirement) + except TimeoutError as error: + raise HTTPException( + status_code=504, + detail="生成配置超时,请稍后重试。", + ) from error + except Exception as error: + logger.exception("Failed to generate Agent draft from requirement") + raise HTTPException( + status_code=502, + detail=_safe_exception_detail(error), + ) from error + @app.post("/web/generated-agent-test-runs") async def _create_generated_agent_test_run(request: Request): principal = _require_agent_management(request) diff --git a/veadk/cli/generated_agent_planner.py b/veadk/cli/generated_agent_planner.py new file mode 100644 index 00000000..e4cf53fd --- /dev/null +++ b/veadk/cli/generated_agent_planner.py @@ -0,0 +1,240 @@ +# Copyright (c) 2025 Beijing Volcano Engine Technology Co., Ltd. and/or its affiliates. +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +"""Generate a validated recursive AgentDraft from a natural-language request.""" + +from __future__ import annotations + +import asyncio +from typing import Literal +from uuid import uuid4 + +from pydantic import BaseModel, ConfigDict, Field, model_validator + +from veadk import Agent, Runner +from veadk.cli.generated_agent_codegen import AgentDraft, CustomTool, MemoryConfig + +PLANNER_MODEL_NAME = "doubao-seed-2-0-lite-260428" +DEFAULT_GENERATED_MODEL_NAME = "doubao-seed-2-1-pro-260628" + + +class GeneratedMemoryPlan(BaseModel): + model_config = ConfigDict(extra="forbid") + + shortTerm: bool + longTerm: bool + autoSaveSession: bool + + +class GeneratedCustomToolPlan(BaseModel): + model_config = ConfigDict(extra="forbid") + + name: str = Field(description="Python function name in snake_case.") + description: str = Field(description="What the generated tool stub should do.") + + +class GeneratedAgentPlan(BaseModel): + """Strict recursive subset of the Studio AgentDraft contract.""" + + model_config = ConfigDict(extra="forbid") + + name: str = Field(description="Globally unique Python identifier in snake_case.") + description: str = Field(description="Concise description of this Agent's role.") + instruction: str = Field( + description="Detailed system prompt for an llm Agent; empty for an orchestrator." + ) + agentType: Literal["llm", "sequential", "parallel", "loop"] + maxIterations: int = Field( + description="Positive loop limit; use 3 for non-loop Agents." + ) + modelName: Literal["", "doubao-seed-2-1-pro-260628"] = Field( + description="Fixed model for an llm Agent; empty for an orchestrator." + ) + builtinTools: list[ + Literal[ + "web_search", + "parallel_web_search", + "link_reader", + "web_scraper", + "image_generate", + "image_edit", + "video_generate", + "text_to_speech", + "run_code", + "vesearch", + ] + ] + customTools: list[GeneratedCustomToolPlan] + memory: GeneratedMemoryPlan + shortTermBackend: Literal["local", "sqlite", "mysql", "postgresql"] + longTermBackend: Literal["local", "opensearch", "redis", "viking", "mem0"] + knowledgebase: bool + knowledgebaseBackend: Literal["viking", "opensearch", "context_search"] + tracingExporters: list[Literal["apmplus", "cozeloop", "tls"]] + subAgents: list[GeneratedAgentPlan] + + @model_validator(mode="before") + @classmethod + def normalize_orchestrator_fields(cls, value: object) -> object: + if not isinstance(value, dict) or value.get("agentType") == "llm": + return value + normalized = dict(value) + normalized.update( + instruction="", + modelName="", + builtinTools=[], + customTools=[], + memory={ + "shortTerm": False, + "longTerm": False, + "autoSaveSession": False, + }, + knowledgebase=False, + tracingExporters=[], + ) + return normalized + + @model_validator(mode="after") + def validate_agent_shape(self) -> GeneratedAgentPlan: + if self.maxIterations < 1: + raise ValueError(f"{self.name} has an invalid maxIterations") + if self.agentType == "llm": + if not self.instruction.strip() or not self.modelName: + raise ValueError(f"{self.name} is missing llm configuration") + if self.subAgents: + raise ValueError(f"llm Agent {self.name} must be a leaf") + else: + if not self.subAgents: + raise ValueError(f"orchestrator {self.name} has no sub-Agents") + if self.instruction or self.modelName or self.builtinTools: + raise ValueError( + f"orchestrator {self.name} contains llm-only configuration" + ) + if ( + self.customTools + or self.memory.shortTerm + or self.memory.longTerm + or self.memory.autoSaveSession + or self.knowledgebase + or self.tracingExporters + ): + raise ValueError( + f"orchestrator {self.name} contains leaf-only capabilities" + ) + return self + + +class GeneratedAgentDraftPlan(BaseModel): + model_config = ConfigDict(extra="forbid") + + summary: str = Field(description="One-sentence summary of the generated design.") + rootAgent: GeneratedAgentPlan + unresolvedItems: list[str] = Field( + description="Real resource choices or identifiers the user must still provide." + ) + + +class GeneratedAgentDraftRequest(BaseModel): + model_config = ConfigDict(extra="forbid") + + requirement: str = Field(min_length=4, max_length=8000) + + +PLANNER_INSTRUCTION = f""" +You convert a user's requirement into a complete recursive VeADK Agent plan. + +Rules: +- Use only llm, sequential, parallel, and loop Agent types. +- Preserve the user's execution order. Use parallel only for work that can run + concurrently, sequential for ordered stages, and loop for bounded iteration. +- An llm Agent is always a leaf. Fill its name, description, detailed + instruction, model, tools, memory, knowledgebase, and tracing fields. +- Every llm Agent uses modelName {DEFAULT_GENERATED_MODEL_NAME}. +- An orchestrator only schedules subAgents. Its instruction and modelName are + empty, its tools and tracing exporters are empty, and memory and knowledgebase + are disabled. +- Use maxIterations=3 except when the user requests a loop limit. +- Use globally unique Python snake_case Agent and custom-tool names. +- web_search and parallel_web_search find public Internet results. link_reader + reads the original page. web_scraper extracts public web pages. vesearch also + searches the public Internet, social media, and news; it is NOT an enterprise + knowledgebase tool. +- image_generate creates images from text prompts. image_edit modifies an + existing image. video_generate creates video from text or image inputs. + text_to_speech converts text into audio. run_code executes code in a sandbox. +- Select only tools the Agent will actually invoke. Media planning or review + Agents do not need generation tools unless they generate or edit that media. +- For an enterprise knowledgebase, set knowledgebase=true and choose its + backend. Do not add an Internet search tool unless the same Agent explicitly + needs public Internet research. +- Enable memory, tracing, or tools only where the requirement needs them. +- Backend fields are never empty. When disabled, use local for both memory + backends and viking for the knowledgebase backend. +- Do not invent instance IDs, URLs, credentials, MCP servers, or skill IDs. + Put real resources that still need user input in unresolvedItems. +""".strip() + + +def _to_agent_draft(plan: GeneratedAgentPlan) -> AgentDraft: + return AgentDraft( + name=plan.name, + description=plan.description, + instruction=plan.instruction, + agentType=plan.agentType, + maxIterations=plan.maxIterations, + modelName=plan.modelName, + builtinTools=list(plan.builtinTools), + customTools=[CustomTool(**tool.model_dump()) for tool in plan.customTools], + memory=MemoryConfig( + shortTerm=plan.memory.shortTerm, + longTerm=plan.memory.longTerm, + ), + shortTermBackend=plan.shortTermBackend, + longTermBackend=plan.longTermBackend, + autoSaveSession=plan.memory.autoSaveSession, + knowledgebase=plan.knowledgebase, + knowledgebaseBackend=plan.knowledgebaseBackend, + tracing=bool(plan.tracingExporters), + tracingExporters=list(plan.tracingExporters), + subAgents=[_to_agent_draft(child) for child in plan.subAgents], + ) + + +async def generate_agent_draft(requirement: str) -> dict: + """Call Ark with a strict output schema and return a Studio AgentDraft.""" + + planner = Agent( + name="studio_agent_draft_planner", + description="Builds a validated recursive Studio Agent configuration.", + instruction=PLANNER_INSTRUCTION, + model_name=PLANNER_MODEL_NAME, + output_schema=GeneratedAgentDraftPlan, + enable_responses=True, + enable_responses_cache=False, + model_extra_config={"extra_body": {"thinking": {"type": "disabled"}}}, + ) + runner = Runner(agent=planner, app_name="studio_agent_draft_planner") + raw = await asyncio.wait_for( + runner.run( + requirement, + session_id=f"studio-agent-draft-{uuid4().hex}", + ), + timeout=180, + ) + plan = GeneratedAgentDraftPlan.model_validate_json(raw) + return { + "draft": _to_agent_draft(plan.rootAgent).model_dump(), + "summary": plan.summary, + "unresolvedItems": plan.unresolvedItems, + } diff --git a/veadk/webui/assets/CodeEditor-Cr6KNv6h.js b/veadk/webui/assets/CodeEditor-CXwnqSek.js similarity index 99% rename from veadk/webui/assets/CodeEditor-Cr6KNv6h.js rename to veadk/webui/assets/CodeEditor-CXwnqSek.js index e0e1a94f..21ea3d77 100644 --- a/veadk/webui/assets/CodeEditor-Cr6KNv6h.js +++ b/veadk/webui/assets/CodeEditor-CXwnqSek.js @@ -1,4 +1,4 @@ -import{A as xe,t as sf}from"./index-BKcJcY8v.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-BAAjZmQQ.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-DH4ASeh5.js b/veadk/webui/assets/MarkdownPromptEditor-CP3T8Ti1.js similarity index 99% rename from veadk/webui/assets/MarkdownPromptEditor-DH4ASeh5.js rename to veadk/webui/assets/MarkdownPromptEditor-CP3T8Ti1.js index 3ffc6d9b..b4a3b1fa 100644 --- a/veadk/webui/assets/MarkdownPromptEditor-DH4ASeh5.js +++ b/veadk/webui/assets/MarkdownPromptEditor-CP3T8Ti1.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-BKcJcY8v.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-BAAjZmQQ.js";const C2={}.hasOwnProperty;function am(t,e){let n=-1,r;if(e.extensions)for(;++ni.map(i=>d[i]); +var X5=Object.defineProperty;var Q5=(e,t,n)=>t in e?X5(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n;var P_=(e,t,n)=>Q5(e,typeof t!="symbol"?t+"":t,n);function Z5(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 Kp=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{};function yf(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}var AC={exports:{}},lg={},CC={exports:{}},Et={};/** + * @license React + * react.production.min.js + * + * Copyright (c) Facebook, Inc. and its affiliates. + * + * This source code is licensed under the MIT license found in the + * LICENSE file in the root directory of this source tree. + */var bf=Symbol.for("react.element"),J5=Symbol.for("react.portal"),eB=Symbol.for("react.fragment"),tB=Symbol.for("react.strict_mode"),nB=Symbol.for("react.profiler"),rB=Symbol.for("react.provider"),sB=Symbol.for("react.context"),iB=Symbol.for("react.forward_ref"),aB=Symbol.for("react.suspense"),oB=Symbol.for("react.memo"),lB=Symbol.for("react.lazy"),B_=Symbol.iterator;function cB(e){return e===null||typeof e!="object"?null:(e=B_&&e[B_]||e["@@iterator"],typeof e=="function"?e:null)}var IC={isMounted:function(){return!1},enqueueForceUpdate:function(){},enqueueReplaceState:function(){},enqueueSetState:function(){}},OC=Object.assign,RC={};function Hc(e,t,n){this.props=e,this.context=t,this.refs=RC,this.updater=n||IC}Hc.prototype.isReactComponent={};Hc.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")};Hc.prototype.forceUpdate=function(e){this.updater.enqueueForceUpdate(this,e,"forceUpdate")};function LC(){}LC.prototype=Hc.prototype;function rx(e,t,n){this.props=e,this.context=t,this.refs=RC,this.updater=n||IC}var sx=rx.prototype=new LC;sx.constructor=rx;OC(sx,Hc.prototype);sx.isPureReactComponent=!0;var F_=Array.isArray,MC=Object.prototype.hasOwnProperty,ix={current:null},jC={key:!0,ref:!0,__self:!0,__source:!0};function DC(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)MC.call(t,r)&&!jC.hasOwnProperty(r)&&(s[r]=t[r]);var o=arguments.length-2;if(o===1)s.children=n;else if(1>>1,G=M[V];if(0>>1;Vs(q,I))nes(oe,q)?(M[V]=oe,M[ne]=I,V=ne):(M[V]=q,M[ie]=I,V=ie);else if(nes(oe,I))M[V]=oe,M[ne]=I,V=ne;else break e}}return B}function s(M,B){var I=M.sortIndex-B.sortIndex;return I!==0?I:M.id-B.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 c=[],u=[],d=1,f=null,h=3,p=!1,m=!1,y=!1,E=typeof setTimeout=="function"?setTimeout:null,g=typeof clearTimeout=="function"?clearTimeout:null,x=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(M){for(var B=n(u);B!==null;){if(B.callback===null)r(u);else if(B.startTime<=M)r(u),B.sortIndex=B.expirationTime,t(c,B);else break;B=n(u)}}function _(M){if(y=!1,b(M),!m)if(n(c)!==null)m=!0,T(k);else{var B=n(u);B!==null&&R(_,B.startTime-M)}}function k(M,B){m=!1,y&&(y=!1,g(S),S=-1),p=!0;var I=h;try{for(b(B),f=n(c);f!==null&&(!(f.expirationTime>B)||M&&!D());){var V=f.callback;if(typeof V=="function"){f.callback=null,h=f.priorityLevel;var G=V(f.expirationTime<=B);B=e.unstable_now(),typeof G=="function"?f.callback=G:f===n(c)&&r(c),b(B)}else r(c);f=n(c)}if(f!==null)var P=!0;else{var ie=n(u);ie!==null&&R(_,ie.startTime-B),P=!1}return P}finally{f=null,h=I,p=!1}}var N=!1,C=null,S=-1,A=5,O=-1;function D(){return!(e.unstable_now()-OM||125V?(M.sortIndex=I,t(u,M),n(c)===null&&M===n(u)&&(y?(g(S),S=-1):y=!0,R(_,I-V))):(M.sortIndex=G,t(c,M),m||p||(m=!0,T(k))),M},e.unstable_shouldYield=D,e.unstable_wrapCallback=function(M){var B=h;return function(){var I=h;h=B;try{return M.apply(this,arguments)}finally{h=I}}}})($C);UC.exports=$C;var xB=UC.exports;/** + * @license React + * react-dom.production.min.js + * + * Copyright (c) Facebook, Inc. and its affiliates. + * + * This source code is licensed under the MIT license found in the + * LICENSE file in the root directory of this source tree. + */var wB=w,ts=xB;function Se(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"),Lb=Object.prototype.hasOwnProperty,vB=/^[: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]*$/,$_={},H_={};function _B(e){return Lb.call(H_,e)?!0:Lb.call($_,e)?!1:vB.test(e)?H_[e]=!0:($_[e]=!0,!1)}function kB(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 NB(e,t,n,r){if(t===null||typeof t>"u"||kB(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 Cr(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 ar={};"children dangerouslySetInnerHTML defaultValue defaultChecked innerHTML suppressContentEditableWarning suppressHydrationWarning style".split(" ").forEach(function(e){ar[e]=new Cr(e,0,!1,e,null,!1,!1)});[["acceptCharset","accept-charset"],["className","class"],["htmlFor","for"],["httpEquiv","http-equiv"]].forEach(function(e){var t=e[0];ar[t]=new Cr(t,1,!1,e[1],null,!1,!1)});["contentEditable","draggable","spellCheck","value"].forEach(function(e){ar[e]=new Cr(e,2,!1,e.toLowerCase(),null,!1,!1)});["autoReverse","externalResourcesRequired","focusable","preserveAlpha"].forEach(function(e){ar[e]=new Cr(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){ar[e]=new Cr(e,3,!1,e.toLowerCase(),null,!1,!1)});["checked","multiple","muted","selected"].forEach(function(e){ar[e]=new Cr(e,3,!0,e,null,!1,!1)});["capture","download"].forEach(function(e){ar[e]=new Cr(e,4,!1,e,null,!1,!1)});["cols","rows","size","span"].forEach(function(e){ar[e]=new Cr(e,6,!1,e,null,!1,!1)});["rowSpan","start"].forEach(function(e){ar[e]=new Cr(e,5,!1,e.toLowerCase(),null,!1,!1)});var ox=/[\-:]([a-z])/g;function lx(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(ox,lx);ar[t]=new Cr(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(ox,lx);ar[t]=new Cr(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(ox,lx);ar[t]=new Cr(t,1,!1,e,"http://www.w3.org/XML/1998/namespace",!1,!1)});["tabIndex","crossOrigin"].forEach(function(e){ar[e]=new Cr(e,1,!1,e.toLowerCase(),null,!1,!1)});ar.xlinkHref=new Cr("xlinkHref",1,!1,"xlink:href","http://www.w3.org/1999/xlink",!0,!1);["src","href","action","formAction"].forEach(function(e){ar[e]=new Cr(e,1,!1,e.toLowerCase(),null,!0,!0)});function cx(e,t,n,r){var s=ar.hasOwnProperty(t)?ar[t]:null;(s!==null?s.type!==0:r||!(2o||s[a]!==i[o]){var c=` +`+s[a].replace(" at new "," at ");return e.displayName&&c.includes("")&&(c=c.replace("",e.displayName)),c}while(1<=a&&0<=o);break}}}finally{P0=!1,Error.prepareStackTrace=n}return(e=e?e.displayName||e.name:"")?Mu(e):""}function SB(e){switch(e.tag){case 5:return Mu(e.type);case 16:return Mu("Lazy");case 13:return Mu("Suspense");case 19:return Mu("SuspenseList");case 0:case 2:case 15:return e=B0(e.type,!1),e;case 11:return e=B0(e.type.render,!1),e;case 1:return e=B0(e.type,!0),e;default:return""}}function Pb(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 kl:return"Fragment";case _l:return"Portal";case Mb:return"Profiler";case ux:return"StrictMode";case jb:return"Suspense";case Db:return"SuspenseList"}if(typeof e=="object")switch(e.$$typeof){case VC:return(e.displayName||"Context")+".Consumer";case zC:return(e._context.displayName||"Context")+".Provider";case dx:var t=e.render;return e=e.displayName,e||(e=t.displayName||t.name||"",e=e!==""?"ForwardRef("+e+")":"ForwardRef"),e;case fx:return t=e.displayName||null,t!==null?t:Pb(e.type)||"Memo";case ya:t=e._payload,e=e._init;try{return Pb(e(t))}catch{}}return null}function TB(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 Pb(t);case 8:return t===ux?"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 Ba(e){switch(typeof e){case"boolean":case"number":case"string":case"undefined":return e;case"object":return e;default:return""}}function YC(e){var t=e.type;return(e=e.nodeName)&&e.toLowerCase()==="input"&&(t==="checkbox"||t==="radio")}function AB(e){var t=YC(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 mh(e){e._valueTracker||(e._valueTracker=AB(e))}function GC(e){if(!e)return!1;var t=e._valueTracker;if(!t)return!0;var n=t.getValue(),r="";return e&&(r=YC(e)?e.checked?"true":"false":e.value),e=r,e!==n?(t.setValue(e),!0):!1}function Yp(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 Bb(e,t){var n=t.checked;return hn({},t,{defaultChecked:void 0,defaultValue:void 0,value:void 0,checked:n??e._wrapperState.initialChecked})}function V_(e,t){var n=t.defaultValue==null?"":t.defaultValue,r=t.checked!=null?t.checked:t.defaultChecked;n=Ba(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 WC(e,t){t=t.checked,t!=null&&cx(e,"checked",t,!1)}function Fb(e,t){WC(e,t);var n=Ba(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")?Ub(e,t.type,n):t.hasOwnProperty("defaultValue")&&Ub(e,t.type,Ba(t.defaultValue)),t.checked==null&&t.defaultChecked!=null&&(e.defaultChecked=!!t.defaultChecked)}function K_(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 Ub(e,t,n){(t!=="number"||Yp(e.ownerDocument)!==e)&&(n==null?e.defaultValue=""+e._wrapperState.initialValue:e.defaultValue!==""+n&&(e.defaultValue=""+n))}var ju=Array.isArray;function ql(e,t,n,r){if(e=e.options,t){t={};for(var s=0;s"+t.valueOf().toString()+"",t=gh.firstChild;e.firstChild;)e.removeChild(e.firstChild);for(;t.firstChild;)e.appendChild(t.firstChild)}});function Sd(e,t){if(t){var n=e.firstChild;if(n&&n===e.lastChild&&n.nodeType===3){n.nodeValue=t;return}}e.textContent=t}var qu={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},CB=["Webkit","ms","Moz","O"];Object.keys(qu).forEach(function(e){CB.forEach(function(t){t=t+e.charAt(0).toUpperCase()+e.substring(1),qu[t]=qu[e]})});function ZC(e,t,n){return t==null||typeof t=="boolean"||t===""?"":n||typeof t!="number"||t===0||qu.hasOwnProperty(e)&&qu[e]?(""+t).trim():t+"px"}function JC(e,t){e=e.style;for(var n in t)if(t.hasOwnProperty(n)){var r=n.indexOf("--")===0,s=ZC(n,t[n],r);n==="float"&&(n="cssFloat"),r?e.setProperty(n,s):e[n]=s}}var IB=hn({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 zb(e,t){if(t){if(IB[e]&&(t.children!=null||t.dangerouslySetInnerHTML!=null))throw Error(Se(137,e));if(t.dangerouslySetInnerHTML!=null){if(t.children!=null)throw Error(Se(60));if(typeof t.dangerouslySetInnerHTML!="object"||!("__html"in t.dangerouslySetInnerHTML))throw Error(Se(61))}if(t.style!=null&&typeof t.style!="object")throw Error(Se(62))}}function Vb(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 Kb=null;function hx(e){return e=e.target||e.srcElement||window,e.correspondingUseElement&&(e=e.correspondingUseElement),e.nodeType===3?e.parentNode:e}var Yb=null,Xl=null,Ql=null;function W_(e){if(e=wf(e)){if(typeof Yb!="function")throw Error(Se(280));var t=e.stateNode;t&&(t=hg(t),Yb(e.stateNode,e.type,t))}}function eI(e){Xl?Ql?Ql.push(e):Ql=[e]:Xl=e}function tI(){if(Xl){var e=Xl,t=Ql;if(Ql=Xl=null,W_(e),t)for(e=0;e>>=0,e===0?32:31-($B(e)/HB|0)|0}var yh=64,bh=4194304;function Du(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 Xp(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=Du(o):(i&=a,i!==0&&(r=Du(i)))}else a=n&~s,a!==0?r=Du(a):i!==0&&(r=Du(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 Ef(e,t,n){e.pendingLanes|=t,t!==536870912&&(e.suspendedLanes=0,e.pingedLanes=0),e=e.eventTimes,t=31-Ys(t),e[t]=n}function YB(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=Qu),rk=" ",sk=!1;function wI(e,t){switch(e){case"keyup":return x8.indexOf(t.keyCode)!==-1;case"keydown":return t.keyCode!==229;case"keypress":case"mousedown":case"focusout":return!0;default:return!1}}function vI(e){return e=e.detail,typeof e=="object"&&"data"in e?e.data:null}var Nl=!1;function v8(e,t){switch(e){case"compositionend":return vI(t);case"keypress":return t.which!==32?null:(sk=!0,rk);case"textInput":return e=t.data,e===rk&&sk?null:e;default:return null}}function _8(e,t){if(Nl)return e==="compositionend"||!wx&&wI(e,t)?(e=EI(),mp=bx=ka=null,Nl=!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=lk(n)}}function SI(e,t){return e&&t?e===t?!0:e&&e.nodeType===3?!1:t&&t.nodeType===3?SI(e,t.parentNode):"contains"in e?e.contains(t):e.compareDocumentPosition?!!(e.compareDocumentPosition(t)&16):!1:!1}function TI(){for(var e=window,t=Yp();t instanceof e.HTMLIFrameElement;){try{var n=typeof t.contentWindow.location.href=="string"}catch{n=!1}if(n)e=t.contentWindow;else break;t=Yp(e.document)}return t}function vx(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 R8(e){var t=TI(),n=e.focusedElem,r=e.selectionRange;if(t!==n&&n&&n.ownerDocument&&SI(n.ownerDocument.documentElement,n)){if(r!==null&&vx(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=ck(n,i);var a=ck(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,Sl=null,Zb=null,Ju=null,Jb=!1;function uk(e,t,n){var r=n.window===n?n.document:n.nodeType===9?n:n.ownerDocument;Jb||Sl==null||Sl!==Yp(r)||(r=Sl,"selectionStart"in r&&vx(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}),Ju&&Rd(Ju,r)||(Ju=r,r=Jp(Zb,"onSelect"),0Cl||(e.current=i1[Cl],i1[Cl]=null,Cl--)}function zt(e,t){Cl++,i1[Cl]=e.current,e.current=t}var Fa={},gr=za(Fa),Br=za(!1),To=Fa;function dc(e,t){var n=e.type.contextTypes;if(!n)return Fa;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 Fr(e){return e=e.childContextTypes,e!=null}function tm(){Wt(Br),Wt(gr)}function yk(e,t,n){if(gr.current!==Fa)throw Error(Se(168));zt(gr,t),zt(Br,n)}function DI(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(Se(108,TB(e)||"Unknown",s));return hn({},n,r)}function nm(e){return e=(e=e.stateNode)&&e.__reactInternalMemoizedMergedChildContext||Fa,To=gr.current,zt(gr,e),zt(Br,Br.current),!0}function bk(e,t,n){var r=e.stateNode;if(!r)throw Error(Se(169));n?(e=DI(e,t,To),r.__reactInternalMemoizedMergedChildContext=e,Wt(Br),Wt(gr),zt(gr,e)):Wt(Br),zt(Br,n)}var Ui=null,pg=!1,Z0=!1;function PI(e){Ui===null?Ui=[e]:Ui.push(e)}function V8(e){pg=!0,PI(e)}function Va(){if(!Z0&&Ui!==null){Z0=!0;var e=0,t=Lt;try{var n=Ui;for(Lt=1;e>=a,s-=a,Hi=1<<32-Ys(t)+s|n<S?(A=C,C=null):A=C.sibling;var O=h(g,C,b[S],_);if(O===null){C===null&&(C=A);break}e&&C&&O.alternate===null&&t(g,C),x=i(O,x,S),N===null?k=O:N.sibling=O,N=O,C=A}if(S===b.length)return n(g,C),rn&&to(g,S),k;if(C===null){for(;SS?(A=C,C=null):A=C.sibling;var D=h(g,C,O.value,_);if(D===null){C===null&&(C=A);break}e&&C&&D.alternate===null&&t(g,C),x=i(D,x,S),N===null?k=D:N.sibling=D,N=D,C=A}if(O.done)return n(g,C),rn&&to(g,S),k;if(C===null){for(;!O.done;S++,O=b.next())O=f(g,O.value,_),O!==null&&(x=i(O,x,S),N===null?k=O:N.sibling=O,N=O);return rn&&to(g,S),k}for(C=r(g,C);!O.done;S++,O=b.next())O=p(C,g,S,O.value,_),O!==null&&(e&&O.alternate!==null&&C.delete(O.key===null?S:O.key),x=i(O,x,S),N===null?k=O:N.sibling=O,N=O);return e&&C.forEach(function(F){return t(g,F)}),rn&&to(g,S),k}function E(g,x,b,_){if(typeof b=="object"&&b!==null&&b.type===kl&&b.key===null&&(b=b.props.children),typeof b=="object"&&b!==null){switch(b.$$typeof){case ph:e:{for(var k=b.key,N=x;N!==null;){if(N.key===k){if(k=b.type,k===kl){if(N.tag===7){n(g,N.sibling),x=s(N,b.props.children),x.return=g,g=x;break e}}else if(N.elementType===k||typeof k=="object"&&k!==null&&k.$$typeof===ya&&wk(k)===N.type){n(g,N.sibling),x=s(N,b.props),x.ref=gu(g,N,b),x.return=g,g=x;break e}n(g,N);break}else t(g,N);N=N.sibling}b.type===kl?(x=xo(b.props.children,g.mode,_,b.key),x.return=g,g=x):(_=_p(b.type,b.key,b.props,null,g.mode,_),_.ref=gu(g,x,b),_.return=g,g=_)}return a(g);case _l:e:{for(N=b.key;x!==null;){if(x.key===N)if(x.tag===4&&x.stateNode.containerInfo===b.containerInfo&&x.stateNode.implementation===b.implementation){n(g,x.sibling),x=s(x,b.children||[]),x.return=g,g=x;break e}else{n(g,x);break}else t(g,x);x=x.sibling}x=ay(b,g.mode,_),x.return=g,g=x}return a(g);case ya:return N=b._init,E(g,x,N(b._payload),_)}if(ju(b))return m(g,x,b,_);if(du(b))return y(g,x,b,_);Nh(g,b)}return typeof b=="string"&&b!==""||typeof b=="number"?(b=""+b,x!==null&&x.tag===6?(n(g,x.sibling),x=s(x,b),x.return=g,g=x):(n(g,x),x=iy(b,g.mode,_),x.return=g,g=x),a(g)):n(g,x)}return E}var hc=$I(!0),HI=$I(!1),im=za(null),am=null,Rl=null,Sx=null;function Tx(){Sx=Rl=am=null}function Ax(e){var t=im.current;Wt(im),e._currentValue=t}function l1(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 Jl(e,t){am=e,Sx=Rl=null,e=e.dependencies,e!==null&&e.firstContext!==null&&(e.lanes&t&&(Dr=!0),e.firstContext=null)}function _s(e){var t=e._currentValue;if(Sx!==e)if(e={context:e,memoizedValue:t,next:null},Rl===null){if(am===null)throw Error(Se(308));Rl=e,am.dependencies={lanes:0,firstContext:e}}else Rl=Rl.next=e;return t}var fo=null;function Cx(e){fo===null?fo=[e]:fo.push(e)}function zI(e,t,n,r){var s=t.interleaved;return s===null?(n.next=n,Cx(t)):(n.next=s.next,s.next=n),t.interleaved=n,Zi(e,r)}function Zi(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 ba=!1;function Ix(e){e.updateQueue={baseState:e.memoizedState,firstBaseUpdate:null,lastBaseUpdate:null,shared:{pending:null,interleaved:null,lanes:0},effects:null}}function VI(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 Yi(e,t){return{eventTime:e,lane:t,tag:0,payload:null,callback:null,next:null}}function Ra(e,t,n){var r=e.updateQueue;if(r===null)return null;if(r=r.shared,Nt&2){var s=r.pending;return s===null?t.next=t:(t.next=s.next,s.next=t),r.pending=t,Zi(e,n)}return s=r.interleaved,s===null?(t.next=t,Cx(r)):(t.next=s.next,s.next=t),r.interleaved=t,Zi(e,n)}function yp(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,mx(e,n)}}function vk(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 om(e,t,n,r){var s=e.updateQueue;ba=!1;var i=s.firstBaseUpdate,a=s.lastBaseUpdate,o=s.shared.pending;if(o!==null){s.shared.pending=null;var c=o,u=c.next;c.next=null,a===null?i=u:a.next=u,a=c;var d=e.alternate;d!==null&&(d=d.updateQueue,o=d.lastBaseUpdate,o!==a&&(o===null?d.firstBaseUpdate=u:o.next=u,d.lastBaseUpdate=c))}if(i!==null){var f=s.baseState;a=0,d=u=c=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=hn({},f,h);break e;case 2:ba=!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,c=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&&(c=f),s.baseState=c,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);Io|=a,e.lanes=a,e.memoizedState=f}}function _k(e,t,n){if(e=t.effects,t.effects=null,e!==null)for(t=0;tn?n:4,e(!0);var r=ey.transition;ey.transition={};try{e(!1),t()}finally{Lt=n,ey.transition=r}}function oO(){return ks().memoizedState}function W8(e,t,n){var r=Ma(e);if(n={lane:r,action:n,hasEagerState:!1,eagerState:null,next:null},lO(e))cO(t,n);else if(n=zI(e,t,n,r),n!==null){var s=Sr();Gs(n,e,r,s),uO(n,t,r)}}function q8(e,t,n){var r=Ma(e),s={lane:r,action:n,hasEagerState:!1,eagerState:null,next:null};if(lO(e))cO(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,Qs(o,a)){var c=t.interleaved;c===null?(s.next=s,Cx(t)):(s.next=c.next,c.next=s),t.interleaved=s;return}}catch{}finally{}n=zI(e,t,s,r),n!==null&&(s=Sr(),Gs(n,e,r,s),uO(n,t,r))}}function lO(e){var t=e.alternate;return e===fn||t!==null&&t===fn}function cO(e,t){ed=cm=!0;var n=e.pending;n===null?t.next=t:(t.next=n.next,n.next=t),e.pending=t}function uO(e,t,n){if(n&4194240){var r=t.lanes;r&=e.pendingLanes,n|=r,t.lanes=n,mx(e,n)}}var um={readContext:_s,useCallback:cr,useContext:cr,useEffect:cr,useImperativeHandle:cr,useInsertionEffect:cr,useLayoutEffect:cr,useMemo:cr,useReducer:cr,useRef:cr,useState:cr,useDebugValue:cr,useDeferredValue:cr,useTransition:cr,useMutableSource:cr,useSyncExternalStore:cr,useId:cr,unstable_isNewReconciler:!1},X8={readContext:_s,useCallback:function(e,t){return ui().memoizedState=[e,t===void 0?null:t],e},useContext:_s,useEffect:Nk,useImperativeHandle:function(e,t,n){return n=n!=null?n.concat([e]):null,Ep(4194308,4,nO.bind(null,t,e),n)},useLayoutEffect:function(e,t){return Ep(4194308,4,e,t)},useInsertionEffect:function(e,t){return Ep(4,2,e,t)},useMemo:function(e,t){var n=ui();return t=t===void 0?null:t,e=e(),n.memoizedState=[e,t],e},useReducer:function(e,t,n){var r=ui();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=W8.bind(null,fn,e),[r.memoizedState,e]},useRef:function(e){var t=ui();return e={current:e},t.memoizedState=e},useState:kk,useDebugValue:Bx,useDeferredValue:function(e){return ui().memoizedState=e},useTransition:function(){var e=kk(!1),t=e[0];return e=G8.bind(null,e[1]),ui().memoizedState=e,[t,e]},useMutableSource:function(){},useSyncExternalStore:function(e,t,n){var r=fn,s=ui();if(rn){if(n===void 0)throw Error(Se(407));n=n()}else{if(n=t(),Qn===null)throw Error(Se(349));Co&30||WI(r,t,n)}s.memoizedState=n;var i={value:n,getSnapshot:t};return s.queue=i,Nk(XI.bind(null,r,i,e),[e]),r.flags|=2048,Ud(9,qI.bind(null,r,i,n,t),void 0,null),n},useId:function(){var e=ui(),t=Qn.identifierPrefix;if(rn){var n=zi,r=Hi;n=(r&~(1<<32-Ys(r)-1)).toString(32)+n,t=":"+t+"R"+n,n=Bd++,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[pi]=t,e[jd]=r,xO(e,t,!1,!1),t.stateNode=e;e:{switch(a=Vb(n,r),n){case"dialog":Gt("cancel",e),Gt("close",e),s=r;break;case"iframe":case"object":case"embed":Gt("load",e),s=r;break;case"video":case"audio":for(s=0;sgc&&(t.flags|=128,r=!0,yu(i,!1),t.lanes=4194304)}else{if(!r)if(e=lm(a),e!==null){if(t.flags|=128,r=!0,n=e.updateQueue,n!==null&&(t.updateQueue=n,t.flags|=4),yu(i,!0),i.tail===null&&i.tailMode==="hidden"&&!a.alternate&&!rn)return ur(t),null}else 2*An()-i.renderingStartTime>gc&&n!==1073741824&&(t.flags|=128,r=!0,yu(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=An(),t.sibling=null,n=un.current,zt(un,r?n&1|2:n&1),t):(ur(t),null);case 22:case 23:return Vx(),r=t.memoizedState!==null,e!==null&&e.memoizedState!==null!==r&&(t.flags|=8192),r&&t.mode&1?qr&1073741824&&(ur(t),t.subtreeFlags&6&&(t.flags|=8192)):ur(t),null;case 24:return null;case 25:return null}throw Error(Se(156,t.tag))}function sF(e,t){switch(kx(t),t.tag){case 1:return Fr(t.type)&&tm(),e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 3:return pc(),Wt(Br),Wt(gr),Lx(),e=t.flags,e&65536&&!(e&128)?(t.flags=e&-65537|128,t):null;case 5:return Rx(t),null;case 13:if(Wt(un),e=t.memoizedState,e!==null&&e.dehydrated!==null){if(t.alternate===null)throw Error(Se(340));fc()}return e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 19:return Wt(un),null;case 4:return pc(),null;case 10:return Ax(t.type._context),null;case 22:case 23:return Vx(),null;case 24:return null;default:return null}}var Th=!1,fr=!1,iF=typeof WeakSet=="function"?WeakSet:Set,$e=null;function Ll(e,t){var n=e.ref;if(n!==null)if(typeof n=="function")try{n(null)}catch(r){xn(e,t,r)}else n.current=null}function y1(e,t,n){try{n()}catch(r){xn(e,t,r)}}var Dk=!1;function aF(e,t){if(e1=Qp,e=TI(),vx(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,c=-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||(c=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&&(c=a),(p=f.nextSibling)!==null)break;f=h,h=f.parentNode}f=p}n=o===-1||c===-1?null:{start:o,end:c}}else n=null}n=n||{start:0,end:0}}else n=null;for(t1={focusedElem:e,selectionRange:n},Qp=!1,$e=t;$e!==null;)if(t=$e,e=t.child,(t.subtreeFlags&1028)!==0&&e!==null)e.return=t,$e=e;else for(;$e!==null;){t=$e;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,E=m.memoizedState,g=t.stateNode,x=g.getSnapshotBeforeUpdate(t.elementType===t.type?y:Ps(t.type,y),E);g.__reactInternalSnapshotBeforeUpdate=x}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(Se(163))}}catch(_){xn(t,t.return,_)}if(e=t.sibling,e!==null){e.return=t.return,$e=e;break}$e=t.return}return m=Dk,Dk=!1,m}function td(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&&y1(t,n,i)}s=s.next}while(s!==r)}}function yg(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 b1(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 _O(e){var t=e.alternate;t!==null&&(e.alternate=null,_O(t)),e.child=null,e.deletions=null,e.sibling=null,e.tag===5&&(t=e.stateNode,t!==null&&(delete t[pi],delete t[jd],delete t[s1],delete t[H8],delete t[z8])),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 kO(e){return e.tag===5||e.tag===3||e.tag===4}function Pk(e){e:for(;;){for(;e.sibling===null;){if(e.return===null||kO(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 E1(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=em));else if(r!==4&&(e=e.child,e!==null))for(E1(e,t,n),e=e.sibling;e!==null;)E1(e,t,n),e=e.sibling}function x1(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(x1(e,t,n),e=e.sibling;e!==null;)x1(e,t,n),e=e.sibling}var nr=null,Bs=!1;function ca(e,t,n){for(n=n.child;n!==null;)NO(e,t,n),n=n.sibling}function NO(e,t,n){if(gi&&typeof gi.onCommitFiberUnmount=="function")try{gi.onCommitFiberUnmount(cg,n)}catch{}switch(n.tag){case 5:fr||Ll(n,t);case 6:var r=nr,s=Bs;nr=null,ca(e,t,n),nr=r,Bs=s,nr!==null&&(Bs?(e=nr,n=n.stateNode,e.nodeType===8?e.parentNode.removeChild(n):e.removeChild(n)):nr.removeChild(n.stateNode));break;case 18:nr!==null&&(Bs?(e=nr,n=n.stateNode,e.nodeType===8?Q0(e.parentNode,n):e.nodeType===1&&Q0(e,n),Id(e)):Q0(nr,n.stateNode));break;case 4:r=nr,s=Bs,nr=n.stateNode.containerInfo,Bs=!0,ca(e,t,n),nr=r,Bs=s;break;case 0:case 11:case 14:case 15:if(!fr&&(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)&&y1(n,t,a),s=s.next}while(s!==r)}ca(e,t,n);break;case 1:if(!fr&&(Ll(n,t),r=n.stateNode,typeof r.componentWillUnmount=="function"))try{r.props=n.memoizedProps,r.state=n.memoizedState,r.componentWillUnmount()}catch(o){xn(n,t,o)}ca(e,t,n);break;case 21:ca(e,t,n);break;case 22:n.mode&1?(fr=(r=fr)||n.memoizedState!==null,ca(e,t,n),fr=r):ca(e,t,n);break;default:ca(e,t,n)}}function Bk(e){var t=e.updateQueue;if(t!==null){e.updateQueue=null;var n=e.stateNode;n===null&&(n=e.stateNode=new iF),t.forEach(function(r){var s=mF.bind(null,e,r);n.has(r)||(n.add(r),r.then(s,s))})}}function Ls(e,t){var n=t.deletions;if(n!==null)for(var r=0;rs&&(s=a),r&=~i}if(r=s,r=An()-r,r=(120>r?120:480>r?480:1080>r?1080:1920>r?1920:3e3>r?3e3:4320>r?4320:1960*lF(r/1960))-r,10e?16:e,Na===null)var r=!1;else{if(e=Na,Na=null,hm=0,Nt&6)throw Error(Se(331));var s=Nt;for(Nt|=4,$e=e.current;$e!==null;){var i=$e,a=i.child;if($e.flags&16){var o=i.deletions;if(o!==null){for(var c=0;cAn()-Hx?Eo(e,0):$x|=n),Ur(e,t)}function LO(e,t){t===0&&(e.mode&1?(t=bh,bh<<=1,!(bh&130023424)&&(bh=4194304)):t=1);var n=Sr();e=Zi(e,t),e!==null&&(Ef(e,t,n),Ur(e,n))}function pF(e){var t=e.memoizedState,n=0;t!==null&&(n=t.retryLane),LO(e,n)}function mF(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(Se(314))}r!==null&&r.delete(t),LO(e,n)}var MO;MO=function(e,t,n){if(e!==null)if(e.memoizedProps!==t.pendingProps||Br.current)Dr=!0;else{if(!(e.lanes&n)&&!(t.flags&128))return Dr=!1,nF(e,t,n);Dr=!!(e.flags&131072)}else Dr=!1,rn&&t.flags&1048576&&BI(t,sm,t.index);switch(t.lanes=0,t.tag){case 2:var r=t.type;xp(e,t),e=t.pendingProps;var s=dc(t,gr.current);Jl(t,n),s=jx(null,t,r,e,s,n);var i=Dx();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,Fr(r)?(i=!0,nm(t)):i=!1,t.memoizedState=s.state!==null&&s.state!==void 0?s.state:null,Ix(t),s.updater=gg,t.stateNode=s,s._reactInternals=t,u1(t,r,e,n),t=h1(null,t,r,!0,i,n)):(t.tag=0,rn&&i&&_x(t),vr(null,t,s,n),t=t.child),t;case 16:r=t.elementType;e:{switch(xp(e,t),e=t.pendingProps,s=r._init,r=s(r._payload),t.type=r,s=t.tag=yF(r),e=Ps(r,e),s){case 0:t=f1(null,t,r,e,n);break e;case 1:t=Lk(null,t,r,e,n);break e;case 11:t=Ok(null,t,r,e,n);break e;case 14:t=Rk(null,t,r,Ps(r.type,e),n);break e}throw Error(Se(306,r,""))}return t;case 0:return r=t.type,s=t.pendingProps,s=t.elementType===r?s:Ps(r,s),f1(e,t,r,s,n);case 1:return r=t.type,s=t.pendingProps,s=t.elementType===r?s:Ps(r,s),Lk(e,t,r,s,n);case 3:e:{if(yO(t),e===null)throw Error(Se(387));r=t.pendingProps,i=t.memoizedState,s=i.element,VI(e,t),om(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=mc(Error(Se(423)),t),t=Mk(e,t,r,n,s);break e}else if(r!==s){s=mc(Error(Se(424)),t),t=Mk(e,t,r,n,s);break e}else for(Qr=Oa(t.stateNode.containerInfo.firstChild),Zr=t,rn=!0,Us=null,n=HI(t,null,r,n),t.child=n;n;)n.flags=n.flags&-3|4096,n=n.sibling;else{if(fc(),r===s){t=Ji(e,t,n);break e}vr(e,t,r,n)}t=t.child}return t;case 5:return KI(t),e===null&&o1(t),r=t.type,s=t.pendingProps,i=e!==null?e.memoizedProps:null,a=s.children,n1(r,s)?a=null:i!==null&&n1(r,i)&&(t.flags|=32),gO(e,t),vr(e,t,a,n),t.child;case 6:return e===null&&o1(t),null;case 13:return bO(e,t,n);case 4:return Ox(t,t.stateNode.containerInfo),r=t.pendingProps,e===null?t.child=hc(t,null,r,n):vr(e,t,r,n),t.child;case 11:return r=t.type,s=t.pendingProps,s=t.elementType===r?s:Ps(r,s),Ok(e,t,r,s,n);case 7:return vr(e,t,t.pendingProps,n),t.child;case 8:return vr(e,t,t.pendingProps.children,n),t.child;case 12:return vr(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,zt(im,r._currentValue),r._currentValue=a,i!==null)if(Qs(i.value,a)){if(i.children===s.children&&!Br.current){t=Ji(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 c=o.firstContext;c!==null;){if(c.context===r){if(i.tag===1){c=Yi(-1,n&-n),c.tag=2;var u=i.updateQueue;if(u!==null){u=u.shared;var d=u.pending;d===null?c.next=c:(c.next=d.next,d.next=c),u.pending=c}}i.lanes|=n,c=i.alternate,c!==null&&(c.lanes|=n),l1(i.return,n,t),o.lanes|=n;break}c=c.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(Se(341));a.lanes|=n,o=a.alternate,o!==null&&(o.lanes|=n),l1(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}vr(e,t,s.children,n),t=t.child}return t;case 9:return s=t.type,r=t.pendingProps.children,Jl(t,n),s=_s(s),r=r(s),t.flags|=1,vr(e,t,r,n),t.child;case 14:return r=t.type,s=Ps(r,t.pendingProps),s=Ps(r.type,s),Rk(e,t,r,s,n);case 15:return pO(e,t,t.type,t.pendingProps,n);case 17:return r=t.type,s=t.pendingProps,s=t.elementType===r?s:Ps(r,s),xp(e,t),t.tag=1,Fr(r)?(e=!0,nm(t)):e=!1,Jl(t,n),dO(t,r,s),u1(t,r,s,n),h1(null,t,r,!0,e,n);case 19:return EO(e,t,n);case 22:return mO(e,t,n)}throw Error(Se(156,t.tag))};function jO(e,t){return lI(e,t)}function gF(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 Es(e,t,n,r){return new gF(e,t,n,r)}function Yx(e){return e=e.prototype,!(!e||!e.isReactComponent)}function yF(e){if(typeof e=="function")return Yx(e)?1:0;if(e!=null){if(e=e.$$typeof,e===dx)return 11;if(e===fx)return 14}return 2}function ja(e,t){var n=e.alternate;return n===null?(n=Es(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 _p(e,t,n,r,s,i){var a=2;if(r=e,typeof e=="function")Yx(e)&&(a=1);else if(typeof e=="string")a=5;else e:switch(e){case kl:return xo(n.children,s,i,t);case ux:a=8,s|=8;break;case Mb:return e=Es(12,n,t,s|2),e.elementType=Mb,e.lanes=i,e;case jb:return e=Es(13,n,t,s),e.elementType=jb,e.lanes=i,e;case Db:return e=Es(19,n,t,s),e.elementType=Db,e.lanes=i,e;case KC:return Eg(n,s,i,t);default:if(typeof e=="object"&&e!==null)switch(e.$$typeof){case zC:a=10;break e;case VC:a=9;break e;case dx:a=11;break e;case fx:a=14;break e;case ya:a=16,r=null;break e}throw Error(Se(130,e==null?e:typeof e,""))}return t=Es(a,n,t,s),t.elementType=e,t.type=r,t.lanes=i,t}function xo(e,t,n,r){return e=Es(7,e,r,t),e.lanes=n,e}function Eg(e,t,n,r){return e=Es(22,e,r,t),e.elementType=KC,e.lanes=n,e.stateNode={isHidden:!1},e}function iy(e,t,n){return e=Es(6,e,null,t),e.lanes=n,e}function ay(e,t,n){return t=Es(4,e.children!==null?e.children:[],e.key,t),t.lanes=n,t.stateNode={containerInfo:e.containerInfo,pendingChildren:null,implementation:e.implementation},t}function bF(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=U0(0),this.expirationTimes=U0(-1),this.entangledLanes=this.finishedLanes=this.mutableReadLanes=this.expiredLanes=this.pingedLanes=this.suspendedLanes=this.pendingLanes=0,this.entanglements=U0(0),this.identifierPrefix=r,this.onRecoverableError=s,this.mutableSourceEagerHydrationData=null}function Gx(e,t,n,r,s,i,a,o,c){return e=new bF(e,t,n,o,c),t===1?(t=1,i===!0&&(t|=8)):t=0,i=Es(3,null,null,t),e.current=i,i.stateNode=e,i.memoizedState={element:r,isDehydrated:n,cache:null,transitions:null,pendingSuspenseBoundaries:null},Ix(i),e}function EF(e,t,n){var r=3"u"||typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE!="function"))try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(FO)}catch(e){console.error(e)}}FO(),FC.exports=ss;var Ns=FC.exports,Yk=Ns;Rb.createRoot=Yk.createRoot,Rb.hydrateRoot=Yk.hydrateRoot;const Qx=w.createContext({});function kg(e){const t=w.useRef(null);return t.current===null&&(t.current=e()),t.current}const Ng=w.createContext(null),Hd=w.createContext({transformPagePoint:e=>e,isStatic:!1,reducedMotion:"never"});class kF extends w.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 NF({children:e,isPresent:t}){const n=w.useId(),r=w.useRef(null),s=w.useRef({width:0,height:0,top:0,left:0}),{nonce:i}=w.useContext(Hd);return w.useInsertionEffect(()=>{const{width:a,height:o,top:c,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; + height: ${o}px !important; + top: ${c}px !important; + left: ${u}px !important; + } + `),()=>{document.head.removeChild(d)}},[t]),l.jsx(kF,{isPresent:t,childRef:r,sizeRef:s,children:w.cloneElement(e,{ref:r})})}const SF=({children:e,initial:t,isPresent:n,onExitComplete:r,custom:s,presenceAffectsLayout:i,mode:a})=>{const o=kg(TF),c=w.useId(),u=w.useCallback(f=>{o.set(f,!0);for(const h of o.values())if(!h)return;r&&r()},[o,r]),d=w.useMemo(()=>({id:c,initial:t,isPresent:n,custom:s,onExitComplete:u,register:f=>(o.set(f,!1),()=>o.delete(f))}),i?[Math.random(),u]:[n,u]);return w.useMemo(()=>{o.forEach((f,h)=>o.set(h,!1))},[n]),w.useEffect(()=>{!n&&!o.size&&r&&r()},[n]),a==="popLayout"&&(e=l.jsx(NF,{isPresent:n,children:e})),l.jsx(Ng.Provider,{value:d,children:e})};function TF(){return new Map}function UO(e=!0){const t=w.useContext(Ng);if(t===null)return[!0,null];const{isPresent:n,onExitComplete:r,register:s}=t,i=w.useId();w.useEffect(()=>{e&&s(i)},[e]);const a=w.useCallback(()=>e&&r&&r(i),[i,r,e]);return!n&&r?[!1,a]:[!0]}const Ih=e=>e.key||"";function Gk(e){const t=[];return w.Children.forEach(e,n=>{w.isValidElement(n)&&t.push(n)}),t}const Zx=typeof window<"u",$O=Zx?w.useLayoutEffect:w.useEffect,$s=({children:e,custom:t,initial:n=!0,onExitComplete:r,presenceAffectsLayout:s=!0,mode:i="sync",propagate:a=!1})=>{const[o,c]=UO(a),u=w.useMemo(()=>Gk(e),[e]),d=a&&!o?[]:u.map(Ih),f=w.useRef(!0),h=w.useRef(u),p=kg(()=>new Map),[m,y]=w.useState(u),[E,g]=w.useState(u);$O(()=>{f.current=!1,h.current=u;for(let _=0;_{const k=Ih(_),N=a&&!o?!1:u===E||d.includes(k),C=()=>{if(p.has(k))p.set(k,!0);else return;let S=!0;p.forEach(A=>{A||(S=!1)}),S&&(b==null||b(),g(h.current),a&&(c==null||c()),r&&r())};return l.jsx(SF,{isPresent:N,initial:!f.current||n?void 0:!1,custom:N?void 0:t,presenceAffectsLayout:s,mode:i,onExitComplete:N?void 0:C,children:_},k)})})},Jr=e=>e;let HO=Jr;const AF={useManualTiming:!1};function CF(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)&&(c.schedule(u),e()),u(a)}const c={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,c.process(u))}};return c}const Oh=["read","resolveKeyframes","update","preRender","render","postRender"],IF=40;function zO(e,t){let n=!1,r=!0;const s={delta:0,timestamp:0,isProcessing:!1},i=()=>n=!0,a=Oh.reduce((g,x)=>(g[x]=CF(i),g),{}),{read:o,resolveKeyframes:c,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,IF),1),s.timestamp=g,s.isProcessing=!0,o.process(s),c.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:Oh.reduce((g,x)=>{const b=a[x];return g[x]=(_,k=!1,N=!1)=>(n||m(),b.schedule(_,k,N)),g},{}),cancel:g=>{for(let x=0;xWk[e].some(n=>!!t[n])};function OF(e){for(const t in e)yc[t]={...yc[t],...e[t]}}const RF=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 gm(e){return e.startsWith("while")||e.startsWith("drag")&&e!=="draggable"||e.startsWith("layout")||e.startsWith("onTap")||e.startsWith("onPan")||e.startsWith("onLayout")||RF.has(e)}let KO=e=>!gm(e);function YO(e){e&&(KO=t=>t.startsWith("on")?!gm(t):e(t))}try{YO(require("@emotion/is-prop-valid").default)}catch{}function LF(e,t,n){const r={};for(const s in e)s==="values"&&typeof e.values=="object"||(KO(s)||n===!0&&gm(s)||!t&&!gm(s)||e.draggable&&s.startsWith("onDrag"))&&(r[s]=e[s]);return r}function MF({children:e,isValidProp:t,...n}){t&&YO(t),n={...w.useContext(Hd),...n},n.isStatic=kg(()=>n.isStatic);const r=w.useMemo(()=>n,[JSON.stringify(n.transition),n.transformPagePoint,n.reducedMotion]);return l.jsx(Hd.Provider,{value:r,children:e})}function jF(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 Sg=w.createContext({});function zd(e){return typeof e=="string"||Array.isArray(e)}function Tg(e){return e!==null&&typeof e=="object"&&typeof e.start=="function"}const Jx=["animate","whileInView","whileFocus","whileHover","whileTap","whileDrag","exit"],ew=["initial",...Jx];function Ag(e){return Tg(e.animate)||ew.some(t=>zd(e[t]))}function GO(e){return!!(Ag(e)||e.variants)}function DF(e,t){if(Ag(e)){const{initial:n,animate:r}=e;return{initial:n===!1||zd(n)?n:void 0,animate:zd(r)?r:void 0}}return e.inherit!==!1?t:{}}function PF(e){const{initial:t,animate:n}=DF(e,w.useContext(Sg));return w.useMemo(()=>({initial:t,animate:n}),[qk(t),qk(n)])}function qk(e){return Array.isArray(e)?e.join(" "):e}const BF=Symbol.for("motionComponentSymbol");function jl(e){return e&&typeof e=="object"&&Object.prototype.hasOwnProperty.call(e,"current")}function FF(e,t,n){return w.useCallback(r=>{r&&e.onMount&&e.onMount(r),t&&(r?t.mount(r):t.unmount()),n&&(typeof n=="function"?n(r):jl(n)&&(n.current=r))},[t])}const tw=e=>e.replace(/([a-z])([A-Z])/gu,"$1-$2").toLowerCase(),UF="framerAppearId",WO="data-"+tw(UF),{schedule:nw}=zO(queueMicrotask,!1),qO=w.createContext({});function $F(e,t,n,r,s){var i,a;const{visualElement:o}=w.useContext(Sg),c=w.useContext(VO),u=w.useContext(Ng),d=w.useContext(Hd).reducedMotion,f=w.useRef(null);r=r||c.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=w.useContext(qO);h&&!h.projection&&s&&(h.type==="html"||h.type==="svg")&&HF(f.current,n,s,p);const m=w.useRef(!1);w.useInsertionEffect(()=>{h&&m.current&&h.update(n,u)});const y=n[WO],E=w.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 $O(()=>{h&&(m.current=!0,window.MotionIsMounted=!0,h.updateFeatures(),nw.render(h.render),E.current&&h.animationState&&h.animationState.animateChanges())}),w.useEffect(()=>{h&&(!E.current&&h.animationState&&h.animationState.animateChanges(),E.current&&(queueMicrotask(()=>{var g;(g=window.MotionHandoffMarkAsComplete)===null||g===void 0||g.call(window,y)}),E.current=!1))}),h}function HF(e,t,n,r){const{layoutId:s,layout:i,drag:a,dragConstraints:o,layoutScroll:c,layoutRoot:u}=t;e.projection=new n(e.latestValues,t["data-framer-portal-id"]?void 0:XO(e.parent)),e.projection.setOptions({layoutId:s,layout:i,alwaysMeasureLayout:!!a||o&&jl(o),visualElement:e,animationType:typeof i=="string"?i:"both",initialPromotionConfig:r,layoutScroll:c,layoutRoot:u})}function XO(e){if(e)return e.options.allowProjection!==!1?e.projection:XO(e.parent)}function zF({preloadedFeatures:e,createVisualElement:t,useRender:n,useVisualState:r,Component:s}){var i,a;e&&OF(e);function o(u,d){let f;const h={...w.useContext(Hd),...u,layoutId:VF(u)},{isStatic:p}=h,m=PF(u),y=r(u,p);if(!p&&Zx){KF();const E=YF(h);f=E.MeasureLayout,m.visualElement=$F(s,y,h,t,E.ProjectionNode)}return l.jsxs(Sg.Provider,{value:m,children:[f&&m.visualElement?l.jsx(f,{visualElement:m.visualElement,...h}):null,n(s,u,FF(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 c=w.forwardRef(o);return c[BF]=s,c}function VF({layoutId:e}){const t=w.useContext(Qx).id;return t&&e!==void 0?t+"-"+e:e}function KF(e,t){w.useContext(VO).strict}function YF(e){const{drag:t,layout:n}=yc;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 GF=["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 rw(e){return typeof e!="string"||e.includes("-")?!1:!!(GF.indexOf(e)>-1||/[A-Z]/u.test(e))}function Xk(e){const t=[{},{}];return e==null||e.values.forEach((n,r)=>{t[0][r]=n.get(),t[1][r]=n.getVelocity()}),t}function sw(e,t,n,r){if(typeof t=="function"){const[s,i]=Xk(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]=Xk(r);t=t(n!==void 0?n:e.custom,s,i)}return t}const N1=e=>Array.isArray(e),WF=e=>!!(e&&typeof e=="object"&&e.mix&&e.toValue),qF=e=>N1(e)?e[e.length-1]||0:e,hr=e=>!!(e&&e.getVelocity);function kp(e){const t=hr(e)?e.get():e;return WF(t)?t.toValue():t}function XF({scrapeMotionValuesFromProps:e,createRenderState:t,onUpdate:n},r,s,i){const a={latestValues:QF(r,s,i,e),renderState:t()};return n&&(a.onMount=o=>n({props:r,current:o,...a}),a.onUpdate=o=>n(o)),a}const QO=e=>(t,n)=>{const r=w.useContext(Sg),s=w.useContext(Ng),i=()=>XF(e,t,r,s);return n?i():kg(i)};function QF(e,t,n,r){const s={},i=r(e,{});for(const h in i)s[h]=kp(i[h]);let{initial:a,animate:o}=e;const c=Ag(e),u=GO(e);t&&u&&!c&&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"&&!Tg(f)){const h=Array.isArray(f)?f:[f];for(let p=0;pt=>typeof t=="string"&&t.startsWith(e),JO=ZO("--"),ZF=ZO("var(--"),iw=e=>ZF(e)?JF.test(e.split("/*")[0].trim()):!1,JF=/var\(--(?:[\w-]+\s*|[\w-]+\s*,(?:\s*[^)(\s]|\s*\((?:[^)(]|\([^)(]*\))*\))+\s*)\)$/iu,eR=(e,t)=>t&&typeof e=="number"?t.transform(e):e,ea=(e,t,n)=>n>t?t:ntypeof e=="number",parse:parseFloat,transform:e=>e},Vd={...Yc,transform:e=>ea(0,1,e)},Rh={...Yc,default:1},_f=e=>({test:t=>typeof t=="string"&&t.endsWith(e)&&t.split(" ").length===1,parse:parseFloat,transform:t=>`${t}${e}`}),pa=_f("deg"),bi=_f("%"),tt=_f("px"),e9=_f("vh"),t9=_f("vw"),Qk={...bi,parse:e=>bi.parse(e)/100,transform:e=>bi.transform(e*100)},n9={borderWidth:tt,borderTopWidth:tt,borderRightWidth:tt,borderBottomWidth:tt,borderLeftWidth:tt,borderRadius:tt,radius:tt,borderTopLeftRadius:tt,borderTopRightRadius:tt,borderBottomRightRadius:tt,borderBottomLeftRadius:tt,width:tt,maxWidth:tt,height:tt,maxHeight:tt,top:tt,right:tt,bottom:tt,left:tt,padding:tt,paddingTop:tt,paddingRight:tt,paddingBottom:tt,paddingLeft:tt,margin:tt,marginTop:tt,marginRight:tt,marginBottom:tt,marginLeft:tt,backgroundPositionX:tt,backgroundPositionY:tt},r9={rotate:pa,rotateX:pa,rotateY:pa,rotateZ:pa,scale:Rh,scaleX:Rh,scaleY:Rh,scaleZ:Rh,skew:pa,skewX:pa,skewY:pa,distance:tt,translateX:tt,translateY:tt,translateZ:tt,x:tt,y:tt,z:tt,perspective:tt,transformPerspective:tt,opacity:Vd,originX:Qk,originY:Qk,originZ:tt},Zk={...Yc,transform:Math.round},aw={...n9,...r9,zIndex:Zk,size:tt,fillOpacity:Vd,strokeOpacity:Vd,numOctaves:Zk},s9={x:"translateX",y:"translateY",z:"translateZ",transformPerspective:"perspective"},i9=Kc.length;function a9(e,t,n){let r="",s=!0;for(let i=0;i({style:{},transform:{},transformOrigin:{},vars:{}}),tR=()=>({...cw(),attrs:{}}),uw=e=>typeof e=="string"&&e.toLowerCase()==="svg";function nR(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 rR=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 sR(e,t,n,r){nR(e,t,void 0,r);for(const s in t.attrs)e.setAttribute(rR.has(s)?s:tw(s),t.attrs[s])}const ym={};function d9(e){Object.assign(ym,e)}function iR(e,{layout:t,layoutId:n}){return Vo.has(e)||e.startsWith("origin")||(t||n!==void 0)&&(!!ym[e]||e==="opacity")}function dw(e,t,n){var r;const{style:s}=e,i={};for(const a in s)(hr(s[a])||t.style&&hr(t.style[a])||iR(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 aR(e,t,n){const r=dw(e,t,n);for(const s in e)if(hr(e[s])||hr(t[s])){const i=Kc.indexOf(s)!==-1?"attr"+s.charAt(0).toUpperCase()+s.substring(1):s;r[i]=e[s]}return r}function f9(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 eN=["x","y","width","height","cx","cy","r"],h9={useVisualState:QO({scrapeMotionValuesFromProps:aR,createRenderState:tR,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(Vo.has(o)){i=!0;break}}if(!i)return;let a=!t;if(t)for(let o=0;o{f9(n,r),qt.render(()=>{lw(r,s,uw(n.tagName),e.transformTemplate),sR(n,r)})})}})},p9={useVisualState:QO({scrapeMotionValuesFromProps:dw,createRenderState:cw})};function oR(e,t,n){for(const r in t)!hr(t[r])&&!iR(r,n)&&(e[r]=t[r])}function m9({transformTemplate:e},t){return w.useMemo(()=>{const n=cw();return ow(n,t,e),Object.assign({},n.vars,n.style)},[t])}function g9(e,t){const n=e.style||{},r={};return oR(r,n,e),Object.assign(r,m9(e,t)),r}function y9(e,t){const n={},r=g9(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 b9(e,t,n,r){const s=w.useMemo(()=>{const i=tR();return lw(i,t,uw(r),e.transformTemplate),{...i.attrs,style:{...i.style}}},[t]);if(e.style){const i={};oR(i,e.style,e),s.style={...i,...s.style}}return s}function E9(e=!1){return(n,r,s,{latestValues:i},a)=>{const c=(rw(n)?b9:y9)(r,i,a,n),u=LF(r,typeof n=="string",e),d=n!==w.Fragment?{...u,...c,ref:s}:{},{children:f}=r,h=w.useMemo(()=>hr(f)?f.get():f,[f]);return w.createElement(n,{...d,children:h})}}function x9(e,t){return function(r,{forwardMotionProps:s}={forwardMotionProps:!1}){const a={...rw(r)?h9:p9,preloadedFeatures:e,useRender:E9(s),createVisualElement:t,Component:r};return zF(a)}}function lR(e,t){if(!Array.isArray(t))return!1;const n=t.length;if(n!==e.length)return!1;for(let r=0;r(Np===void 0&&Ei.set(rr.isProcessing||AF.useManualTiming?rr.timestamp:performance.now()),Np),set:e=>{Np=e,queueMicrotask(w9)}};function hw(e,t){e.indexOf(t)===-1&&e.push(t)}function pw(e,t){const n=e.indexOf(t);n>-1&&e.splice(n,1)}class mw{constructor(){this.subscriptions=[]}add(t){return hw(this.subscriptions,t),()=>pw(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 _9{constructor(t,n={}){this.version="11.18.2",this.canTrackVelocity=null,this.events={},this.updateAndNotify=(r,s=!0)=>{const i=Ei.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=Ei.now(),this.canTrackVelocity===null&&t!==void 0&&(this.canTrackVelocity=v9(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 mw);const r=this.events[t].add(n);return t==="change"?()=>{r(),qt.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=Ei.now();if(!this.canTrackVelocity||this.prevFrameValue===void 0||t-this.updatedAt>tN)return 0;const n=Math.min(this.updatedAt-this.prevUpdatedAt,tN);return uR(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 Kd(e,t){return new _9(e,t)}function k9(e,t,n){e.hasValue(t)?e.getValue(t).set(n):e.addValue(t,Kd(n))}function N9(e,t){const n=Cg(e,t);let{transitionEnd:r={},transition:s={},...i}=n||{};i={...i,...r};for(const a in i){const o=qF(i[a]);k9(e,a,o)}}function S9(e){return!!(hr(e)&&e.add)}function S1(e,t){const n=e.getValue("willChange");if(S9(n))return n.add(t)}function dR(e){return e.props[WO]}function gw(e){let t;return()=>(t===void 0&&(t=e()),t)}const T9=gw(()=>window.ScrollTimeline!==void 0);class A9{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(T9()&&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 C9 extends A9{then(t,n){return Promise.all(this.animations).then(t).catch(n)}}const Gi=e=>e*1e3,Wi=e=>e/1e3;function yw(e){return typeof e=="function"}function nN(e,t){e.timeline=t,e.onfinish=null}const bw=e=>Array.isArray(e)&&typeof e[0]=="number",I9={linearEasing:void 0};function O9(e,t){const n=gw(e);return()=>{var r;return(r=I9[t])!==null&&r!==void 0?r:n()}}const bm=O9(()=>{try{document.createElement("div").animate({opacity:0},{easing:"linear(0, 1)"})}catch{return!1}return!0},"linearEasing"),bc=(e,t,n)=>{const r=t-e;return r===0?1:(n-e)/r},fR=(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})`,T1={linear:"linear",ease:"ease",easeIn:"ease-in",easeOut:"ease-out",easeInOut:"ease-in-out",circIn:Bu([0,.65,.55,1]),circOut:Bu([.55,0,1,.45]),backIn:Bu([.31,.01,.66,-.59]),backOut:Bu([.33,1.53,.69,.99])};function pR(e,t){if(e)return typeof e=="function"&&bm()?fR(e,t):bw(e)?Bu(e):Array.isArray(e)?e.map(n=>pR(n,t)||T1.easeOut):T1[e]}const mR=(e,t,n)=>(((1-3*n+3*t)*e+(3*n-6*t))*e+3*t)*e,R9=1e-7,L9=12;function M9(e,t,n,r,s){let i,a,o=0;do a=t+(n-t)/2,i=mR(a,r,s)-e,i>0?n=a:t=a;while(Math.abs(i)>R9&&++oM9(i,0,1,e,n);return i=>i===0||i===1?i:mR(s(i),t,r)}const gR=e=>t=>t<=.5?e(2*t)/2:(2-e(2*(1-t)))/2,yR=e=>t=>1-e(1-t),bR=kf(.33,1.53,.69,.99),Ew=yR(bR),ER=gR(Ew),xR=e=>(e*=2)<1?.5*Ew(e):.5*(2-Math.pow(2,-10*(e-1))),xw=e=>1-Math.sin(Math.acos(e)),wR=yR(xw),vR=gR(xw),_R=e=>/^0[^.\s]+$/u.test(e);function j9(e){return typeof e=="number"?e===0:e!==null?e==="none"||e==="0"||_R(e):!0}const sd=e=>Math.round(e*1e5)/1e5,ww=/-?(?:\d+(?:\.\d+)?|\.\d+)/gu;function D9(e){return e==null}const P9=/^(?:#[\da-f]{3,8}|(?:rgb|hsl)a?\((?:-?[\d.]+%?[,\s]+){2}-?[\d.]+%?\s*(?:[,/]\s*)?(?:\b\d+(?:\.\d+)?|\.\d+)?%?\))$/iu,vw=(e,t)=>n=>!!(typeof n=="string"&&P9.test(n)&&n.startsWith(e)||t&&!D9(n)&&Object.prototype.hasOwnProperty.call(n,t)),kR=(e,t,n)=>r=>{if(typeof r!="string")return r;const[s,i,a,o]=r.match(ww);return{[e]:parseFloat(s),[t]:parseFloat(i),[n]:parseFloat(a),alpha:o!==void 0?parseFloat(o):1}},B9=e=>ea(0,255,e),ly={...Yc,transform:e=>Math.round(B9(e))},po={test:vw("rgb","red"),parse:kR("red","green","blue"),transform:({red:e,green:t,blue:n,alpha:r=1})=>"rgba("+ly.transform(e)+", "+ly.transform(t)+", "+ly.transform(n)+", "+sd(Vd.transform(r))+")"};function F9(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 A1={test:vw("#"),parse:F9,transform:po.transform},Dl={test:vw("hsl","hue"),parse:kR("hue","saturation","lightness"),transform:({hue:e,saturation:t,lightness:n,alpha:r=1})=>"hsla("+Math.round(e)+", "+bi.transform(sd(t))+", "+bi.transform(sd(n))+", "+sd(Vd.transform(r))+")"},dr={test:e=>po.test(e)||A1.test(e)||Dl.test(e),parse:e=>po.test(e)?po.parse(e):Dl.test(e)?Dl.parse(e):A1.parse(e),transform:e=>typeof e=="string"?e:e.hasOwnProperty("red")?po.transform(e):Dl.transform(e)},U9=/(?:#[\da-f]{3,8}|(?:rgb|hsl)a?\((?:-?[\d.]+%?[,\s]+){2}-?[\d.]+%?\s*(?:[,/]\s*)?(?:\b\d+(?:\.\d+)?|\.\d+)?%?\))/giu;function $9(e){var t,n;return isNaN(e)&&typeof e=="string"&&(((t=e.match(ww))===null||t===void 0?void 0:t.length)||0)+(((n=e.match(U9))===null||n===void 0?void 0:n.length)||0)>0}const NR="number",SR="color",H9="var",z9="var(",rN="${}",V9=/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 Yd(e){const t=e.toString(),n=[],r={color:[],number:[],var:[]},s=[];let i=0;const o=t.replace(V9,c=>(dr.test(c)?(r.color.push(i),s.push(SR),n.push(dr.parse(c))):c.startsWith(z9)?(r.var.push(i),s.push(H9),n.push(c)):(r.number.push(i),s.push(NR),n.push(parseFloat(c))),++i,rN)).split(rN);return{values:n,split:o,indexes:r,types:s}}function TR(e){return Yd(e).values}function AR(e){const{split:t,types:n}=Yd(e),r=t.length;return s=>{let i="";for(let a=0;atypeof e=="number"?0:e;function Y9(e){const t=TR(e);return AR(e)(t.map(K9))}const $a={test:$9,parse:TR,createTransformer:AR,getAnimatableNone:Y9},G9=new Set(["brightness","contrast","saturate","opacity"]);function W9(e){const[t,n]=e.slice(0,-1).split("(");if(t==="drop-shadow")return e;const[r]=n.match(ww)||[];if(!r)return e;const s=n.replace(r,"");let i=G9.has(t)?1:0;return r!==n&&(i*=100),t+"("+i+s+")"}const q9=/\b([a-z-]*)\(.*?\)/gu,C1={...$a,getAnimatableNone:e=>{const t=e.match(q9);return t?t.map(W9).join(" "):e}},X9={...aw,color:dr,backgroundColor:dr,outlineColor:dr,fill:dr,stroke:dr,borderColor:dr,borderTopColor:dr,borderRightColor:dr,borderBottomColor:dr,borderLeftColor:dr,filter:C1,WebkitFilter:C1},_w=e=>X9[e];function CR(e,t){let n=_w(e);return n!==C1&&(n=$a),n.getAnimatableNone?n.getAnimatableNone(t):void 0}const Q9=new Set(["auto","none","0"]);function Z9(e,t,n){let r=0,s;for(;re===Yc||e===tt,iN=(e,t)=>parseFloat(e.split(", ")[t]),aN=(e,t)=>(n,{transform:r})=>{if(r==="none"||!r)return 0;const s=r.match(/^matrix3d\((.+)\)$/u);if(s)return iN(s[1],t);{const i=r.match(/^matrix\((.+)\)$/u);return i?iN(i[1],e):0}},J9=new Set(["x","y","z"]),eU=Kc.filter(e=>!J9.has(e));function tU(e){const t=[];return eU.forEach(n=>{const r=e.getValue(n);r!==void 0&&(t.push([n,r.get()]),r.set(n.startsWith("scale")?1:0))}),t}const Ec={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:aN(4,13),y:aN(5,14)};Ec.translateX=Ec.x;Ec.translateY=Ec.y;const wo=new Set;let I1=!1,O1=!1;function IR(){if(O1){const e=Array.from(wo).filter(r=>r.needsMeasurement),t=new Set(e.map(r=>r.element)),n=new Map;t.forEach(r=>{const s=tU(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)})}O1=!1,I1=!1,wo.forEach(e=>e.complete()),wo.clear()}function OR(){wo.forEach(e=>{e.readKeyframes(),e.needsMeasurement&&(O1=!0)})}function nU(){OR(),IR()}class kw{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?(wo.add(this),I1||(I1=!0,qt.read(OR),qt.resolveKeyframes(IR))):(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),rU=/^var\(--(?:([\w-]+)|([\w-]+), ?([a-zA-Z\d ()%#.,-]+))\)/u;function sU(e){const t=rU.exec(e);if(!t)return[,];const[,n,r,s]=t;return[`--${n??r}`,s]}function LR(e,t,n=1){const[r,s]=sU(e);if(!r)return;const i=window.getComputedStyle(t).getPropertyValue(r);if(i){const a=i.trim();return RR(a)?parseFloat(a):a}return iw(s)?LR(s,t,n+1):s}const MR=e=>t=>t.test(e),iU={test:e=>e==="auto",parse:e=>e},jR=[Yc,tt,bi,pa,t9,e9,iU],oN=e=>jR.find(MR(e));class DR extends kw{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 c=0;c{n.getValue(c).set(u)}),this.resolveNoneKeyframes()}}const lN=(e,t)=>t==="zIndex"?!1:!!(typeof e=="number"||Array.isArray(e)||typeof e=="string"&&($a.test(e)||e==="0")&&!e.startsWith("url("));function aU(e){const t=e[0];if(e.length===1)return!0;for(let n=0;ne!==null;function Ig(e,{repeat:t,repeatType:n="loop"},r){const s=e.filter(lU),i=t&&n!=="loop"&&t%2===1?0:s.length-1;return!i||r===void 0?s[i]:r}const cU=40;class PR{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=Ei.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>cU?this.resolvedAt:this.createdAt:this.createdAt}get resolved(){return!this._resolved&&!this.hasAttemptedResolve&&nU(),this._resolved}onKeyframesResolved(t,n){this.resolvedAt=Ei.now(),this.hasAttemptedResolve=!0;const{name:r,type:s,velocity:i,delay:a,onComplete:o,onUpdate:c,isGenerator:u}=this.options;if(!u&&!oU(t,r,s,i))if(a)this.options.duration=0;else{c&&c(Ig(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 R1=2e4;function BR(e){let t=0;const n=50;let r=e.next(t);for(;!r.done&&t=R1?1/0:t}const dn=(e,t,n)=>e+(t-e)*n;function cy(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 uU({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,c=2*n-o;s=cy(c,o,e+1/3),i=cy(c,o,e),a=cy(c,o,e-1/3)}return{red:Math.round(s*255),green:Math.round(i*255),blue:Math.round(a*255),alpha:r}}function Em(e,t){return n=>n>0?t:e}const uy=(e,t,n)=>{const r=e*e,s=n*(t*t-r)+r;return s<0?0:Math.sqrt(s)},dU=[A1,po,Dl],fU=e=>dU.find(t=>t.test(e));function cN(e){const t=fU(e);if(!t)return!1;let n=t.parse(e);return t===Dl&&(n=uU(n)),n}const uN=(e,t)=>{const n=cN(e),r=cN(t);if(!n||!r)return Em(e,t);const s={...n};return i=>(s.red=uy(n.red,r.red,i),s.green=uy(n.green,r.green,i),s.blue=uy(n.blue,r.blue,i),s.alpha=dn(n.alpha,r.alpha,i),po.transform(s))},hU=(e,t)=>n=>t(e(n)),Nf=(...e)=>e.reduce(hU),L1=new Set(["none","hidden"]);function pU(e,t){return L1.has(e)?n=>n<=0?e:t:n=>n>=1?t:e}function mU(e,t){return n=>dn(e,t,n)}function Nw(e){return typeof e=="number"?mU:typeof e=="string"?iw(e)?Em:dr.test(e)?uN:bU:Array.isArray(e)?FR:typeof e=="object"?dr.test(e)?uN:gU:Em}function FR(e,t){const n=[...e],r=n.length,s=e.map((i,a)=>Nw(i)(i,t[a]));return i=>{for(let a=0;a{for(const i in r)n[i]=r[i](s);return n}}function yU(e,t){var n;const r=[],s={color:0,var:0,number:0};for(let i=0;i{const n=$a.createTransformer(t),r=Yd(e),s=Yd(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?L1.has(e)&&!s.values.length||L1.has(t)&&!r.values.length?pU(e,t):Nf(FR(yU(r,s),s.values),n):Em(e,t)};function UR(e,t,n){return typeof e=="number"&&typeof t=="number"&&typeof n=="number"?dn(e,t,n):Nw(e)(e,t)}const EU=5;function $R(e,t,n){const r=Math.max(t-EU,0);return uR(n-e(r),t-r)}const En={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},dy=.001;function xU({duration:e=En.duration,bounce:t=En.bounce,velocity:n=En.velocity,mass:r=En.mass}){let s,i,a=1-t;a=ea(En.minDamping,En.maxDamping,a),e=ea(En.minDuration,En.maxDuration,Wi(e)),a<1?(s=u=>{const d=u*a,f=d*e,h=d-n,p=M1(u,a),m=Math.exp(-f);return dy-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=M1(Math.pow(u,2),a);return(-s(u)+dy>0?-1:1)*((h-p)*m)/y}):(s=u=>{const d=Math.exp(-u*e),f=(u-n)*e+1;return-dy+d*f},i=u=>{const d=Math.exp(-u*e),f=(n-u)*(e*e);return d*f});const o=5/e,c=vU(s,i,o);if(e=Gi(e),isNaN(c))return{stiffness:En.stiffness,damping:En.damping,duration:e};{const u=Math.pow(c,2)*r;return{stiffness:u,damping:a*2*Math.sqrt(r*u),duration:e}}}const wU=12;function vU(e,t,n){let r=n;for(let s=1;se[n]!==void 0)}function NU(e){let t={velocity:En.velocity,stiffness:En.stiffness,damping:En.damping,mass:En.mass,isResolvedFromDuration:!1,...e};if(!dN(e,kU)&&dN(e,_U))if(e.visualDuration){const n=e.visualDuration,r=2*Math.PI/(n*1.2),s=r*r,i=2*ea(.05,1,1-(e.bounce||0))*Math.sqrt(s);t={...t,mass:En.mass,stiffness:s,damping:i}}else{const n=xU(e);t={...t,...n,mass:En.mass},t.isResolvedFromDuration=!0}return t}function HR(e=En.visualDuration,t=En.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:c,damping:u,mass:d,duration:f,velocity:h,isResolvedFromDuration:p}=NU({...n,velocity:-Wi(n.velocity||0)}),m=h||0,y=u/(2*Math.sqrt(c*d)),E=a-i,g=Wi(Math.sqrt(c/d)),x=Math.abs(E)<5;r||(r=x?En.restSpeed.granular:En.restSpeed.default),s||(s=x?En.restDelta.granular:En.restDelta.default);let b;if(y<1){const k=M1(g,y);b=N=>{const C=Math.exp(-y*g*N);return a-C*((m+y*g*E)/k*Math.sin(k*N)+E*Math.cos(k*N))}}else if(y===1)b=k=>a-Math.exp(-g*k)*(E+(m+g*E)*k);else{const k=g*Math.sqrt(y*y-1);b=N=>{const C=Math.exp(-y*g*N),S=Math.min(k*N,300);return a-C*((m+y*g*E)*Math.sinh(S)+k*E*Math.cosh(S))/k}}const _={calculatedDuration:p&&f||null,next:k=>{const N=b(k);if(p)o.done=k>=f;else{let C=0;y<1&&(C=k===0?Gi(m):$R(b,k,N));const S=Math.abs(C)<=r,A=Math.abs(a-N)<=s;o.done=S&&A}return o.value=o.done?a:N,o},toString:()=>{const k=Math.min(BR(_),R1),N=fR(C=>_.next(k*C).value,k,30);return k+"ms "+N}};return _}function fN({keyframes:e,velocity:t=0,power:n=.8,timeConstant:r=325,bounceDamping:s=10,bounceStiffness:i=500,modifyTarget:a,min:o,max:c,restDelta:u=.5,restSpeed:d}){const f=e[0],h={done:!1,value:f},p=S=>o!==void 0&&Sc,m=S=>o===void 0?c:c===void 0||Math.abs(o-S)-y*Math.exp(-S/r),b=S=>g+x(S),_=S=>{const A=x(S),O=b(S);h.done=Math.abs(A)<=u,h.value=h.done?g:O};let k,N;const C=S=>{p(h.value)&&(k=S,N=HR({keyframes:[h.value,m(h.value)],velocity:$R(b,S,h.value),damping:s,stiffness:i,restDelta:u,restSpeed:d}))};return C(0),{calculatedDuration:null,next:S=>{let A=!1;return!N&&k===void 0&&(A=!0,_(S),C(S)),k!==void 0&&S>=k?N.next(S-k):(!A&&_(S),h)}}}const SU=kf(.42,0,1,1),TU=kf(0,0,.58,1),zR=kf(.42,0,.58,1),AU=e=>Array.isArray(e)&&typeof e[0]!="number",CU={linear:Jr,easeIn:SU,easeInOut:zR,easeOut:TU,circIn:xw,circInOut:vR,circOut:wR,backIn:Ew,backInOut:ER,backOut:bR,anticipate:xR},hN=e=>{if(bw(e)){HO(e.length===4);const[t,n,r,s]=e;return kf(t,n,r,s)}else if(typeof e=="string")return CU[e];return e};function IU(e,t,n){const r=[],s=n||UR,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=IU(t,r,s),c=o.length,u=d=>{if(a&&d1)for(;fu(ea(e[0],e[i-1],d)):u}function RU(e,t){const n=e[e.length-1];for(let r=1;r<=t;r++){const s=bc(0,t,r);e.push(dn(n,1,s))}}function LU(e){const t=[0];return RU(t,e.length-1),t}function MU(e,t){return e.map(n=>n*t)}function jU(e,t){return e.map(()=>t||zR).splice(0,e.length-1)}function xm({duration:e=300,keyframes:t,times:n,ease:r="easeInOut"}){const s=AU(r)?r.map(hN):hN(r),i={done:!1,value:t[0]},a=MU(n&&n.length===t.length?n:LU(t),e),o=OU(a,t,{ease:Array.isArray(s)?s:jU(t,s)});return{calculatedDuration:e,next:c=>(i.value=o(c),i.done=c>=e,i)}}const DU=e=>{const t=({timestamp:n})=>e(n);return{start:()=>qt.update(t,!0),stop:()=>Ua(t),now:()=>rr.isProcessing?rr.timestamp:Ei.now()}},PU={decay:fN,inertia:fN,tween:xm,keyframes:xm,spring:HR},BU=e=>e/100;class Sw extends PR{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:c}=this.options;c&&c()};const{name:n,motionValue:r,element:s,keyframes:i}=this.options,a=(s==null?void 0:s.KeyframeResolver)||kw,o=(c,u)=>this.onKeyframesResolved(c,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=yw(n)?n:PU[n]||xm;let c,u;o!==xm&&typeof t[0]!="number"&&(c=Nf(BU,UR(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=BR(d));const{calculatedDuration:f}=d,h=f+s,p=h*(r+1)-s;return{generator:d,mirroredGenerator:u,mapPercentToKeyframes:c,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:S}=this.options;return{done:!0,value:S[S.length-1]}}const{finalKeyframe:s,generator:i,mirroredGenerator:a,mapPercentToKeyframes:o,keyframes:c,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:E}=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),x=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 S=Math.min(this.currentTime,d)/f;let A=Math.floor(S),O=S%1;!O&&S>=1&&(O=1),O===1&&A--,A=Math.min(A,p+1),!!(A%2)&&(m==="reverse"?(O=1-O,y&&(O-=y/f)):m==="mirror"&&(_=a)),b=ea(0,1,O)*f}const k=x?{done:!1,value:c[0]}:_.next(b);o&&(k.value=o(k.value));let{done:N}=k;!x&&u!==null&&(N=this.speed>=0?this.currentTime>=d:this.currentTime<=0);const C=this.holdTime===null&&(this.state==="finished"||this.state==="running"&&N);return C&&s!==void 0&&(k.value=Ig(c,this.options,s)),E&&E(k.value),C&&this.finish(),k}get duration(){const{resolved:t}=this;return t?Wi(t.calculatedDuration):0}get time(){return Wi(this.currentTime)}set time(t){t=Gi(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=Wi(this.currentTime))}play(){if(this.resolver.isScheduled||this.resolver.resume(),!this._resolved){this.pendingPlayState="running";return}if(this.isStopped)return;const{driver:t=DU,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 FU=new Set(["opacity","clipPath","filter","transform"]);function UU(e,t,n,{delay:r=0,duration:s=300,repeat:i=0,repeatType:a="loop",ease:o="easeInOut",times:c}={}){const u={[t]:n};c&&(u.offset=c);const d=pR(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 $U=gw(()=>Object.hasOwnProperty.call(Element.prototype,"animate")),wm=10,HU=2e4;function zU(e){return yw(e.type)||e.type==="spring"||!hR(e.ease)}function VU(e,t){const n=new Sw({...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:c,startTime:u}=this.options;if(!o.owner||!o.owner.current)return!1;if(typeof i=="string"&&bm()&&KU(i)&&(i=VR[i]),zU(this.options)){const{onComplete:f,onUpdate:h,motionValue:p,element:m,...y}=this.options,E=VU(t,y);t=E.keyframes,t.length===1&&(t[1]=t[0]),r=E.duration,s=E.times,i=E.ease,a="keyframes"}const d=UU(o.owner.current,c,t,{...this.options,duration:r,times:s,ease:i});return d.startTime=u??this.calcStartTime(),this.pendingTimeline?(nN(d,this.pendingTimeline),this.pendingTimeline=void 0):d.onfinish=()=>{const{onComplete:f}=this.options;o.set(Ig(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 Wi(n)}get time(){const{resolved:t}=this;if(!t)return 0;const{animation:n}=t;return Wi(n.currentTime||0)}set time(t){const{resolved:n}=this;if(!n)return;const{animation:r}=n;r.currentTime=Gi(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 Jr;const{animation:r}=n;nN(r,t)}return Jr}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 Sw({...p,keyframes:r,duration:s,type:i,ease:a,times:o,isGenerator:!0}),y=Gi(this.time);u.setWithVelocity(m.sample(y-wm).value,m.sample(y).value,wm)}const{onStop:c}=this.options;c&&c(),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:c,transformTemplate:u}=n.owner.getProps();return $U()&&r&&FU.has(r)&&!c&&!u&&!s&&i!=="mirror"&&a!==0&&o!=="inertia"}}const YU={type:"spring",stiffness:500,damping:25,restSpeed:10},GU=e=>({type:"spring",stiffness:550,damping:e===0?2*Math.sqrt(550):30,restSpeed:10}),WU={type:"keyframes",duration:.8},qU={type:"keyframes",ease:[.25,.1,.35,1],duration:.3},XU=(e,{keyframes:t})=>t.length>2?WU:Vo.has(e)?e.startsWith("scale")?GU(t[1]):YU:qU;function QU({when:e,delay:t,delayChildren:n,staggerChildren:r,staggerDirection:s,repeat:i,repeatType:a,repeatDelay:o,from:c,elapsed:u,...d}){return!!Object.keys(d).length}const Tw=(e,t,n,r={},s,i)=>a=>{const o=fw(r,e)||{},c=o.delay||r.delay||0;let{elapsed:u=0}=r;u=u-Gi(c);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};QU(o)||(d={...d,...XU(e,d)}),d.duration&&(d.duration=Gi(d.duration)),d.repeatDelay&&(d.repeatDelay=Gi(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=Ig(d.keyframes,o);if(h!==void 0)return qt.update(()=>{d.onUpdate(h),d.onComplete()}),new C9([])}return!i&&pN.supports(d)?new pN(d):new Sw(d)};function ZU({protectedKeys:e,needsAnimating:t},n){const r=e.hasOwnProperty(n)&&t[n]!==!0;return t[n]=!1,r}function KR(e,t,{delay:n=0,transitionOverride:r,type:s}={}){var i;let{transition:a=e.getDefaultTransition(),transitionEnd:o,...c}=t;r&&(a=r);const u=[],d=s&&e.animationState&&e.animationState.getState()[s];for(const f in c){const h=e.getValue(f,(i=e.latestValues[f])!==null&&i!==void 0?i:null),p=c[f];if(p===void 0||d&&ZU(d,f))continue;const m={delay:n,...fw(a||{},f)};let y=!1;if(window.MotionHandoffAnimation){const g=dR(e);if(g){const x=window.MotionHandoffAnimation(g,f,qt);x!==null&&(m.startTime=x,y=!0)}}S1(e,f),h.start(Tw(f,h,p,e.shouldReduceMotion&&cR.has(f)?{type:!1}:m,e,y));const E=h.animation;E&&u.push(E)}return o&&Promise.all(u).then(()=>{qt.update(()=>{o&&N9(e,o)})}),u}function j1(e,t,n={}){var r;const s=Cg(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(KR(e,s,n)):()=>Promise.resolve(),o=e.variantChildren&&e.variantChildren.size?(u=0)=>{const{delayChildren:d=0,staggerChildren:f,staggerDirection:h}=i;return JU(e,t,d+u,f,h,n)}:()=>Promise.resolve(),{when:c}=i;if(c){const[u,d]=c==="beforeChildren"?[a,o]:[o,a];return u().then(()=>d())}else return Promise.all([a(),o(n.delay)])}function JU(e,t,n=0,r=0,s=1,i){const a=[],o=(e.variantChildren.size-1)*r,c=s===1?(u=0)=>u*r:(u=0)=>o-u*r;return Array.from(e.variantChildren).sort(e$).forEach((u,d)=>{u.notify("AnimationStart",t),a.push(j1(u,t,{...i,delay:n+c(d)}).then(()=>u.notify("AnimationComplete",t)))}),Promise.all(a)}function e$(e,t){return e.sortNodePosition(t)}function t$(e,t,n={}){e.notify("AnimationStart",t);let r;if(Array.isArray(t)){const s=t.map(i=>j1(e,i,n));r=Promise.all(s)}else if(typeof t=="string")r=j1(e,t,n);else{const s=typeof t=="function"?Cg(e,t,n.custom):t;r=Promise.all(KR(e,s,n))}return r.then(()=>{e.notify("AnimationComplete",t)})}const n$=ew.length;function YR(e){if(!e)return;if(!e.isControllingVariants){const n=e.parent?YR(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})=>t$(e,n,r)))}function a$(e){let t=i$(e),n=mN(),r=!0;const s=c=>(u,d)=>{var f;const h=Cg(e,d,c==="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(c){t=c(e)}function a(c){const{props:u}=e,d=YR(e.parent)||{},f=[],h=new Set;let p={},m=1/0;for(let E=0;Em&&_,A=!1;const O=Array.isArray(b)?b:[b];let D=O.reduce(s(g),{});k===!1&&(D={});const{prevResolvedValues:F={}}=x,X={...F,...D},L=R=>{S=!0,h.has(R)&&(A=!0,h.delete(R)),x.needsAnimating[R]=!0;const M=e.getValue(R);M&&(M.liveStyle=!1)};for(const R in X){const M=D[R],B=F[R];if(p.hasOwnProperty(R))continue;let I=!1;N1(M)&&N1(B)?I=!lR(M,B):I=M!==B,I?M!=null?L(R):h.add(R):M!==void 0&&h.has(R)?L(R):x.protectedKeys[R]=!0}x.prevProp=b,x.prevResolvedValues=D,x.isActive&&(p={...p,...D}),r&&e.blockInitialAnimation&&(S=!1),S&&(!(N&&C)||A)&&f.push(...O.map(R=>({animation:R,options:{type:g}})))}if(h.size){const E={};h.forEach(g=>{const x=e.getBaseTarget(g),b=e.getValue(g);b&&(b.liveStyle=!0),E[g]=x??null}),f.push({animation:E})}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(c,u){var d;if(n[c].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(c,u)}),n[c].isActive=u;const f=a(c);for(const h in n)n[h].protectedKeys={};return f}return{animateChanges:a,setActive:o,setAnimateFunction:i,getState:()=>n,reset:()=>{n=mN(),r=!0}}}function o$(e,t){return typeof t=="string"?t!==e:Array.isArray(t)?!lR(t,e):!1}function Za(e=!1){return{isActive:e,protectedKeys:{},needsAnimating:{},prevResolvedValues:{}}}function mN(){return{animate:Za(!0),whileInView:Za(),whileHover:Za(),whileTap:Za(),whileDrag:Za(),whileFocus:Za(),exit:Za()}}class Ka{constructor(t){this.isMounted=!1,this.node=t}update(){}}class l$ extends Ka{constructor(t){super(t),t.animationState||(t.animationState=a$(t))}updateAnimationControlsSubscription(){const{animate:t}=this.node.getProps();Tg(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 c$=0;class u$ extends Ka{constructor(){super(...arguments),this.id=c$++}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 d$={animation:{Feature:l$},exit:{Feature:u$}},Ds={x:!1,y:!1};function GR(){return Ds.x||Ds.y}function f$(e){return e==="x"||e==="y"?Ds[e]?null:(Ds[e]=!0,()=>{Ds[e]=!1}):Ds.x||Ds.y?null:(Ds.x=Ds.y=!0,()=>{Ds.x=Ds.y=!1})}const Aw=e=>e.pointerType==="mouse"?typeof e.button!="number"||e.button<=0:e.isPrimary!==!1;function Gd(e,t,n,r={passive:!0}){return e.addEventListener(t,n,r),()=>e.removeEventListener(t,n)}function Sf(e){return{point:{x:e.pageX,y:e.pageY}}}const h$=e=>t=>Aw(t)&&e(t,Sf(t));function id(e,t,n,r){return Gd(e,t,h$(n),r)}const gN=(e,t)=>Math.abs(e-t);function p$(e,t){const n=gN(e.x,t.x),r=gN(e.y,t.y);return Math.sqrt(n**2+r**2)}class WR{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=hy(this.lastMoveEventInfo,this.history),h=this.startEvent!==null,p=p$(f.offset,{x:0,y:0})>=3;if(!h&&!p)return;const{point:m}=f,{timestamp:y}=rr;this.history.push({...m,timestamp:y});const{onStart:E,onMove:g}=this.handlers;h||(E&&E(this.lastMoveEvent,f),this.startEvent=this.lastMoveEvent),g&&g(this.lastMoveEvent,f)},this.handlePointerMove=(f,h)=>{this.lastMoveEvent=f,this.lastMoveEventInfo=fy(h,this.transformPagePoint),qt.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 E=hy(f.type==="pointercancel"?this.lastMoveEventInfo:fy(h,this.transformPagePoint),this.history);this.startEvent&&p&&p(f,E),m&&m(f,E)},!Aw(t))return;this.dragSnapToOrigin=i,this.handlers=n,this.transformPagePoint=r,this.contextWindow=s||window;const a=Sf(t),o=fy(a,this.transformPagePoint),{point:c}=o,{timestamp:u}=rr;this.history=[{...c,timestamp:u}];const{onSessionStart:d}=n;d&&d(t,hy(o,this.history)),this.removeListeners=Nf(id(this.contextWindow,"pointermove",this.handlePointerMove),id(this.contextWindow,"pointerup",this.handlePointerUp),id(this.contextWindow,"pointercancel",this.handlePointerUp))}updateHandlers(t){this.handlers=t}end(){this.removeListeners&&this.removeListeners(),Ua(this.updatePoint)}}function fy(e,t){return t?{point:t(e.point)}:e}function yN(e,t){return{x:e.x-t.x,y:e.y-t.y}}function hy({point:e},t){return{point:e,delta:yN(e,qR(t)),offset:yN(e,m$(t)),velocity:g$(t,.1)}}function m$(e){return e[0]}function qR(e){return e[e.length-1]}function g$(e,t){if(e.length<2)return{x:0,y:0};let n=e.length-1,r=null;const s=qR(e);for(;n>=0&&(r=e[n],!(s.timestamp-r.timestamp>Gi(t)));)n--;if(!r)return{x:0,y:0};const i=Wi(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 XR=1e-4,y$=1-XR,b$=1+XR,QR=.01,E$=0-QR,x$=0+QR;function ns(e){return e.max-e.min}function w$(e,t,n){return Math.abs(e-t)<=n}function bN(e,t,n,r=.5){e.origin=r,e.originPoint=dn(t.min,t.max,e.origin),e.scale=ns(n)/ns(t),e.translate=dn(n.min,n.max,e.origin)-e.originPoint,(e.scale>=y$&&e.scale<=b$||isNaN(e.scale))&&(e.scale=1),(e.translate>=E$&&e.translate<=x$||isNaN(e.translate))&&(e.translate=0)}function ad(e,t,n,r){bN(e.x,t.x,n.x,r?r.originX:void 0),bN(e.y,t.y,n.y,r?r.originY:void 0)}function EN(e,t,n){e.min=n.min+t.min,e.max=e.min+ns(t)}function v$(e,t,n){EN(e.x,t.x,n.x),EN(e.y,t.y,n.y)}function xN(e,t,n){e.min=t.min-n.min,e.max=e.min+ns(t)}function od(e,t,n){xN(e.x,t.x,n.x),xN(e.y,t.y,n.y)}function _$(e,{min:t,max:n},r){return t!==void 0&&en&&(e=r?dn(n,e,r.max):Math.min(e,n)),e}function wN(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 k$(e,{top:t,left:n,bottom:r,right:s}){return{x:wN(e.x,n,s),y:wN(e.y,t,r)}}function vN(e,t){let n=t.min-e.min,r=t.max-e.max;return t.max-t.minr?n=bc(t.min,t.max-r,e.min):r>s&&(n=bc(e.min,e.max-s,t.min)),ea(0,1,n)}function T$(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 D1=.35;function A$(e=D1){return e===!1?e=0:e===!0&&(e=D1),{x:_N(e,"left","right"),y:_N(e,"top","bottom")}}function _N(e,t,n){return{min:kN(e,t),max:kN(e,n)}}function kN(e,t){return typeof e=="number"?e:e[t]||0}const NN=()=>({translate:0,scale:1,origin:0,originPoint:0}),Pl=()=>({x:NN(),y:NN()}),SN=()=>({min:0,max:0}),Tn=()=>({x:SN(),y:SN()});function ds(e){return[e("x"),e("y")]}function ZR({top:e,left:t,right:n,bottom:r}){return{x:{min:t,max:n},y:{min:e,max:r}}}function C$({x:e,y:t}){return{top:t.min,right:e.max,bottom:t.max,left:e.min}}function I$(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 py(e){return e===void 0||e===1}function P1({scale:e,scaleX:t,scaleY:n}){return!py(e)||!py(t)||!py(n)}function ro(e){return P1(e)||JR(e)||e.z||e.rotate||e.rotateX||e.rotateY||e.skewX||e.skewY}function JR(e){return TN(e.x)||TN(e.y)}function TN(e){return e&&e!=="0%"}function vm(e,t,n){const r=e-n,s=t*r;return n+s}function AN(e,t,n,r,s){return s!==void 0&&(e=vm(e,s,r)),vm(e,n,r)+t}function B1(e,t=0,n=1,r,s){e.min=AN(e.min,t,n,r,s),e.max=AN(e.max,t,n,r,s)}function eL(e,{x:t,y:n}){B1(e.x,t.translate,t.scale,t.originPoint),B1(e.y,n.translate,n.scale,n.originPoint)}const CN=.999999999999,IN=1.0000000000001;function O$(e,t,n,r=!1){const s=n.length;if(!s)return;t.x=t.y=1;let i,a;for(let o=0;oCN&&(t.x=1),t.yCN&&(t.y=1)}function Bl(e,t){e.min=e.min+t,e.max=e.max+t}function ON(e,t,n,r,s=.5){const i=dn(e.min,e.max,s);B1(e,t,n,i,r)}function Fl(e,t){ON(e.x,t.x,t.scaleX,t.scale,t.originX),ON(e.y,t.y,t.scaleY,t.scale,t.originY)}function tL(e,t){return ZR(I$(e.getBoundingClientRect(),t))}function R$(e,t,n){const r=tL(e,n),{scroll:s}=t;return s&&(Bl(r.x,s.offset.x),Bl(r.y,s.offset.y)),r}const nL=({current:e})=>e?e.ownerDocument.defaultView:null,L$=new WeakMap;class M${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=Tn(),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(Sf(d).point)},i=(d,f)=>{const{drag:h,dragPropagation:p,onDragStart:m}=this.getProps();if(h&&!p&&(this.openDragLock&&this.openDragLock(),this.openDragLock=f$(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),ds(E=>{let g=this.getAxisMotionValue(E).get()||0;if(bi.test(g)){const{projection:x}=this.visualElement;if(x&&x.layout){const b=x.layout.layoutBox[E];b&&(g=ns(b)*(parseFloat(g)/100))}}this.originPoint[E]=g}),m&&qt.postRender(()=>m(d,f)),S1(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:E}=f;if(p&&this.currentDirection===null){this.currentDirection=j$(E),this.currentDirection!==null&&m&&m(this.currentDirection);return}this.updateAxis("x",f.point,E),this.updateAxis("y",f.point,E),this.visualElement.render(),y&&y(d,f)},o=(d,f)=>this.stop(d,f),c=()=>ds(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 WR(t,{onSessionStart:s,onStart:i,onMove:a,onSessionEnd:o,resumeAnimation:c},{transformPagePoint:this.visualElement.getTransformPagePoint(),dragSnapToOrigin:u,contextWindow:nL(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&&qt.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||!Lh(t,s,this.currentDirection))return;const i=this.getAxisMotionValue(t);let a=this.originPoint[t]+r[t];this.constraints&&this.constraints[t]&&(a=_$(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&&jl(n)?this.constraints||(this.constraints=this.resolveRefConstraints()):n&&s?this.constraints=k$(s.layoutBox,n):this.constraints=!1,this.elastic=A$(r),i!==this.constraints&&s&&this.constraints&&!this.hasMutatedConstraints&&ds(a=>{this.constraints!==!1&&this.getAxisMotionValue(a)&&(this.constraints[a]=T$(s.layoutBox[a],this.constraints[a]))})}resolveRefConstraints(){const{dragConstraints:t,onMeasureDragConstraints:n}=this.getProps();if(!t||!jl(t))return!1;const r=t.current,{projection:s}=this.visualElement;if(!s||!s.layout)return!1;const i=R$(r,s.root,this.visualElement.getTransformPagePoint());let a=N$(s.layout.layoutBox,i);if(n){const o=n(C$(a));this.hasMutatedConstraints=!!o,o&&(a=ZR(o))}return a}startAnimation(t){const{drag:n,dragMomentum:r,dragElastic:s,dragTransition:i,dragSnapToOrigin:a,onDragTransitionEnd:o}=this.getProps(),c=this.constraints||{},u=ds(d=>{if(!Lh(d,n,this.currentDirection))return;let f=c&&c[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 S1(this.visualElement,t),r.start(Tw(t,r,0,n,this.visualElement,!1))}stopAnimation(){ds(t=>this.getAxisMotionValue(t).stop())}pauseAnimation(){ds(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){ds(n=>{const{drag:r}=this.getProps();if(!Lh(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]-dn(a,o,.5))}})}scalePositionWithinConstraints(){if(!this.visualElement.current)return;const{drag:t,dragConstraints:n}=this.getProps(),{projection:r}=this.visualElement;if(!jl(n)||!r||!this.constraints)return;this.stopAnimation();const s={x:0,y:0};ds(a=>{const o=this.getAxisMotionValue(a);if(o&&this.constraints!==!1){const c=o.get();s[a]=S$({min:c,max:c},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(),ds(a=>{if(!Lh(a,t,null))return;const o=this.getAxisMotionValue(a),{min:c,max:u}=this.constraints[a];o.set(dn(c,u,s[a]))})}addListeners(){if(!this.visualElement.current)return;L$.set(this.visualElement,this);const t=this.visualElement.current,n=id(t,"pointerdown",c=>{const{drag:u,dragListener:d=!0}=this.getProps();u&&d&&this.start(c)}),r=()=>{const{dragConstraints:c}=this.getProps();jl(c)&&c.current&&(this.constraints=this.resolveRefConstraints())},{projection:s}=this.visualElement,i=s.addEventListener("measure",r);s&&!s.layout&&(s.root&&s.root.updateScroll(),s.updateLayout()),qt.read(r);const a=Gd(window,"resize",()=>this.scalePositionWithinConstraints()),o=s.addEventListener("didUpdate",({delta:c,hasLayoutChanged:u})=>{this.isDragging&&u&&(ds(d=>{const f=this.getAxisMotionValue(d);f&&(this.originPoint[d]+=c[d].translate,f.set(f.get()+c[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=D1,dragMomentum:o=!0}=t;return{...t,drag:n,dragDirectionLock:r,dragPropagation:s,dragConstraints:i,dragElastic:a,dragMomentum:o}}}function Lh(e,t,n){return(t===!0||t===e)&&(n===null||n===e)}function j$(e,t=10){let n=null;return Math.abs(e.y)>t?n="y":Math.abs(e.x)>t&&(n="x"),n}class D$ extends Ka{constructor(t){super(t),this.removeGroupControls=Jr,this.removeListeners=Jr,this.controls=new M$(t)}mount(){const{dragControls:t}=this.node.getProps();t&&(this.removeGroupControls=t.subscribe(this.controls)),this.removeListeners=this.controls.addListeners()||Jr}unmount(){this.removeGroupControls(),this.removeListeners()}}const RN=e=>(t,n)=>{e&&qt.postRender(()=>e(t,n))};class P$ extends Ka{constructor(){super(...arguments),this.removePointerDownListener=Jr}onPointerDown(t){this.session=new WR(t,this.createPanHandlers(),{transformPagePoint:this.node.getTransformPagePoint(),contextWindow:nL(this.node)})}createPanHandlers(){const{onPanSessionStart:t,onPanStart:n,onPan:r,onPanEnd:s}=this.node.getProps();return{onSessionStart:RN(t),onStart:RN(n),onMove:r,onEnd:(i,a)=>{delete this.session,s&&qt.postRender(()=>s(i,a))}}}mount(){this.removePointerDownListener=id(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 Sp={hasAnimatedSinceResize:!0,hasEverUpdated:!1};function LN(e,t){return t.max===t.min?0:e/(t.max-t.min)*100}const Eu={correct:(e,t)=>{if(!t.target)return e;if(typeof e=="string")if(tt.test(e))e=parseFloat(e);else return e;const n=LN(e,t.target.x),r=LN(e,t.target.y);return`${n}% ${r}%`}},B$={correct:(e,{treeScale:t,projectionDelta:n})=>{const r=e,s=$a.parse(e);if(s.length>5)return r;const i=$a.createTransformer(e),a=typeof s[0]!="number"?1:0,o=n.x.scale*t.x,c=n.y.scale*t.y;s[0+a]/=o,s[1+a]/=c;const u=dn(o,c,.5);return typeof s[2+a]=="number"&&(s[2+a]/=u),typeof s[3+a]=="number"&&(s[3+a]/=u),i(s)}};class F$ extends w.Component{componentDidMount(){const{visualElement:t,layoutGroup:n,switchLayoutGroup:r,layoutId:s}=this.props,{projection:i}=t;d9(U$),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()})),Sp.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()||qt.postRender(()=>{const o=a.getStack();(!o||!o.members.length)&&this.safeToRemove()}))),null}componentDidUpdate(){const{projection:t}=this.props.visualElement;t&&(t.root.didUpdate(),nw.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 rL(e){const[t,n]=UO(),r=w.useContext(Qx);return l.jsx(F$,{...e,layoutGroup:r,switchLayoutGroup:w.useContext(qO),isPresent:t,safeToRemove:n})}const U$={borderRadius:{...Eu,applyTo:["borderTopLeftRadius","borderTopRightRadius","borderBottomLeftRadius","borderBottomRightRadius"]},borderTopLeftRadius:Eu,borderTopRightRadius:Eu,borderBottomLeftRadius:Eu,borderBottomRightRadius:Eu,boxShadow:B$};function $$(e,t,n){const r=hr(e)?e:Kd(e);return r.start(Tw("",r,t,n)),r.animation}function H$(e){return e instanceof SVGElement&&e.tagName!=="svg"}const z$=(e,t)=>e.depth-t.depth;class V${constructor(){this.children=[],this.isDirty=!1}add(t){hw(this.children,t),this.isDirty=!0}remove(t){pw(this.children,t),this.isDirty=!0}forEach(t){this.isDirty&&this.children.sort(z$),this.isDirty=!1,this.children.forEach(t)}}function K$(e,t){const n=Ei.now(),r=({timestamp:s})=>{const i=s-n;i>=t&&(Ua(r),e(i-t))};return qt.read(r,!0),()=>Ua(r)}const sL=["TopLeft","TopRight","BottomLeft","BottomRight"],Y$=sL.length,MN=e=>typeof e=="string"?parseFloat(e):e,jN=e=>typeof e=="number"||tt.test(e);function G$(e,t,n,r,s,i){s?(e.opacity=dn(0,n.opacity!==void 0?n.opacity:1,W$(r)),e.opacityExit=dn(t.opacity!==void 0?t.opacity:1,0,q$(r))):i&&(e.opacity=dn(t.opacity!==void 0?t.opacity:1,n.opacity!==void 0?n.opacity:1,r));for(let a=0;art?1:n(bc(e,t,r))}function PN(e,t){e.min=t.min,e.max=t.max}function us(e,t){PN(e.x,t.x),PN(e.y,t.y)}function BN(e,t){e.translate=t.translate,e.scale=t.scale,e.originPoint=t.originPoint,e.origin=t.origin}function FN(e,t,n,r,s){return e-=t,e=vm(e,1/n,r),s!==void 0&&(e=vm(e,1/s,r)),e}function X$(e,t=0,n=1,r=.5,s,i=e,a=e){if(bi.test(t)&&(t=parseFloat(t),t=dn(a.min,a.max,t/100)-a.min),typeof t!="number")return;let o=dn(i.min,i.max,r);e===i&&(o-=t),e.min=FN(e.min,t,n,o,s),e.max=FN(e.max,t,n,o,s)}function UN(e,t,[n,r,s],i,a){X$(e,t[n],t[r],t[s],t.scale,i,a)}const Q$=["x","scaleX","originX"],Z$=["y","scaleY","originY"];function $N(e,t,n,r){UN(e.x,t,Q$,n?n.x:void 0,r?r.x:void 0),UN(e.y,t,Z$,n?n.y:void 0,r?r.y:void 0)}function HN(e){return e.translate===0&&e.scale===1}function aL(e){return HN(e.x)&&HN(e.y)}function zN(e,t){return e.min===t.min&&e.max===t.max}function J$(e,t){return zN(e.x,t.x)&&zN(e.y,t.y)}function VN(e,t){return Math.round(e.min)===Math.round(t.min)&&Math.round(e.max)===Math.round(t.max)}function oL(e,t){return VN(e.x,t.x)&&VN(e.y,t.y)}function KN(e){return ns(e.x)/ns(e.y)}function YN(e,t){return e.translate===t.translate&&e.scale===t.scale&&e.originPoint===t.originPoint}class e7{constructor(){this.members=[]}add(t){hw(this.members,t),t.scheduleRender()}remove(t){if(pw(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 t7(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,c=e.y.scale*t.y;return(o!==1||c!==1)&&(r+=`scale(${o}, ${c})`),r||"none"}const so={type:"projectionFrame",totalNodes:0,resolvedTargetDeltas:0,recalculatedProjection:0},Fu=typeof window<"u"&&window.MotionDebug!==void 0,my=["","X","Y","Z"],n7={visibility:"hidden"},GN=1e3;let r7=0;function gy(e,t,n,r){const{latestValues:s}=t;s[e]&&(n[e]=s[e],t.setStaticValue(e,0),r&&(r[e]=0))}function lL(e){if(e.hasCheckedOptimisedAppear=!0,e.root===e)return;const{visualElement:t}=e.options;if(!t)return;const n=dR(t);if(window.MotionHasOptimisedAnimation(n,"transform")){const{layout:s,layoutId:i}=e.options;window.MotionCancelOptimisedAnimation(n,"transform",qt,!(s||i))}const{parent:r}=e;r&&!r.hasCheckedOptimisedAppear&&lL(r)}function cL({attachResizeListener:e,defaultParent:t,measureScroll:n,checkIsScrollRoot:r,resetTransform:s}){return class{constructor(a={},o=t==null?void 0:t()){this.id=r7++,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,Fu&&(so.totalNodes=so.resolvedTargetDeltas=so.recalculatedProjection=0),this.nodes.forEach(a7),this.nodes.forEach(d7),this.nodes.forEach(f7),this.nodes.forEach(o7),Fu&&window.MotionDebug.record(so)},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 c=0;cthis.root.updateBlockedByResize=!1;e(a,()=>{this.root.updateBlockedByResize=!0,f&&f(),f=K$(h,250),Sp.hasAnimatedSinceResize&&(Sp.hasAnimatedSinceResize=!1,this.nodes.forEach(qN))})}c&&this.root.registerSharedNode(c,this),this.options.animate!==!1&&d&&(c||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()||y7,{onLayoutAnimationStart:E,onLayoutAnimationComplete:g}=d.getProps(),x=!this.targetLayout||!oL(this.targetLayout,m)||p,b=!h&&p;if(this.options.layoutRoot||this.resumeFrom&&this.resumeFrom.instance||b||h&&(x||!this.currentAnimation)){this.resumeFrom&&(this.resumingFrom=this.resumeFrom,this.resumingFrom.resumingFrom=void 0),this.setAnimationOrigin(f,b);const _={...fw(y,"layout"),onPlay:E,onComplete:g};(d.shouldReduceMotion||this.options.layoutRoot)&&(_.delay=0,_.type=!1),this.startAnimation(_)}else h||qN(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,Ua(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(h7),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&&lL(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 c=0;c{const k=_/1e3;XN(f.x,a.x,k),XN(f.y,a.y,k),this.setTargetDelta(f),this.relativeTarget&&this.relativeTargetOrigin&&this.layout&&this.relativeParent&&this.relativeParent.layout&&(od(h,this.layout.layoutBox,this.relativeParent.layout.layoutBox),m7(this.relativeTarget,this.relativeTargetOrigin,h,k),b&&J$(this.relativeTarget,b)&&(this.isProjectionDirty=!1),b||(b=Tn()),us(b,this.relativeTarget)),y&&(this.animationValues=d,G$(d,u,this.latestValues,k,x,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&&(Ua(this.pendingAnimation),this.pendingAnimation=void 0),this.pendingAnimation=qt.update(()=>{Sp.hasAnimatedSinceResize=!0,this.currentAnimation=$$(0,GN,{...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(GN),this.currentAnimation.stop()),this.completeAnimation()}applyTransformsToTarget(){const a=this.getLead();let{targetWithTransforms:o,target:c,layout:u,latestValues:d}=a;if(!(!o||!c||!u)){if(this!==a&&this.layout&&u&&uL(this.options.animationType,this.layout.layoutBox,u.layoutBox)){c=this.target||Tn();const f=ns(this.layout.layoutBox.x);c.x.min=a.target.x.min,c.x.max=c.x.min+f;const h=ns(this.layout.layoutBox.y);c.y.min=a.target.y.min,c.y.max=c.y.min+h}us(o,c),Fl(o,d),ad(this.projectionDeltaWithTransform,this.layoutCorrected,o,d)}}registerSharedNode(a,o){this.sharedNodes.has(a)||this.sharedNodes.set(a,new e7),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:c}={}){const u=this.getStack();u&&u.promote(this,c),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:c}=a;if((c.z||c.rotate||c.rotateX||c.rotateY||c.rotateZ||c.skewX||c.skewY)&&(o=!0),!o)return;const u={};c.z&&gy("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(WN),this.root.sharedNodes.clear()}}}function s7(e){e.updateLayout()}function i7(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"?ds(f=>{const h=a?n.measuredBox[f]:n.layoutBox[f],p=ns(h);h.min=r[f].min,h.max=h.min+p}):uL(i,n.layoutBox,r)&&ds(f=>{const h=a?n.measuredBox[f]:n.layoutBox[f],p=ns(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=Pl();ad(o,r,n.layoutBox);const c=Pl();a?ad(c,e.applyTransform(s,!0),n.measuredBox):ad(c,r,n.layoutBox);const u=!aL(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=Tn();od(m,n.layoutBox,h.layoutBox);const y=Tn();od(y,r,p.layoutBox),oL(m,y)||(d=!0),f.options.layoutRoot&&(e.relativeTarget=y,e.relativeTargetOrigin=m,e.relativeParent=f)}}}e.notifyListeners("didUpdate",{layout:r,snapshot:n,delta:c,layoutDelta:o,hasLayoutChanged:u,hasRelativeTargetChanged:d})}else if(e.isLead()){const{onExitComplete:r}=e.options;r&&r()}e.options.transition=void 0}function a7(e){Fu&&so.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 o7(e){e.isProjectionDirty=e.isSharedProjectionDirty=e.isTransformDirty=!1}function l7(e){e.clearSnapshot()}function WN(e){e.clearMeasurements()}function c7(e){e.isLayoutDirty=!1}function u7(e){const{visualElement:t}=e.options;t&&t.getProps().onBeforeLayoutMeasure&&t.notify("BeforeLayoutMeasure"),e.resetTransform()}function qN(e){e.finishAnimation(),e.targetDelta=e.relativeTarget=e.target=void 0,e.isProjectionDirty=!0}function d7(e){e.resolveTargetDelta()}function f7(e){e.calcProjection()}function h7(e){e.resetSkewAndRotation()}function p7(e){e.removeLeadSnapshot()}function XN(e,t,n){e.translate=dn(t.translate,0,n),e.scale=dn(t.scale,1,n),e.origin=t.origin,e.originPoint=t.originPoint}function QN(e,t,n,r){e.min=dn(t.min,n.min,r),e.max=dn(t.max,n.max,r)}function m7(e,t,n,r){QN(e.x,t.x,n.x,r),QN(e.y,t.y,n.y,r)}function g7(e){return e.animationValues&&e.animationValues.opacityExit!==void 0}const y7={duration:.45,ease:[.4,0,.1,1]},ZN=e=>typeof navigator<"u"&&navigator.userAgent&&navigator.userAgent.toLowerCase().includes(e),JN=ZN("applewebkit/")&&!ZN("chrome/")?Math.round:Jr;function eS(e){e.min=JN(e.min),e.max=JN(e.max)}function b7(e){eS(e.x),eS(e.y)}function uL(e,t,n){return e==="position"||e==="preserve-aspect"&&!w$(KN(t),KN(n),.2)}function E7(e){var t;return e!==e.root&&((t=e.scroll)===null||t===void 0?void 0:t.wasRoot)}const x7=cL({attachResizeListener:(e,t)=>Gd(e,"resize",t),measureScroll:()=>({x:document.documentElement.scrollLeft||document.body.scrollLeft,y:document.documentElement.scrollTop||document.body.scrollTop}),checkIsScrollRoot:()=>!0}),yy={current:void 0},dL=cL({measureScroll:e=>({x:e.scrollLeft,y:e.scrollTop}),defaultParent:()=>{if(!yy.current){const e=new x7({});e.mount(window),e.setOptions({layoutScroll:!0}),yy.current=e}return yy.current},resetTransform:(e,t)=>{e.style.transform=t!==void 0?t:"none"},checkIsScrollRoot:e=>window.getComputedStyle(e).position==="fixed"}),w7={pan:{Feature:P$},drag:{Feature:D$,ProjectionNode:dL,MeasureLayout:rL}};function v7(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 fL(e,t){const n=v7(e),r=new AbortController,s={passive:!0,...t,signal:r.signal};return[n,s,()=>r.abort()]}function tS(e){return t=>{t.pointerType==="touch"||GR()||e(t)}}function _7(e,t,n={}){const[r,s,i]=fL(e,n),a=tS(o=>{const{target:c}=o,u=t(o);if(typeof u!="function"||!c)return;const d=tS(f=>{u(f),c.removeEventListener("pointerleave",d)});c.addEventListener("pointerleave",d,s)});return r.forEach(o=>{o.addEventListener("pointerenter",a,s)}),i}function nS(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&&qt.postRender(()=>i(t,Sf(t)))}class k7 extends Ka{mount(){const{current:t}=this.node;t&&(this.unmount=_7(t,n=>(nS(this.node,n,"Start"),r=>nS(this.node,r,"End"))))}unmount(){}}class N7 extends Ka{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=Nf(Gd(this.node.current,"focus",()=>this.onFocus()),Gd(this.node.current,"blur",()=>this.onBlur()))}unmount(){}}const hL=(e,t)=>t?e===t?!0:hL(e,t.parentElement):!1,S7=new Set(["BUTTON","INPUT","SELECT","TEXTAREA","A"]);function T7(e){return S7.has(e.tagName)||e.tabIndex!==-1}const Uu=new WeakSet;function rS(e){return t=>{t.key==="Enter"&&e(t)}}function by(e,t){e.dispatchEvent(new PointerEvent("pointer"+t,{isPrimary:!0,bubbles:!0}))}const A7=(e,t)=>{const n=e.currentTarget;if(!n)return;const r=rS(()=>{if(Uu.has(n))return;by(n,"down");const s=rS(()=>{by(n,"up")}),i=()=>by(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 sS(e){return Aw(e)&&!GR()}function C7(e,t,n={}){const[r,s,i]=fL(e,n),a=o=>{const c=o.currentTarget;if(!sS(o)||Uu.has(c))return;Uu.add(c);const u=t(o),d=(p,m)=>{window.removeEventListener("pointerup",f),window.removeEventListener("pointercancel",h),!(!sS(p)||!Uu.has(c))&&(Uu.delete(c),typeof u=="function"&&u(p,{success:m}))},f=p=>{d(p,n.useGlobalTarget||hL(c,p.target))},h=p=>{d(p,!1)};window.addEventListener("pointerup",f,s),window.addEventListener("pointercancel",h,s)};return r.forEach(o=>{!T7(o)&&o.getAttribute("tabindex")===null&&(o.tabIndex=0),(n.useGlobalTarget?window:o).addEventListener("pointerdown",a,s),o.addEventListener("focus",u=>A7(u,s),s)}),i}function iS(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&&qt.postRender(()=>i(t,Sf(t)))}class I7 extends Ka{mount(){const{current:t}=this.node;t&&(this.unmount=C7(t,n=>(iS(this.node,n,"Start"),(r,{success:s})=>iS(this.node,r,s?"End":"Cancel")),{useGlobalTarget:this.node.props.globalTapTarget}))}unmount(){}}const F1=new WeakMap,Ey=new WeakMap,O7=e=>{const t=F1.get(e.target);t&&t(e)},R7=e=>{e.forEach(O7)};function L7({root:e,...t}){const n=e||document;Ey.has(n)||Ey.set(n,{});const r=Ey.get(n),s=JSON.stringify(t);return r[s]||(r[s]=new IntersectionObserver(R7,{root:e,...t})),r[s]}function M7(e,t,n){const r=L7(t);return F1.set(e,n),r.observe(e),()=>{F1.delete(e),r.unobserve(e)}}const j7={some:0,all:1};class D7 extends Ka{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:j7[s]},o=c=>{const{isIntersecting:u}=c;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(c)};return M7(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(P7(t,n))&&this.startObserver()}unmount(){}}function P7({viewport:e={}},{viewport:t={}}={}){return n=>e[n]!==t[n]}const B7={inView:{Feature:D7},tap:{Feature:I7},focus:{Feature:N7},hover:{Feature:k7}},F7={layout:{ProjectionNode:dL,MeasureLayout:rL}},U1={current:null},pL={current:!1};function U7(){if(pL.current=!0,!!Zx)if(window.matchMedia){const e=window.matchMedia("(prefers-reduced-motion)"),t=()=>U1.current=e.matches;e.addListener(t),t()}else U1.current=!1}const $7=[...jR,dr,$a],H7=e=>$7.find(MR(e)),aS=new WeakMap;function z7(e,t,n){for(const r in t){const s=t[r],i=n[r];if(hr(s))e.addValue(r,s);else if(hr(i))e.addValue(r,Kd(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,Kd(a!==void 0?a:s,{owner:e}))}}for(const r in n)t[r]===void 0&&e.removeValue(r);return t}const oS=["AnimationStart","AnimationComplete","Update","BeforeLayoutMeasure","LayoutMeasure","LayoutAnimationStart","LayoutAnimationComplete"];class V7{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=kw,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=Ei.now();this.renderScheduledAtthis.bindToMotionValue(r,n)),pL.current||U7(),this.shouldReduceMotion=this.reducedMotionConfig==="never"?!1:this.reducedMotionConfig==="always"?!0:U1.current,this.parent&&this.parent.children.add(this),this.update(this.props,this.presenceContext)}unmount(){aS.delete(this.current),this.projection&&this.projection.unmount(),Ua(this.notifyUpdate),Ua(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=Vo.has(t),s=n.on("change",o=>{this.latestValues[t]=o,this.props.onUpdate&&qt.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 yc){const n=yc[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):Tn()}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=Kd(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"&&(RR(s)||_R(s))?s=parseFloat(s):!H7(s)&&$a.test(n)&&(s=CR(t,n)),this.setBaseTarget(t,hr(s)?s.get():s)),hr(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=sw(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&&!hr(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 mw),this.events[t].add(n)}notify(t,...n){this.events[t]&&this.events[t].notify(...n)}}class mL extends V7{constructor(){super(...arguments),this.KeyframeResolver=DR}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;hr(t)&&(this.childSubscription=t.on("change",n=>{this.current&&(this.current.textContent=`${n}`)}))}}function K7(e){return window.getComputedStyle(e)}class Y7 extends mL{constructor(){super(...arguments),this.type="html",this.renderInstance=nR}readValueFromInstance(t,n){if(Vo.has(n)){const r=_w(n);return r&&r.default||0}else{const r=K7(t),s=(JO(n)?r.getPropertyValue(n):r[n])||0;return typeof s=="string"?s.trim():s}}measureInstanceViewportBox(t,{transformPagePoint:n}){return tL(t,n)}build(t,n,r){ow(t,n,r.transformTemplate)}scrapeMotionValuesFromProps(t,n,r){return dw(t,n,r)}}class G7 extends mL{constructor(){super(...arguments),this.type="svg",this.isSVGTag=!1,this.measureInstanceViewportBox=Tn}getBaseTargetFromProps(t,n){return t[n]}readValueFromInstance(t,n){if(Vo.has(n)){const r=_w(n);return r&&r.default||0}return n=rR.has(n)?n:tw(n),t.getAttribute(n)}scrapeMotionValuesFromProps(t,n,r){return aR(t,n,r)}build(t,n,r){lw(t,n,this.isSVGTag,r.transformTemplate)}renderInstance(t,n,r,s){sR(t,n,r,s)}mount(t){this.isSVGTag=uw(t.tagName),super.mount(t)}}const W7=(e,t)=>rw(e)?new G7(t):new Y7(t,{allowProjection:e!==w.Fragment}),q7=x9({...d$,...B7,...w7,...F7},W7),Dt=jF(q7);function $n(){return $n=Object.assign?Object.assign.bind():function(e){for(var t=1;t"u"||/ServerSideRendering/.test(navigator&&navigator.userAgent)?w.useEffect:w.useLayoutEffect;function bl(e,t,n){var r=w.useRef(t);r.current=t,w.useEffect(function(){function s(i){r.current(i)}return e&&window.addEventListener(e,s,n),function(){e&&window.removeEventListener(e,s)}},[e])}var X7=["container"];function Q7(e){var t=e.container,n=t===void 0?document.body:t,r=Og(e,X7);return Ns.createPortal(ft.createElement("div",$n({},r)),n)}function Z7(e){return ft.createElement("svg",$n({width:"44",height:"44",viewBox:"0 0 768 768"},e),ft.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 J7(e){return ft.createElement("svg",$n({width:"44",height:"44",viewBox:"0 0 768 768"},e),ft.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 eH(e){return ft.createElement("svg",$n({width:"44",height:"44",viewBox:"0 0 768 768"},e),ft.createElement("path",{d:"M384 127.5l256.5 256.5-256.5 256.5-45-45 178.5-180h-390v-63h390l-178.5-180z"}))}function tH(){return w.useEffect(function(){var e=document.body.style,t=e.overflow;return e.overflow="hidden",function(){e.overflow=t}},[]),null}function cS(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 Ea=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 xy(e,t,n,r,s,i,a,o,c,u){a===void 0&&(a=innerWidth/2),o===void 0&&(o=innerHeight/2),c===void 0&&(c=0),u===void 0&&(u=0);var d=Ea(e,i,n,innerWidth)[0],f=Ea(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?c/2:c),y:o-i/s*(o-(p+t))-p+(f[0]?u/2:u),lastCX:a,lastCY:o}}function z1(e,t,n){var r=e%180!=0;return r?[n,t,r]:[t,n,r]}function wy(e,t,n){var r=z1(n,innerWidth,innerHeight),s=r[0],i=r[1],a=0,o=s,c=i,u=e/t*i,d=t/e*s;return e=i?o=u:e>=s&&ts/i?c=d:t/e>=3&&!r[2]?a=((c=d)-i)/2:o=u,{width:o,height:c,x:0,y:a,pause:!0}}function jh(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=w.useRef(e);o.current=e;var c=w.useRef(0),u=w.useRef(),d=function(){return u.current&&clearTimeout(u.current)},f=w.useCallback(function(){var h=[].slice.call(arguments),p=Date.now();function m(){c.current=p,d(),o.current.apply(null,h)}var y=c.current,E=p-y;if(y===0&&(r&&m(),c.current=p),s!==void 0){if(E>s)return void m()}else E=1&&i&&i())};d()}function d(){c=requestAnimationFrame(u)}}var rH={T:0,L:0,W:0,H:0,FIT:void 0},yL=function(){var e=w.useRef(!1);return w.useEffect(function(){return e.current=!0,function(){e.current=!1}},[]),e},sH=["className"];function iH(e){var t=e.className,n=t===void 0?"":t,r=Og(e,sH);return ft.createElement("div",$n({className:"PhotoView__Spinner "+n},r),ft.createElement("svg",{viewBox:"0 0 32 32",width:"36",height:"36",fill:"white"},ft.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"}),ft.createElement("path",{d:"M16 0 A16 16 0 0 1 32 16 L28 16 A12 12 0 0 0 16 4z"})))}var aH=["src","loaded","broken","className","onPhotoLoad","loadingElement","brokenElement"];function oH(e){var t=e.src,n=e.loaded,r=e.broken,s=e.className,i=e.onPhotoLoad,a=e.loadingElement,o=e.brokenElement,c=Og(e,aH),u=yL();return t&&!r?ft.createElement(ft.Fragment,null,ft.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:""},c)),!n&&(a?ft.createElement("span",{className:"PhotoView__icon"},a):ft.createElement(iH,{className:"PhotoView__icon"}))):o?ft.createElement("span",{className:"PhotoView__icon"},typeof o=="function"?o({src:t}):o):null}var lH={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 cH(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,c=t.originRef,u=e.visible,d=e.speed,f=e.easing,h=e.wrapClassName,p=e.className,m=e.style,y=e.loadingElement,E=e.brokenElement,g=e.onPhotoTap,x=e.onMaskTap,b=e.onReachMove,_=e.onReachUp,k=e.onPhotoResize,N=e.isActive,C=e.expose,S=_m(lH),A=S[0],O=S[1],D=w.useRef(0),F=yL(),X=A.naturalWidth,L=X===void 0?i:X,j=A.naturalHeight,T=j===void 0?o:j,R=A.width,M=R===void 0?i:R,B=A.height,I=B===void 0?o:B,V=A.loaded,G=V===void 0?!n:V,P=A.broken,ie=A.x,q=A.y,ne=A.touched,oe=A.stopRaf,ee=A.maskTouched,ce=A.rotate,re=A.scale,pe=A.CX,ye=A.CY,J=A.lastX,fe=A.lastY,Ee=A.lastCX,Te=A.lastCY,Ge=A.lastScale,ke=A.touchTime,rt=A.touchLength,ze=A.pause,We=A.reach,yt=vo({onScale:function(me){return at(Mh(me))},onRotate:function(me){ce!==me&&(C({rotate:me}),O($n({rotate:me},wy(L,T,me))))}});function at(me,Ve,nt){re!==me&&(C({scale:me}),O($n({scale:me},xy(ie,q,M,I,re,me,Ve,nt),me<=1&&{x:0,y:0})))}var St=jh(function(me,Ve,nt){if(nt===void 0&&(nt=0),(ne||ee)&&N){var Xt=z1(ce,M,I),mn=Xt[0],Qt=Xt[1];if(nt===0&&D.current===0){var te=Math.abs(me-pe)<=20,he=Math.abs(Ve-ye)<=20;if(te&&he)return void O({lastCX:me,lastCY:Ve});D.current=te?Ve>ye?3:2:1}var Oe,De=me-Ee,lt=Ve-Te;if(nt===0){var Bt=Ea(De+J,re,mn,innerWidth)[0],it=Ea(lt+fe,re,Qt,innerHeight);Oe=function(ve,xe,Xe,qe){return xe&&ve===1||qe==="x"?"x":Xe&&ve>1||qe==="y"?"y":void 0}(D.current,Bt,it[0],We),Oe!==void 0&&b(Oe,me,Ve,re)}if(Oe==="x"||ee)return void O({reach:"x"});var Q=Mh(re+(nt-rt)/100/2*re,L/M,.2);C({scale:Q}),O($n({touchLength:nt,reach:Oe,scale:Q},xy(ie,q,M,I,re,Q,me,Ve,De,lt)))}},{maxWait:8});function Tt(me){return!oe&&!ne&&(F.current&&O($n({},me,{pause:u})),F.current)}var H,Z,le,be,Le,Ke,Ot,He,Ce=(Le=function(me){return Tt({x:me})},Ke=function(me){return Tt({y:me})},Ot=function(me){return F.current&&(C({scale:me}),O({scale:me})),!ne&&F.current},He=vo({X:function(me){return Le(me)},Y:function(me){return Ke(me)},S:function(me){return Ot(me)}}),function(me,Ve,nt,Xt,mn,Qt,te,he,Oe,De,lt){var Bt=z1(De,mn,Qt),it=Bt[0],Q=Bt[1],ve=Ea(me,he,it,innerWidth),xe=ve[0],Xe=ve[1],qe=Ea(Ve,he,Q,innerHeight),Je=qe[0],ct=qe[1],Rt=Date.now()-lt;if(Rt>=200||he!==te||Math.abs(Oe-te)>1){var Ft=xy(me,Ve,mn,Qt,te,he),vn=Ft.x,_n=Ft.y,Ut=xe?Xe:vn!==me?vn:null,Ir=Je?ct:_n!==Ve?_n:null;return Ut!==null&&oo(me,Ut,He.X),Ir!==null&&oo(Ve,Ir,He.Y),void(he!==te&&oo(te,he,He.S))}var Dn=(me-nt)/Rt,or=(Ve-Xt)/Rt,Or=Math.sqrt(Math.pow(Dn,2)+Math.pow(or,2)),Er=!1,lr=!1;(function(kn,Zt){var Nn,Vn=kn,Zn=0,on=0,as=function(Jn){Nn||(Nn=Jn);var os=Jn-Nn,Si=Math.sign(kn),ri=-.001*Si,Cs=Math.sign(-Vn)*Math.pow(Vn,2)*2e-4,Rr=Vn*os+(ri+Cs)*Math.pow(os,2)/2;Zn+=Rr,Nn=Jn,Si*(Vn+=(ri+Cs)*os)<=0?Pn():Zt(Zn)?Kn():Pn()};function Kn(){on=requestAnimationFrame(as)}function Pn(){cancelAnimationFrame(on)}Kn()})(Or,function(kn){var Zt=me+kn*(Dn/Or),Nn=Ve+kn*(or/Or),Vn=Ea(Zt,te,it,innerWidth),Zn=Vn[0],on=Vn[1],as=Ea(Nn,te,Q,innerHeight),Kn=as[0],Pn=as[1];if(Zn&&!Er&&(Er=!0,xe?oo(Zt,on,He.X):uS(on,Zt+(Zt-on),He.X)),Kn&&!lr&&(lr=!0,Je?oo(Nn,Pn,He.Y):uS(Pn,Nn+(Nn-Pn),He.Y)),Er&&lr)return!1;var Jn=Er||He.X(on),os=lr||He.Y(Pn);return Jn&&os})}),Ie=(H=g,Z=function(me,Ve){We||at(re!==1?1:Math.max(2,L/M),me,Ve)},le=w.useRef(0),be=jh(function(){le.current=0,H.apply(void 0,[].slice.call(arguments))},{wait:300}),function(){var me=[].slice.call(arguments);le.current+=1,be.apply(void 0,me),le.current>=2&&(be.cancel(),le.current=0,Z.apply(void 0,me))});function wt(me,Ve){if(D.current=0,(ne||ee)&&N){O({touched:!1,maskTouched:!1,pause:!1,stopRaf:!1,reach:void 0});var nt=Mh(re,L/M);if(Ce(ie,q,J,fe,M,I,re,nt,Ge,ce,ke),_(me,Ve),pe===me&&ye===Ve){if(ne)return void Ie(me,Ve);ee&&x(me,Ve)}}}function Kt(me,Ve,nt){nt===void 0&&(nt=0),O({touched:!0,CX:me,CY:Ve,lastCX:me,lastCY:Ve,lastX:ie,lastY:q,lastScale:re,touchLength:nt,touchTime:Date.now()})}function Pt(me){O({maskTouched:!0,CX:me.clientX,CY:me.clientY,lastX:ie,lastY:q})}bl(Bi?void 0:"mousemove",function(me){me.preventDefault(),St(me.clientX,me.clientY)}),bl(Bi?void 0:"mouseup",function(me){wt(me.clientX,me.clientY)}),bl(Bi?"touchmove":void 0,function(me){me.preventDefault();var Ve=cS(me);St.apply(void 0,Ve)},{passive:!1}),bl(Bi?"touchend":void 0,function(me){var Ve=me.changedTouches[0];wt(Ve.clientX,Ve.clientY)},{passive:!1}),bl("resize",jh(function(){G&&!ne&&(O(wy(L,T,ce)),k())},{maxWait:8})),H1(function(){N&&C($n({scale:re,rotate:ce},yt))},[N]);var pn=function(me,Ve,nt,Xt,mn,Qt,te,he,Oe,De){var lt=function(vn,_n,Ut,Ir,Dn){var or=w.useRef(!1),Or=_m({lead:!0,scale:Ut}),Er=Or[0],lr=Er.lead,kn=Er.scale,Zt=Or[1],Nn=jh(function(Vn){try{return Dn(!0),Zt({lead:!1,scale:Vn}),Promise.resolve()}catch(Zn){return Promise.reject(Zn)}},{wait:Ir});return H1(function(){or.current?(Dn(!1),Zt({lead:!0}),Nn(Ut)):or.current=!0},[Ut]),lr?[vn*kn,_n*kn,Ut/kn]:[vn*Ut,_n*Ut,1]}(Qt,te,he,Oe,De),Bt=lt[0],it=lt[1],Q=lt[2],ve=function(vn,_n,Ut,Ir,Dn){var or=w.useState(rH),Or=or[0],Er=or[1],lr=w.useState(0),kn=lr[0],Zt=lr[1],Nn=w.useRef(),Vn=vo({OK:function(){return vn&&Zt(4)}});function Zn(on){Dn(!1),Zt(on)}return w.useEffect(function(){if(Nn.current||(Nn.current=Date.now()),Ut){if(function(on,as){var Kn=on&&on.current;if(Kn&&Kn.nodeType===1){var Pn=Kn.getBoundingClientRect();as({T:Pn.top,L:Pn.left,W:Pn.width,H:Pn.height,FIT:Kn.tagName==="IMG"?getComputedStyle(Kn).objectFit:void 0})}}(_n,Er),vn)return Date.now()-Nn.current<250?(Zt(1),requestAnimationFrame(function(){Zt(2),requestAnimationFrame(function(){return Zn(3)})}),void setTimeout(Vn.OK,Ir)):void Zt(4);Zn(5)}},[vn,Ut]),[kn,Or]}(me,Ve,nt,Oe,De),xe=ve[0],Xe=ve[1],qe=Xe.W,Je=Xe.FIT,ct=innerWidth/2,Rt=innerHeight/2,Ft=xe<3||xe>4;return[Ft?qe?Xe.L:ct:Xt+(ct-Qt*he/2),Ft?qe?Xe.T:Rt:mn+(Rt-te*he/2),Bt,Ft&&Je?Bt*(Xe.H/qe):it,xe===0?Q:Ft?qe/(Qt*he)||.01:Q,Ft?Je?1:0:1,xe,Je]}(u,c,G,ie,q,M,I,re,d,function(me){return O({pause:me})}),je=pn[4],st=pn[6],It="transform "+d+"ms "+f,At={className:p,onMouseDown:Bi?void 0:function(me){me.stopPropagation(),me.button===0&&Kt(me.clientX,me.clientY,0)},onTouchStart:Bi?function(me){me.stopPropagation(),Kt.apply(void 0,cS(me))}:void 0,onWheel:function(me){if(!We){var Ve=Mh(re-me.deltaY/100/2,L/M);O({stopRaf:!0}),at(Ve,me.clientX,me.clientY)}},style:{width:pn[2]+"px",height:pn[3]+"px",opacity:pn[5],objectFit:st===4?void 0:pn[7],transform:ce?"rotate("+ce+"deg)":void 0,transition:st>2?It+", opacity "+d+"ms ease, height "+(st<4?d/2:st>4?d:0)+"ms "+f:void 0}};return ft.createElement("div",{className:"PhotoView__PhotoWrap"+(h?" "+h:""),style:m,onMouseDown:!Bi&&N?Pt:void 0,onTouchStart:Bi&&N?function(me){return Pt(me.touches[0])}:void 0},ft.createElement("div",{className:"PhotoView__PhotoBox",style:{transform:"matrix("+je+", 0, 0, "+je+", "+pn[0]+", "+pn[1]+")",transition:ne||ze?void 0:It,willChange:N?"transform":void 0}},n?ft.createElement(oH,$n({src:n,loaded:G,broken:P},At,{onPhotoLoad:function(me){O($n({},me,me.loaded&&wy(me.naturalWidth||0,me.naturalHeight||0,ce)))},loadingElement:y,brokenElement:E})):r&&r({attrs:At,scale:je,rotate:ce})))}var dS={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 uH(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,c=e.maskOpacity,u=c===void 0?1:c,d=e.pullClosable,f=d===void 0||d,h=e.bannerVisible,p=h===void 0||h,m=e.overlayRender,y=e.toolbarRender,E=e.className,g=e.maskClassName,x=e.photoClassName,b=e.photoWrapClassName,_=e.loadingElement,k=e.brokenElement,N=e.images,C=e.index,S=C===void 0?0:C,A=e.onIndexChange,O=e.visible,D=e.onClose,F=e.afterClose,X=e.portalContainer,L=_m(dS),j=L[0],T=L[1],R=w.useState(0),M=R[0],B=R[1],I=j.x,V=j.touched,G=j.pause,P=j.lastCX,ie=j.lastCY,q=j.bg,ne=q===void 0?u:q,oe=j.lastBg,ee=j.overlay,ce=j.minimal,re=j.scale,pe=j.rotate,ye=j.onScale,J=j.onRotate,fe=e.hasOwnProperty("index"),Ee=fe?S:M,Te=fe?A:B,Ge=w.useRef(Ee),ke=N.length,rt=N[Ee],ze=typeof n=="boolean"?n:ke>n,We=function(je,st){var It=w.useReducer(function(nt){return!nt},!1)[1],At=w.useRef(0),me=function(nt){var Xt=w.useRef(nt);function mn(Qt){Xt.current=Qt}return w.useMemo(function(){(function(Qt){je?(Qt(je),At.current=1):At.current=2})(mn)},[nt]),[Xt.current,mn]}(je),Ve=me[1];return[me[0],At.current,function(){It(),At.current===2&&(Ve(!1),st&&st()),At.current=0}]}(O,F),yt=We[0],at=We[1],St=We[2];H1(function(){if(yt)return T({pause:!0,x:Ee*-(innerWidth+ul)}),void(Ge.current=Ee);T(dS)},[yt]);var Tt=vo({close:function(je){J&&J(0),T({overlay:!0,lastBg:ne}),D(je)},changeIndex:function(je,st){st===void 0&&(st=!1);var It=ze?Ge.current+(je-Ee):je,At=ke-1,me=$1(It,0,At),Ve=ze?It:me,nt=innerWidth+ul;T({touched:!1,lastCX:void 0,lastCY:void 0,x:-nt*Ve,pause:st}),Ge.current=Ve,Te&&Te(ze?je<0?At:je>At?0:je:me)}}),H=Tt.close,Z=Tt.changeIndex;function le(je){return je?H():T({overlay:!ee})}function be(){T({x:-(innerWidth+ul)*Ee,lastCX:void 0,lastCY:void 0,pause:!0}),Ge.current=Ee}function Le(je,st,It,At){je==="x"?function(me){if(P!==void 0){var Ve=me-P,nt=Ve;!ze&&(Ee===0&&Ve>0||Ee===ke-1&&Ve<0)&&(nt=Ve/2),T({touched:!0,lastCX:P,x:-(innerWidth+ul)*Ge.current+nt,pause:!1})}else T({touched:!0,lastCX:me,x:I,pause:!1})}(st):je==="y"&&function(me,Ve){if(ie!==void 0){var nt=u===null?null:$1(u,.01,u-Math.abs(me-ie)/100/4);T({touched:!0,lastCY:ie,bg:Ve===1?nt:u,minimal:Ve===1})}else T({touched:!0,lastCY:me,bg:ne,minimal:!0})}(It,At)}function Ke(je,st){var It=je-(P??je),At=st-(ie??st),me=!1;if(It<-40)Z(Ee+1);else if(It>40)Z(Ee-1);else{var Ve=-(innerWidth+ul)*Ge.current;Math.abs(At)>100&&ce&&f&&(me=!0,H()),T({touched:!1,x:Ve,lastCX:void 0,lastCY:void 0,bg:u,overlay:!!me||ee})}}bl("keydown",function(je){if(O)switch(je.key){case"ArrowLeft":Z(Ee-1,!0);break;case"ArrowRight":Z(Ee+1,!0);break;case"Escape":H()}});var Ot=function(je,st,It){return w.useMemo(function(){var At=je.length;return It?je.concat(je).concat(je).slice(At+st-1,At+st+2):je.slice(Math.max(st-1,0),Math.min(st+2,At+1))},[je,st,It])}(N,Ee,ze);if(!yt)return null;var He=ee&&!at,Ce=O?ne:oe,Ie=ye&&J&&{images:N,index:Ee,visible:O,onClose:H,onIndexChange:Z,overlayVisible:He,overlay:rt&&rt.overlay,scale:re,rotate:pe,onScale:ye,onRotate:J},wt=r?r(at):400,Kt=s?s(at):lS,Pt=r?r(3):600,pn=s?s(3):lS;return ft.createElement(Q7,{className:"PhotoView-Portal"+(He?"":" PhotoView-Slider__clean")+(O?"":" PhotoView-Slider__willClose")+(E?" "+E:""),role:"dialog",onClick:function(je){return je.stopPropagation()},container:X},O&&ft.createElement(tH,null),ft.createElement("div",{className:"PhotoView-Slider__Backdrop"+(g?" "+g:"")+(at===1?" PhotoView-Slider__fadeIn":at===2?" PhotoView-Slider__fadeOut":""),style:{background:Ce?"rgba(0, 0, 0, "+Ce+")":void 0,transitionTimingFunction:Kt,transitionDuration:(V?0:wt)+"ms",animationDuration:wt+"ms"},onAnimationEnd:St}),p&&ft.createElement("div",{className:"PhotoView-Slider__BannerWrap"},ft.createElement("div",{className:"PhotoView-Slider__Counter"},Ee+1," / ",ke),ft.createElement("div",{className:"PhotoView-Slider__BannerRight"},y&&Ie&&y(Ie),ft.createElement(Z7,{className:"PhotoView-Slider__toolbarIcon",onClick:H}))),Ot.map(function(je,st){var It=ze||Ee!==0?Ge.current-1+st:Ee+st;return ft.createElement(cH,{key:ze?je.key+"/"+je.src+"/"+It:je.key,item:je,speed:wt,easing:Kt,visible:O,onReachMove:Le,onReachUp:Ke,onPhotoTap:function(){return le(i)},onMaskTap:function(){return le(o)},wrapClassName:b,className:x,style:{left:(innerWidth+ul)*It+"px",transform:"translate3d("+I+"px, 0px, 0)",transition:V||G?void 0:"transform "+Pt+"ms "+pn},loadingElement:_,brokenElement:k,onPhotoResize:be,isActive:Ge.current===It,expose:T})}),!Bi&&p&&ft.createElement(ft.Fragment,null,(ze||Ee!==0)&&ft.createElement("div",{className:"PhotoView-Slider__ArrowLeft",onClick:function(){return Z(Ee-1,!0)}},ft.createElement(J7,null)),(ze||Ee+1-1){var g=u.slice();return g.splice(E,1,y),void o({images:g})}o(function(x){return{images:x.images.concat(y)}})},remove:function(y){o(function(E){var g=E.images.filter(function(x){return x.key!==y});return{images:g,index:Math.min(g.length-1,f)}})},show:function(y){var E=u.findIndex(function(g){return g.key===y});o({visible:!0,index:E}),r&&r(!0,E,a)}}),p=vo({close:function(){o({visible:!1}),r&&r(!1,f,a)},changeIndex:function(y){o({index:y}),n&&n(y,a)}}),m=w.useMemo(function(){return $n({},a,h)},[a,h]);return ft.createElement(gL.Provider,{value:m},t,ft.createElement(uH,$n({images:u,visible:d,index:f,onIndexChange:p.changeIndex,onClose:p.close},s)))}var bL=function(e){var t,n,r=e.src,s=e.render,i=e.overlay,a=e.width,o=e.height,c=e.triggers,u=c===void 0?["onClick"]:c,d=e.children,f=w.useContext(gL),h=(t=function(){return f.nextId()},(n=w.useRef({sign:!1,fn:void 0}).current).sign||(n.sign=!0,n.fn=t()),n.fn),p=w.useRef(null);w.useImperativeHandle(d==null?void 0:d.ref,function(){return p.current}),w.useEffect(function(){return function(){f.remove(h)}},[]);var m=vo({render:function(E){return s&&s(E)},show:function(E,g){f.show(h),function(x,b){if(d){var _=d.props[x];_&&_(b)}}(E,g)}}),y=w.useMemo(function(){var E={};return u.forEach(function(g){E[g]=m.show.bind(null,g)}),E},[]);return w.useEffect(function(){f.update({key:h,src:r,originRef:p,render:m.render,overlay:i,width:a,height:o})},[r]),d?w.Children.only(w.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 pH=e=>e.replace(/([a-z0-9])([A-Z])/g,"$1-$2").toLowerCase(),EL=(...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 mH={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 gH=w.forwardRef(({color:e="currentColor",size:t=24,strokeWidth:n=2,absoluteStrokeWidth:r,className:s="",children:i,iconNode:a,...o},c)=>w.createElement("svg",{ref:c,...mH,width:t,height:t,stroke:e,strokeWidth:r?Number(n)*24/Number(t):n,className:EL("lucide",s),...o},[...a.map(([u,d])=>w.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 Re=(e,t)=>{const n=w.forwardRef(({className:r,...s},i)=>w.createElement(gH,{ref:i,iconNode:t,className:EL(`lucide-${pH(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 yH=Re("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 xL=Re("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 wL=Re("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 ld=Re("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 vL=Re("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 _L=Re("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 bH=Re("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 Ro=Re("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 kL=Re("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 EH=Re("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 xH=Re("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 Js=Re("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 Cw=Re("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 wH=Re("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 xs=Re("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 Rg=Re("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 NL=Re("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 V1=Re("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 vH=Re("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 Iw=Re("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 Ow=Re("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 _H=Re("CornerDownRight",[["polyline",{points:"15 10 20 15 15 20",key:"1q7qjw"}],["path",{d:"M4 4v7a4 4 0 0 0 4 4h12",key:"z08zvw"}]]);/** + * @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 kH=Re("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 Tp=Re("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 Rw=Re("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 NH=Re("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. + * See the LICENSE file in the root directory of this source tree. + */const Lw=Re("ExternalLink",[["path",{d:"M15 3h6v6",key:"1q9fwt"}],["path",{d:"M10 14 21 3",key:"gplh6r"}],["path",{d:"M18 13v6a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2V8a2 2 0 0 1 2-2h6",key:"a6xqqp"}]]);/** + * @license lucide-react v0.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 SH=Re("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. + * See the LICENSE file in the root directory of this source tree. + */const SL=Re("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. + * See the LICENSE file in the root directory of this source tree. + */const TH=Re("FileArchive",[["path",{d:"M10 12v-1",key:"v7bkov"}],["path",{d:"M10 18v-2",key:"1cjy8d"}],["path",{d:"M10 7V6",key:"dljcrl"}],["path",{d:"M14 2v4a2 2 0 0 0 2 2h4",key:"tnqrlb"}],["path",{d:"M15.5 22H18a2 2 0 0 0 2-2V7l-5-5H6a2 2 0 0 0-2 2v16a2 2 0 0 0 .274 1.01",key:"gkbcor"}],["circle",{cx:"10",cy:"20",r:"2",key:"1xzdoj"}]]);/** + * @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 fS=Re("FileCode2",[["path",{d:"M4 22h14a2 2 0 0 0 2-2V7l-5-5H6a2 2 0 0 0-2 2v4",key:"1pf5j1"}],["path",{d:"M14 2v4a2 2 0 0 0 2 2h4",key:"tnqrlb"}],["path",{d:"m5 12-3 3 3 3",key:"oke12k"}],["path",{d:"m9 18 3-3-3-3",key:"112psh"}]]);/** + * @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=Re("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 CH=Re("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 TL=Re("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 IH=Re("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 AL=Re("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 OH=Re("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 RH=Re("FlaskConical",[["path",{d:"M10 2v7.527a2 2 0 0 1-.211.896L4.72 20.55a1 1 0 0 0 .9 1.45h12.76a1 1 0 0 0 .9-1.45l-5.069-10.127A2 2 0 0 1 14 9.527V2",key:"pzvekw"}],["path",{d:"M8.5 2h7",key:"csnxdl"}],["path",{d:"M7 16h10",key:"wp8him"}]]);/** + * @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 LH=Re("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 Mw=Re("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 CL=Re("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 MH=Re("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 jH=Re("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 Lg=Re("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 DH=Re("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 PH=Re("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 IL=Re("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 Ya=Re("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 BH=Re("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 OL=Re("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 FH=Re("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 RL=Re("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 UH=Re("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 Mt=Re("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 $H=Re("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 HH=Re("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 tc=Re("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 LL=Re("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 zH=Re("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 VH=Re("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 KH=Re("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 ML=Re("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 YH=Re("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 GH=Re("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 WH=Re("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 qH=Re("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 sr=Re("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 K1=Re("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. + * See the LICENSE file in the root directory of this source tree. + */const jw=Re("Repeat",[["path",{d:"m17 2 4 4-4 4",key:"nntrym"}],["path",{d:"M3 11v-1a4 4 0 0 1 4-4h14",key:"84bu3i"}],["path",{d:"m7 22-4-4 4-4",key:"1wqhfi"}],["path",{d:"M21 13v1a4 4 0 0 1-4 4H3",key:"1rx37r"}]]);/** + * @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 XH=Re("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 QH=Re("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 Wd=Re("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 ZH=Re("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 JH=Re("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. + * See the LICENSE file in the root directory of this source tree. + */const hS=Re("ShieldCheck",[["path",{d:"M20 13c0 5-3.5 7.5-7.66 8.95a1 1 0 0 1-.67-.01C7.5 20.5 4 18 4 13V6a1 1 0 0 1 1-1c2 0 4.5-1.2 6.24-2.72a1.17 1.17 0 0 1 1.52 0C14.51 3.81 17 5 19 5a1 1 0 0 1 1 1z",key:"oel41y"}],["path",{d:"m9 12 2 2 4-4",key:"dzmm74"}]]);/** + * @license lucide-react v0.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 Lo=Re("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 ez=Re("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 ta=Re("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 tz=Re("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 nz=Re("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 rz=Re("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 sz=Re("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 iz=Re("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. + * See the LICENSE file in the root directory of this source tree. + */const jL=Re("Wrench",[["path",{d:"M14.7 6.3a1 1 0 0 0 0 1.4l1.6 1.6a1 1 0 0 0 1.4 0l3.77-3.77a6 6 0 0 1-7.94 7.94l-6.91 6.91a2.12 2.12 0 0 1-3-3l6.91-6.91a6 6 0 0 1 7.94-7.94l-3.76 3.76z",key:"cbrjhi"}]]);/** + * @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 Hr=Re("X",[["path",{d:"M18 6 6 18",key:"1bl5f8"}],["path",{d:"m6 6 12 12",key:"d8bk6v"}]]),pS="veadk_auth_qs";let xu=null;function az(){if(xu!==null)return xu;const e=window.location.search.replace(/^\?/,"");return e?(sessionStorage.setItem(pS,e),window.history.replaceState(null,"",window.location.pathname+window.location.hash),xu=e):xu=sessionStorage.getItem(pS)??"",xu}function xi(e){const t=az();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 Gc=3e4,Dw=12e4,DL=1e4;function Ws(e,t=Gc){if(t<=0)return e??void 0;const n=AbortSignal.timeout(t);return e?AbortSignal.any([e,n]):n}const km="veadk_local_user",Nm="veadk_local_user_tab",oz=/^[A-Za-z0-9]{1,16}$/;function PL(){try{const e=sessionStorage.getItem(Nm);if(e)return e;const t=localStorage.getItem(km);return t&&sessionStorage.setItem(Nm,t),t}catch{try{return localStorage.getItem(km)}catch{return null}}}function mS(e){try{sessionStorage.setItem(Nm,e)}catch{}try{localStorage.setItem(km,e)}catch{}}function lz(){try{sessionStorage.removeItem(Nm)}catch{}try{localStorage.removeItem(km)}catch{}}function Mg(e){const t=new Headers(e),n=PL();return n&&t.set("X-VeADK-Local-User",n),t}async function BL(){let e;try{e=await fetch("/web/auth-config",{headers:{Accept:"application/json"},signal:Ws(void 0,DL)})}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 cz(e){const t=window.location.pathname+window.location.search+window.location.hash,n=e.includes("?")?"&":"?";window.location.assign(`${e}${n}redirect=${encodeURIComponent(t)}`)}function uz(){const e=window.location.pathname+window.location.search+window.location.hash,t=window.open("about:blank","_blank","popup,width=520,height=720");if(!t)return null;try{t.opener=null,t.location.replace(`/oauth2/login?redirect=${encodeURIComponent(e)}`)}catch{return t.close(),null}return t}async function dz(){const[e,t]=await Promise.all([Y1(),BL()]);return e.status==="unauthenticated"&&t.length>0}function fz(){window.location.assign("/oauth2/logout")}async function Y1(){let e;try{e=await fetch("/oauth2/userinfo",{headers:{Accept:"application/json"},signal:Ws(void 0,DL)})}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=PL();return t?{status:"authenticated",userId:t,info:{name:t},local:!0}:{status:"unauthenticated",userId:"",local:!0}}function hz(e){return e?String(e.name??e.preferred_username??e.email??e.sub??""):""}function pz(e){const t=e==null?void 0:e.picture;return typeof t=="string"?t.trim():""}const G1="veadk:authentication-required";let cd=null,$u=null;function mz(e){if(!e.redirected||!e.url)return!1;try{const t=new URL(e.url);return t.pathname.includes("/authorize")||t.pathname.includes("/oauth2/login")||t.hostname.includes(".userpool.auth.")}catch{return!1}}function gz(e){cd||(cd=new Promise(n=>{$u=n}),window.dispatchEvent(new Event(G1)));const t=cd;return e?e.aborted?Promise.reject(e.reason??new Error("Request aborted")):new Promise((n,r)=>{const s=()=>r(e.reason??new Error("Request aborted"));e.addEventListener("abort",s,{once:!0}),t.then(()=>{e.removeEventListener("abort",s),n()},i=>{e.removeEventListener("abort",s),r(i)})}):t}function yz(){return cd!==null}function bz(){$u==null||$u(),$u=null,cd=null}async function Pw(e,t){var r;const n=await e.text().catch(()=>"");try{return JSON.parse(n)}catch{const s=((r=e.headers.get("content-type"))==null?void 0:r.split(";",1)[0])||"Content-Type 缺失",i=n.trim().slice(0,2e3),a=i?` +响应:${i}`:"";throw new Error(`${t}:服务端返回非 JSON 响应(HTTP ${e.status},${s})${a}`)}}const Ez=/\brun_sse\s*failed\s*:\s*404\b/i,gS="提示:该 404 可能是多实例部署使用 in-memory 或 SQLite 短期记忆导致的:请求落到不同实例后,会话无法找到。请改用基于数据库的持久化短期记忆存储。";function Dh(e){const t=String(e);return!Ez.test(t)||t.includes(gS)?t:`${t} + +${gS}`}async function*Bw(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 c=o.split(/\r?\n/).filter(u=>u.startsWith("data:")).map(u=>u.slice(5).trimStart()).join(` +`);if(c)try{yield JSON.parse(c)}catch{c!=="[DONE]"&&c!=="ping"&&console.debug(`parseSSE: dropping unparseable frame (${c.length} chars):`,c.slice(0,200))}a=r.match(/\r?\n\r?\n/)}}}finally{try{await t.cancel()}catch{}finally{t.releaseLock()}}}const FL="veadk.messageFeedback.v1";function UL(e,t,n,r){return[e,t,n,r].join(":")}function $L(){if(typeof window>"u")return{};try{const e=JSON.parse(localStorage.getItem(FL)??"{}");return e&&typeof e=="object"?e:{}}catch{return{}}}function xz(e,t,n){if(typeof window>"u")return;const r=$L();r[e]={...r[e]??{},[`veadk_feedback:${t}`]:n},localStorage.setItem(FL,JSON.stringify(r))}const Ap="",Fw=new Map;function HL(e,t){Fw.set(e,t)}function zL(){Fw.clear()}function zn(e){const t=Fw.get(e);return t?{app:t.app,ep:{base:t.base,apiKey:t.apiKey,runtimeId:t.runtimeId,region:t.region}}:{app:e,ep:{}}}async function ht(e,t={},n={},r=Gc){const s={...t,headers:Mg(t.headers)},i=()=>{const c={...s,signal:Ws(t.signal,r)};if(n.runtimeId){const u=n.region?`${e.includes("?")?"&":"?"}region=${encodeURIComponent(n.region)}`:"";return fetch(xi(`${Ap}/web/runtime-proxy/${n.runtimeId}${e}${u}`),c)}if(n.base){const u=new Headers(c.headers);return u.set("X-AgentKit-Base",n.base),n.apiKey&&u.set("X-AgentKit-Key",n.apiKey),fetch(xi(`${Ap}/agentkit-proxy${e}`),{...c,headers:u})}return fetch(xi(`${Ap}${e}`),c)},a=async c=>{if(mz(c))return!0;if(c.status!==401)return!1;try{return await dz()}catch{return!1}};let o=await i();for(;await a(o);)await gz(t.signal),o=await i();return o}function wz(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 wn(e,t){const n=await e.text().catch(()=>"");if(!n)return`${t} (${e.status})`;try{const r=JSON.parse(n);return wz(r.detail??r.error)||n||`${t} (${e.status})`}catch{return n||`${t} (${e.status})`}}async function VL(){const e=await ht("/list-apps");if(!e.ok)throw new Error(`list-apps failed: ${e.status}`);return e.json()}class Tf extends Error{constructor(){super("当前账号无权访问该 Runtime,请刷新列表或重新登录后重试。"),this.name="RuntimeAccessDeniedError"}}class qd extends Error{constructor(t,n=!1){super(t),this.unsupported=n,this.name="RuntimeProbeError"}}async function vz(e){try{const t=await e.clone().json();return typeof t.detail=="string"?t.detail:""}catch{return""}}async function jg(e,t,n){const r=await ht("/list-apps",{},n??{base:e,apiKey:t}),s=n!=null&&n.runtimeId?await vz(r):"";if(n!=null&&n.runtimeId&&s==="runtime_access_denied")throw new Tf;if(n!=null&&n.runtimeId&&r.status===404)throw new qd("该 Runtime 的 Agent Server 未提供连接接口,请确认 Runtime 已就绪且版本兼容。",!0);if(n!=null&&n.runtimeId&&(r.status===401||r.status===403))throw new qd("Runtime 服务拒绝了连接请求,请检查 Runtime 的鉴权配置。");if(!r.ok)throw new Error(await wn(r,"读取 Agent 列表失败"));return r.json()}async function Sm(e,t){const{app:n,ep:r}=zn(e),s=await ht(`/apps/${n}/users/${encodeURIComponent(t)}/sessions`,{method:"POST",headers:{"Content-Type":"application/json"},body:"{}"},r);if(!s.ok){const a=`创建会话失败 (${s.status})`,o=await wn(s,"创建会话失败");throw new Error(o===a?a:`${a}:${o}`)}return(await s.json()).id}async function Uw(e,t){const{app:n,ep:r}=zn(e),s=await ht(`/apps/${n}/users/${encodeURIComponent(t)}/sessions`,{},r);if(!s.ok)throw new Error(`list sessions failed: ${s.status}`);return s.json()}async function Tm(e,t,n){const{app:r,ep:s}=zn(e),i=await ht(`/apps/${r}/users/${encodeURIComponent(t)}/sessions/${n}`,{},s);if(!i.ok)throw new Error(`get session failed: ${i.status}`);const a=await i.json();if(s.runtimeId){const o=UL(s.runtimeId,r,t,n);a.state={...$L()[o]??{},...a.state??{}}}return a}async function KL(e){const{app:t,ep:n}=zn(e.appName);if(!n.runtimeId)throw new Error("只有连接到 AgentKit Runtime 的会话支持反馈回流");const r=await ht("/web/evaluation/feedback",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({runtimeId:n.runtimeId,region:n.region??"cn-beijing",appName:t,userId:e.userId,sessionId:e.sessionId,eventId:e.eventId,rating:e.rating,comment:e.comment??""})},{},Dw);if(!r.ok)throw new Error(await wn(r,"提交反馈失败"));const s=await r.json(),i=UL(n.runtimeId,t,e.userId,e.sessionId);return xz(i,e.eventId,s),s}async function W1(e,t,n){const{app:r,ep:s}=zn(e),i=await ht(`/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 _z(e){const t=await ht("/web/media/capabilities");if(!t.ok)throw new Error(await wn(t,"media capabilities failed"));return t.json()}async function YL(e,t,n,r){const{app:s}=zn(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 ht("/web/media",{method:"POST",body:i},{},Dw);if(!a.ok)throw new Error(await wn(a,"文件上传失败"));return{...await a.json(),status:"ready"}}async function q1(e,t,n){const{app:r}=zn(e),s=`/web/media/${encodeURIComponent(r)}/${encodeURIComponent(t)}/${encodeURIComponent(n)}`,i=await ht(s,{method:"DELETE"});if(!i.ok&&i.status!==404)throw new Error(await wn(i,"media cleanup failed"))}function GL(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 Cp(e,t){const n=GL(t);if(!n)throw new Error("Invalid VeADK media URI");const r=await ht(n,{method:"DELETE"});if(!r.ok&&r.status!==404)throw new Error(await wn(r,"media cleanup failed"))}function WL(e,t){if(t.startsWith("data:")||t.startsWith("blob:")||/^https?:/.test(t))return t;const n=GL(t);if(!n)return t;const r=`${n}/content`;return xi(`${Ap}${r}`)}async function qL(e,t){const{app:n,ep:r}=zn(e),s=await ht(`/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}function $w(e){const t=n=>({id:String(n.id??""),kind:n.kind==="skill"?"skill":"tool",name:String(n.name??""),custom:n.custom===!0,description:typeof n.description=="string"?n.description:void 0,skillSourceId:typeof n.skill_source_id=="string"?n.skill_source_id:void 0,version:typeof n.version=="string"?n.version:void 0});return{schemaVersion:Number(e.schema_version??1),revision:Number(e.revision??0),tools:Array.isArray(e.tools)?e.tools.map(n=>t(n)):[],skills:Array.isArray(e.skills)?e.skills.map(n=>t(n)):[]}}function Hw(e,t,n){return`/harness/apps/${encodeURIComponent(e)}/users/${encodeURIComponent(t)}/sessions/${encodeURIComponent(n)}/capabilities`}async function XL(e,t,n){const{app:r,ep:s}=zn(e),i=await ht(Hw(r,t,n),{},s);if(!i.ok)throw new Error(await wn(i,"读取会话能力失败"));return $w(await i.json())}async function QL(e){const{ep:t}=zn(e),n=await ht("/harness/capabilities/tools",{},t);if(!n.ok)throw new Error(await wn(n,"读取内置工具失败"));return((await n.json()).tools??[]).map(s=>{var i;return((i=s.name)==null?void 0:i.trim())??""}).filter(Boolean)}async function kz(e){const{ep:t}=zn(e),n=await ht("/harness/skills/spaces?region=all",{},t);if(!n.ok)throw new Error(await wn(n,"读取 Skill Space 失败"));return(await n.json()).items??[]}async function Nz(e,t,n){const{ep:r}=zn(e),s=new URLSearchParams({region:n||"cn-beijing"}),i=`/harness/skills/spaces/${encodeURIComponent(t)}/skills?${s.toString()}`,a=await ht(i,{},r);if(!a.ok)throw new Error(await wn(a,"读取 Skill 列表失败"));return(await a.json()).items??[]}async function ZL(e,t,n=1,r=20){const{ep:s}=zn(e),i=new URLSearchParams({query:t,page_number:String(n),page_size:String(r)}),a=await ht(`/harness/skills/findskill?${i.toString()}`,{},s);if(!a.ok)throw new Error(await wn(a,"搜索 Skill Hub 失败"));const o=await a.json();return{items:o.items??[],totalCount:Number(o.totalCount??0)}}async function JL(e,t,n,r,s){const{app:i,ep:a}=zn(e),o=await ht(Hw(i,t,n),{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({kind:r.kind,name:r.name,skill_source_id:r.skillSourceId,description:r.description,version:r.version,expected_revision:s})},a);if(!o.ok)throw new Error(await wn(o,"添加会话能力失败"));return $w(await o.json())}async function eM(e,t,n,r,s){const{app:i,ep:a}=zn(e),o=`${Hw(i,t,n)}/${encodeURIComponent(r)}?expected_revision=${s}`,c=await ht(o,{method:"DELETE"},a);if(!c.ok)throw new Error(await wn(c,"移除会话能力失败"));return $w(await c.json())}async function tM(e,t){const n=await ht(`/web/agent-info/${e}`,{},t);if(!n.ok)throw new Error(`agent-info failed: ${n.status}`);const r=await n.json();if(!r.draft)try{const s=await ht(`/web/agent-draft/${e}`,{},t);if(s.ok){const i=await s.json();r.draft=i.draft}}catch{}return{name:r.name??e,description:r.description??"",type:r.type,model:r.model??"",tools:r.tools??[],skillsPreviewSupported:Array.isArray(r.skills),skills:r.skills??[],subAgents:r.subAgents??[],components:r.components??[],searchSources:r.searchSources??[],graph:r.graph,draft:r.draft}}async function zw(e){const{app:t,ep:n}=zn(e);return tM(t,n)}async function nM(e,t){const n={runtimeId:e,region:t},s=(await jg("","",n))[0];if(!s)throw new Error("该 Runtime 未提供可预览的 Agent。");return tM(s,n)}async function rM(e,t,n,r){const{app:s,ep:i}=zn(e),a=new URLSearchParams({source:t,app_name:s,q:n,user_id:r}),o=await ht(`/web/search?${a.toString()}`,{},i);if(!o.ok)throw new Error(await wn(o,"Agent 检索失败"));return o.json()}async function sM(e,t){const{app:n}=zn(e),r=await ht(`/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*Xd({appName:e,userId:t,sessionId:n,text:r,attachments:s=[],invocation:i,functionResponses:a=[],signal:o,sessionCapabilities:c=!1}){const{app:u,ep:d}=zn(e),f=s.flatMap(y=>y.status&&y.status!=="ready"?[]:y.uri?[{fileData:{mimeType:y.mimeType,fileUri:y.uri,displayName:y.name},partMetadata:{veadkMedia:{id:y.id,uri:y.uri,name:y.name,mimeType:y.mimeType,sizeBytes:y.sizeBytes}}}]:y.data?[{inlineData:{mimeType:y.mimeType,data:y.data,displayName:y.name}}]:[]),h=i&&(i.skills.length>0||i.targetAgent)?i:void 0,p=[...f,...a.map(y=>({functionResponse:{id:y.id,name:y.name,response:y.response}})),...r.trim()?[{text:r}]:[]];if(h&&p.length>0){const y=p[0],E=y.partMetadata;p[0]={...y,partMetadata:{...E,veadkInvocation:h}}}const m=await ht(c?"/harness/run_sse":"/run_sse",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({app_name:u,user_id:t,session_id:n,new_message:{role:"user",parts:p},streaming:!0,custom_metadata:h?{veadkInvocation:h}:void 0}),signal:o},d,0);if(!m.ok)throw new Error(Dh(`run_sse failed: ${m.status}`));for await(const y of Bw(m)){const E=y;typeof E.error=="string"&&(E.error=Dh(E.error)),typeof E.errorMessage=="string"&&(E.errorMessage=Dh(E.errorMessage)),typeof E.error_message=="string"&&(E.error_message=Dh(E.error_message)),yield E}}const ud=new Map;async function Dg(e,t,n,r){var u,d,f;const s=r==null?void 0:r.taskId,i=s?new AbortController:void 0;s&&i&&ud.set(s,i);const a=()=>{s&&ud.get(s)===i&&ud.delete(s)};let o;try{(u=r==null?void 0:r.onStage)==null||u.call(r,{level:"info",phase:"upload",message:"正在上传代码包",pct:0}),o=await ht("/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,runtimeId:r==null?void 0:r.runtimeId,description:r==null?void 0:r.description,im:r==null?void 0:r.im,envs:r==null?void 0:r.envs})},{},0),(d=r==null?void 0:r.onStage)==null||d.call(r,{level:"success",phase:"upload",message:"代码包上传完成",pct:100})}catch(h){throw a(),h}if(!o.ok){const h=await o.text().catch(()=>"");throw a(),new Error(h||`部署失败 (${o.status})`)}let c=null;try{for await(const h of Bw(o)){const p=h;if(p&&p.done){c=p;break}p&&p.message&&((f=r==null?void 0:r.onStage)==null||f.call(r,p))}}catch(h){throw a(),h}if(a(),!c)throw new Error("部署失败:连接中断");if(!c.success)throw new Error(c.error||"部署失败");if(!c.agentName)throw new Error("部署失败:返回缺少 Agent 名称");if(!c.runtimeId&&!c.url)throw new Error("部署失败:返回缺少 AgentKit 连接信息");return{apikey:c.apikey??"",url:c.url??"",agentName:c.agentName,runtimeId:c.runtimeId,consoleUrl:c.consoleUrl,region:c.region,version:c.version,feishuChannel:c.feishuChannel}}async function iM(e){var n;const t=await ht("/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=ud.get(e))==null||n.abort(),ud.delete(e)}async function Sz(e="cn-beijing"){const t=await ht(`/web/my-runtimes?region=${encodeURIComponent(e)}`);if(!t.ok)throw new Error(`加载失败 (${t.status})`);return(await t.json()).runtimes??[]}const Qd={title:"VeADK Studio",logoUrl:""},vy={studio:!1,version:"",branding:Qd,features:{newChat:!0,search:!0,skillCenter:!0,history:!0,addAgent:!0,manageAgents:!0,addAgentkit:!0,generatedAgentTestRun:!0},defaultView:"chat",agentsSource:"local"};async function aM(){var e,t;try{const n=await ht("/web/ui-config");if(!n.ok)return vy;const r=await n.json(),s=typeof((e=r.branding)==null?void 0:e.logoUrl)=="string"?r.branding.logoUrl:Qd.logoUrl;return{studio:r.studio??!1,version:typeof r.version=="string"?r.version:"",branding:{title:typeof((t=r.branding)==null?void 0:t.title)=="string"?r.branding.title:Qd.title,logoUrl:s?xi(s):""},features:{...vy.features,...r.features??{}},defaultView:r.defaultView??"chat",agentsSource:r.agentsSource==="cloud"?"cloud":"local"}}catch{return vy}}const oM={role:"user",capabilities:{createAgents:!1,manageAgents:!1,runtimeScope:"mine"}};async function lM(){var n,r,s;const e=await ht("/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 cM(e,t){const n=new URLSearchParams;e&&n.set("targetVersion",e),t&&n.set("startedAt",String(t));const r=n.size?`?${n.toString()}`:"",s=await ht(`/web/studio-update${r}`);if(!s.ok)throw new Error(`检查 Studio 更新失败 (${s.status})`);return await s.json()}async function uM(e){const t=await ht("/web/studio-update",{method:"POST",headers:{"Content-Type":"application/json","X-VeADK-Studio-Update":"1"},body:JSON.stringify({version:e})},{},Dw);if(!t.ok){let n="";try{const r=await t.json();n=typeof r.detail=="string"?r.detail:""}catch{n=""}throw new Error(n||`提交 Studio 更新失败 (${t.status})`)}return await t.json()}async function dd(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 ht(`/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 dM(e,t="cn-beijing"){try{return await jg("","",{runtimeId:e,region:t})}catch(n){if(n instanceof Tf||n instanceof qd)throw n;return null}}async function fM(e,t="cn-beijing"){const n=await ht("/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 Vw(e,t="cn-beijing"){const n=await ht(`/web/runtime-detail?runtimeId=${encodeURIComponent(e)}®ion=${encodeURIComponent(t)}`);if(!n.ok)throw new Error(await wn(n,"加载 Runtime 详情失败"));return n.json()}async function Kw(e){const t=await ht("/web/generated-agent-projects",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({draft:e})});if(!t.ok)throw new Error(await wn(t,"生成项目失败"));return t.json()}const Tz=19e4;async function hM(e){const t=await ht("/web/generated-agent-drafts",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({requirement:e})},{},Tz);if(!t.ok)throw new Error(await wn(t,"生成 Agent 配置失败"));return Pw(t,"生成 Agent 配置失败")}async function pM(e){const t=await ht("/web/generated-agent-test-runs",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({draft:e})});if(!t.ok)throw new Error(await wn(t,"创建调试运行失败"));return Pw(t,"创建调试运行失败")}async function mM(e,t){const n=await ht(`/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 wn(n,"创建调试会话失败"));return(await Pw(n,"创建调试会话失败")).id}async function*gM({runId:e,userId:t,sessionId:n,text:r,signal:s}){const i=r.trim()?[{text:r}]:[],a=await ht(`/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 wn(a,"调试运行失败"));for await(const o of Bw(a))yield o}async function Hu(e){const t=await ht(`/web/generated-agent-test-runs/${e}`,{method:"DELETE"});if(!t.ok&&t.status!==404)throw new Error(await wn(t,"清理调试运行失败"))}const Az=Object.freeze(Object.defineProperty({__proto__:null,DEFAULT_SITE_BRANDING:Qd,DEFAULT_STUDIO_ACCESS:oM,RuntimeAccessDeniedError:Tf,RuntimeProbeError:qd,addSessionCapability:JL,cancelAgentkitDeployment:iM,clearRemoteApps:zL,componentSearch:rM,createGeneratedAgentTestRun:pM,createGeneratedAgentTestSession:mM,createSession:Sm,deleteGeneratedAgentTestRun:Hu,deleteMedia:Cp,deleteRuntime:fM,deleteSession:W1,deleteSessionMedia:q1,deployAgentkitProject:Dg,fetchRemoteApps:jg,generateAgentDraftFromRequirement:hM,generateAgentProject:Kw,getAgentInfo:zw,getMediaCapabilities:_z,getMyRuntimes:Sz,getRuntimeAgentInfo:nM,getRuntimeDetail:Vw,getRuntimes:dd,getSession:Tm,getSessionCapabilities:XL,getSessionTrace:qL,getStudioAccess:lM,getStudioUpdateStatus:cM,getUiConfig:aM,listApps:VL,listSessionBuiltinTools:QL,listSessionSkillSpaces:kz,listSessionSkillsInSpace:Nz,listSessions:Uw,mediaContentUrl:WL,probeRuntimeApps:dM,registerRemoteApp:HL,removeSessionCapability:eM,runGeneratedAgentTestSSE:gM,runSSE:Xd,searchSessionPublicSkills:ZL,startStudioUpdate:uM,submitMessageFeedback:KL,uploadMedia:YL,webSearch:sM},Symbol.toStringTag,{value:"Module"})),Cz="send_a2ui_json_to_client",Iz="validated_a2ui_json",X1="adk_request_credential",yS="transfer_to_agent";function Oz(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 zs(){return{blocks:[],liveStart:0}}const bS=e=>e.functionCall??e.function_call,Q1=e=>e.functionResponse??e.function_response;function Rz(e){if(!e||typeof e!="object")return"";const t=e,n=t.agentName??t.agent_name;return typeof n=="string"?n:""}function Lz(e){return e.replace(/-/g,"+").replace(/_/g,"/")}function yM(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:Lz(o.data),name:o.displayName??o.display_name});continue}const c=r.fileData??r.file_data,u=(c==null?void 0:c.fileUri)??(c==null?void 0:c.file_uri);c&&u&&t.push({id:u,mimeType:c.mimeType??c.mime_type,uri:u,name:c.displayName??c.display_name})}return t}function Z1(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 Mz=new Set(["llm","sequential","parallel","loop","a2a"]);function jz(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(c=>{if(!c||typeof c!="object")return[];const u=c;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 c=o,u=c.type;typeof c.name=="string"&&typeof u=="string"&&Mz.has(u)&&Array.isArray(c.path)&&(a={name:c.name,description:typeof c.description=="string"?c.description:"",type:u,path:c.path.filter(d=>typeof d=="string")})}if(i.length>0||a)return{skills:i,targetAgent:a}}}function Dz(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 ES(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 Ph(e){for(const t of e)t.kind==="thinking"&&(t.done=!0)}function xc(e,t){var a,o,c,u;const n=e.blocks.map(d=>({...d}));let r=e.liveStart;const s=((a=t.content)==null?void 0:a.parts)??[],i=s.some(d=>bS(d)||Q1(d));if(t.partial&&!i){for(const d of s){const f=Z1(d);typeof f=="string"&&f&&ES(n,d.thought?"thinking":"text",f)}return{blocks:n,liveStart:r}}n.length=r;for(const d of s){const f=bS(d),h=Q1(d),p=yM([d]),m=Z1(d);if(typeof m=="string"&&m)ES(n,d.thought?"thinking":"text",m);else if(p.length)Ph(n),Dz(n,p);else if(f)if(Ph(n),f.name===yS){const y=Rz(f.args)||((o=t.actions)==null?void 0:o.transferToAgent)||((c=t.actions)==null?void 0:c.transfer_to_agent)||"未知 Agent";n.push({kind:"agent-transfer",agentName:y,done:!1})}else if(f.name===X1){const y=f.args??{},E=y.authConfig??y.auth_config??y,x=String(y.functionCallId??y.function_call_id??"").replace(/^_adk_toolset_auth_/,"")||void 0;n.push({kind:"auth",callId:f.id??"",label:x,authUri:Oz(E),authConfig:E,done:!1})}else n.push({kind:"tool",name:f.name??"",args:f.args,done:!1});else if(h){if(Ph(n),h.name===yS)for(let y=n.length-1;y>=0;y--){const E=n[y];if(E.kind==="agent-transfer"&&!E.done){E.done=!0;break}}if(h.name===X1)for(let y=n.length-1;y>=0;y--){const E=n[y];if(E.kind==="auth"&&!E.done){E.done=!0;break}}for(let y=n.length-1;y>=0;y--){const E=n[y];if(E.kind==="tool"&&!E.done&&E.name===h.name){E.done=!0,E.response=h.response;break}}if(h.name===Cz){const y=((u=h.response)==null?void 0:u[Iz])??[];if(y.length){const E=n[n.length-1];E&&E.kind==="a2ui"?E.messages.push(...y):n.push({kind:"a2ui",messages:y})}}}}return Ph(n),r=n.length,{blocks:n,liveStart:r}}function Pz(e,t={}){var s,i;const n=[];let r=zs();for(const a of e)if(a.author==="user"){const c=((s=a.content)==null?void 0:s.parts)??[];if(c.some(p=>{var m;return((m=Q1(p))==null?void 0:m.name)===X1})){for(let p=n.length-1;p>=0;p--)if(n[p].role==="assistant"){for(let m=n[p].blocks.length-1;m>=0;m--){const y=n[p].blocks[m];if(y.kind==="auth"){y.done=!0;break}}break}}const u=c.map(Z1).filter(p=>!!p).join(""),d=yM(c),f=jz(c);if(!u&&!d.length&&!f){r=zs();continue}const h=[];f&&h.push({kind:"invocation",value:f}),d.length&&h.push({kind:"attachment",files:d}),u&&h.push({kind:"text",text:u}),n.push({role:"user",blocks:h,meta:{ts:a.timestamp}}),r=zs()}else{const c=a.author??"";let u=n[n.length-1];(!u||u.role!=="assistant"||c&&((i=u.meta)==null?void 0:i.author)!==c)&&(u={role:"assistant",blocks:[],meta:{author:c||void 0}},n.push(u),r=zs()),r=xc(r,a),u.blocks=r.blocks;const d=a.usageMetadata??a.usage_metadata,f=u.meta??(u.meta={});c&&(f.author=c),d!=null&&d.totalTokenCount&&(f.tokens=d.totalTokenCount),a.timestamp&&(f.ts=a.timestamp),a.id&&(f.eventId=a.id);const h=a.invocationId??a.invocation_id;h&&(f.invocationId=h)}for(const a of n){const o=a.meta,c=o==null?void 0:o.eventId;if(!c)continue;const u=t[`veadk_feedback:${c}`];if(!u||typeof u!="object")continue;const d=u;d.rating!=="good"&&d.rating!=="bad"||(o.feedback=u)}return n}function Bz(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"新会话"}const Fz=50,xS=48;function Uz(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 $z(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 Hz(e,t,n){const r=Math.max(0,t-xS),s=Math.min(e.length,t+n+xS);return(r>0?"…":"")+e.slice(r,s).trim()+(s{var c;if((c=o.events)!=null&&c.length)return o;try{return await Tm(t,e,o.id)}catch{return o}})),a=[];for(const o of i)for(const{text:c,role:u,ts:d}of Uz(o)){const f=c.toLowerCase().indexOf(r);if(f!==-1){a.push({type:"session",appId:t,sessionId:o.id,title:$z(o),snippet:Hz(c,f,r.length),role:u,ts:d??o.lastUpdateTime});break}}return a.sort((o,c)=>(c.ts??0)-(o.ts??0)),a.slice(0,Fz)}async function Vz(e,t){if(!e||!t.trim())return{results:[]};let n;try{n=await sM(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 Kz(e,t,n,r){if(!t||!r.trim())return{results:[]};const s=await rM(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 Yz(e,t,n){return e==="session"?{results:await zz(n.userId,n.appId,t)}:e==="web"?Vz(n.appId,t):Kz(e,n.appId,n.userId,t)}function bM({className:e="icon"}){return l.jsxs("svg",{className:e,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"1.7",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":!0,children:[l.jsx("path",{d:"M16.4 10.7a5.7 5.7 0 1 1-1.67-4.03"}),l.jsx("path",{d:"M15.25 15.25 19.6 19.6"})]})}function Gz({open:e}){return l.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:l.jsx("path",{d:"m3.25 4.75 2.75 2.5 2.75-2.5"})})}function Wz({onClick:e}){return l.jsxs("button",{className:"new-chat",onClick:e,"aria-label":"搜索",title:"搜索",children:[l.jsx(bM,{}),l.jsx("span",{className:"sidebar-nav-label",children:"搜索"})]})}function qz(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 Am(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 wS(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 Xz({userId:e,appId:t,agentInfo:n,capabilitiesLoading:r,agentLabel:s,onOpenSession:i}){var j,T;const[a,o]=w.useState("session"),[c,u]=w.useState(""),[d,f]=w.useState([]),[h,p]=w.useState(),[m,y]=w.useState(!1),[E,g]=w.useState(!1),[x,b]=w.useState(!1),_=w.useRef(0),k=w.useRef(null),N=qz(t,n,r),C=N.find(R=>R.id===a),S=a==="knowledge"?(j=n==null?void 0:n.components)==null?void 0:j.find(R=>R.source==="knowledgebase"||R.kind==="knowledgebase"):a==="memory"?(T=n==null?void 0:n.components)==null?void 0:T.find(R=>R.source==="long_term_memory"||R.kind==="memory"):void 0;w.useEffect(()=>{_.current+=1,o("session"),f([]),p(void 0),g(!1),y(!1),b(!1)},[t]),w.useEffect(()=>{if(!x)return;function R(M){var B;(B=k.current)!=null&&B.contains(M.target)||b(!1)}return document.addEventListener("pointerdown",R),()=>document.removeEventListener("pointerdown",R)},[x]);async function A(R,M){var G;const B=R.trim();if(!B||!((G=N.find(P=>P.id===M))!=null&&G.ready))return;const I=++_.current;y(!0),g(!0);let V;try{V=await Yz(M,B,{userId:e,appId:t})}catch(P){const ie=P instanceof Error?P.message:String(P);V={results:[],note:`搜索失败:${ie}`}}I===_.current&&(f(V.results),p(V.note),y(!1))}function O(R){_.current+=1,u(R),f([]),p(void 0),g(!1),y(!1)}function D(R){_.current+=1,o(R),b(!1),f([]),p(void 0),g(!1),y(!1)}const F=!!(C!=null&&C.ready),X=t?a==="web"?"在网络中检索":a==="knowledge"?`在 ${(S==null?void 0:S.name)??"当前 Agent 的知识库"} 中检索`:a==="memory"?`在 ${(S==null?void 0:S.name)??"当前用户的长期记忆"} 中检索`:"在当前 Agent 的会话中检索":"请先选择 Agent",L=S!=null&&S.backend?Am(S.backend):"";return l.jsxs("div",{className:"search",children:[l.jsxs("div",{className:"search-box",children:[l.jsxs("div",{className:"search-source-picker-wrap",ref:k,children:[l.jsxs("button",{className:"search-source-picker",type:"button","aria-label":`搜索类型:${(C==null?void 0:C.label)??"未选择"}`,"aria-haspopup":"listbox","aria-expanded":x,onClick:()=>b(R=>!R),children:[l.jsx("span",{children:(C==null?void 0:C.label)??"搜索类型"}),L&&l.jsx("small",{children:L}),l.jsx(Gz,{open:x})]}),x&&l.jsx("div",{className:"search-source-menu",role:"listbox","aria-label":"选择搜索类型",children:N.map(R=>{var I,V;const M=R.id==="knowledge"?(I=n==null?void 0:n.components)==null?void 0:I.find(G=>G.source==="knowledgebase"||G.kind==="knowledgebase"):R.id==="memory"?(V=n==null?void 0:n.components)==null?void 0:V.find(G=>G.source==="long_term_memory"||G.kind==="memory"):void 0,B=M?[M.name,M.backend?Am(M.backend):""].filter(Boolean).join(" · "):R.ready?R.description:R.unavailableLabel;return l.jsxs("button",{type:"button",role:"option","aria-selected":a===R.id,disabled:!R.ready,onClick:()=>D(R.id),children:[l.jsx("span",{children:R.label}),B&&l.jsx("small",{children:B})]},R.id)})})]}),l.jsx("span",{className:"search-box-divider","aria-hidden":!0}),l.jsx("input",{className:"search-input",value:c,onChange:R=>O(R.target.value),onKeyDown:R=>{R.key==="Enter"&&(R.preventDefault(),A(c,a))},placeholder:X,disabled:!F,autoFocus:!0}),l.jsx("button",{className:"search-go",onClick:()=>void A(c,a),disabled:!c.trim()||m,"aria-label":"搜索",children:m?l.jsx(Mt,{className:"icon spin"}):l.jsx(bM,{className:"icon"})})]}),l.jsx("div",{className:"search-results",children:F?E?m?null:h?l.jsx("div",{className:"search-empty",children:h}):d.length===0&&E?l.jsxs("div",{className:"search-empty",children:["未找到匹配「",c.trim(),"」的结果。"]}):d.map((R,M)=>l.jsx(Qz,{result:R,agentLabel:s,onOpen:i},M)):l.jsx("div",{className:"search-empty",children:a==="web"?"输入关键词后回车或点击按钮,通过 web_search 工具检索。":a==="knowledge"?"输入问题,检索当前 Agent 挂载的知识库。":a==="memory"?"输入线索,检索当前用户跨会话保存的长期记忆。":"输入关键词后回车或点击按钮,搜索当前 Agent 的会话。"}):l.jsx("div",{className:"search-empty",children:t?r?"正在读取当前 Agent 的检索能力…":(C==null?void 0:C.unavailableLabel)??"当前 Agent 未挂载该数据源":"选择一个 Agent 后,即可检索会话、网络及其挂载的数据源。"})})]})}function Qz({result:e,agentLabel:t,onOpen:n}){switch(e.type){case"session":return l.jsxs("button",{className:"search-result",onClick:()=>n(e.appId,e.sessionId),children:[l.jsx(LL,{className:"search-result-icon"}),l.jsxs("div",{className:"search-result-body",children:[l.jsxs("div",{className:"search-result-head",children:[l.jsx("span",{className:"search-result-title",children:e.title}),l.jsxs("span",{className:"search-result-meta",children:[t(e.appId),e.ts?` · ${wS(e.ts)}`:""]})]}),l.jsx("div",{className:"search-result-snippet",children:e.snippet})]})]});case"web":return l.jsxs("a",{className:"search-result",href:e.url||void 0,target:"_blank",rel:"noreferrer noopener",children:[l.jsx(Lg,{className:"search-result-icon"}),l.jsxs("div",{className:"search-result-body",children:[l.jsxs("div",{className:"search-result-head",children:[l.jsx("span",{className:"search-result-title",children:e.title||e.url}),l.jsxs("span",{className:"search-result-meta",children:[e.siteName,e.url&&l.jsx(Lw,{className:"search-result-ext"})]})]}),e.summary&&l.jsx("div",{className:"search-result-snippet",children:e.summary})]})]});case"knowledge":return l.jsxs("div",{className:"search-result search-result-static",children:[l.jsx(vS,{source:"knowledge"}),l.jsxs("div",{className:"search-result-body",children:[l.jsxs("div",{className:"search-result-head",children:[l.jsxs("span",{className:"search-result-title",children:["知识片段 ",e.index+1]}),l.jsxs("span",{className:"search-result-meta",children:[e.sourceName,e.sourceType?` · ${Am(e.sourceType)}`:""]})]}),l.jsx("div",{className:"search-result-snippet search-result-snippet-expanded",children:e.content})]})]});case"memory":return l.jsxs("div",{className:"search-result search-result-static",children:[l.jsx(vS,{source:"memory"}),l.jsxs("div",{className:"search-result-body",children:[l.jsxs("div",{className:"search-result-head",children:[l.jsxs("span",{className:"search-result-title",children:["记忆片段 ",e.index+1]}),l.jsxs("span",{className:"search-result-meta",children:[e.sourceName,e.sourceType?` · ${Am(e.sourceType)}`:"",e.ts?` · ${wS(e.ts)}`:""]})]}),l.jsx("div",{className:"search-result-snippet search-result-snippet-expanded",children:e.content})]})]});default:return null}}function vS({source:e,className:t="search-result-icon"}){return e==="knowledge"?l.jsxs("svg",{className:t,viewBox:"0 0 24 24",fill:"none","aria-hidden":!0,children:[l.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"}),l.jsx("path",{d:"M8.25 9h7.5M8.25 12.25h6"})]}):l.jsxs("svg",{className:t,viewBox:"0 0 24 24",fill:"none","aria-hidden":!0,children:[l.jsx("path",{d:"M12 4.5a7.5 7.5 0 1 0 7.5 7.5"}),l.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 Yw="/assets/volcengine-DM14a-L-.svg",_S="(max-width: 860px)";function Zz(){return l.jsxs("svg",{className:"icon sidebar-agent-face",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"1.7",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":!0,children:[l.jsx("rect",{x:"4.25",y:"5.25",width:"15.5",height:"13.5",rx:"4.75"}),l.jsx("path",{className:"sidebar-agent-face__eye sidebar-agent-face__eye--left",d:"M8.5 10.7v2"}),l.jsx("path",{className:"sidebar-agent-face__eye sidebar-agent-face__eye--right",d:"M15.5 10.7v2"})]})}function Jz(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 eV={admin:"管理员",developer:"开发者",user:"普通用户"};function kS({role:e}){const t=eV[e];return l.jsx("span",{className:`studio-role-badge studio-role-badge--${e}`,title:t,children:t})}function tV({version:e,onClose:t}){return w.useEffect(()=>{const n=r=>{r.key==="Escape"&&t()};return window.addEventListener("keydown",n),()=>window.removeEventListener("keydown",n)},[t]),Ns.createPortal(l.jsx("div",{className:"confirm-scrim",onMouseDown:t,children:l.jsxs("section",{className:"confirm-box system-info-dialog",role:"dialog","aria-modal":"true","aria-labelledby":"system-info-title",onMouseDown:n=>n.stopPropagation(),children:[l.jsxs("header",{className:"system-info-head",children:[l.jsx("h2",{id:"system-info-title",children:"系统信息"}),l.jsx("button",{type:"button",className:"icon-btn",onClick:t,"aria-label":"关闭系统信息",autoFocus:!0,children:l.jsx(Hr,{className:"icon","aria-hidden":"true"})})]}),l.jsx("dl",{className:"system-info-meta",children:l.jsxs("div",{children:[l.jsx("dt",{children:"当前版本"}),l.jsx("dd",{children:e||"—"})]})})]})}),document.body)}function nV({access:e,userInfo:t,version:n,onLogout:r}){const[s,i]=w.useState(!1),[a,o]=w.useState(!1),[c,u]=w.useState("");if(!t)return null;const d=hz(t),f=typeof t.email=="string"?t.email:"",h=(d||"U").slice(0,1).toUpperCase(),p=Jz(d||f||h),m=pz(t),y=m===c?"":m;return l.jsxs("div",{className:"sidebar-user",children:[l.jsxs("button",{className:"sidebar-user-btn",onClick:()=>i(E=>!E),title:f?`${d} +${f}`:d,children:[l.jsxs("span",{className:`account-avatar${y?" has-image":""}`,style:p,children:[h,y?l.jsx("img",{className:"account-avatar-image",src:y,alt:"","aria-hidden":"true",referrerPolicy:"no-referrer",onError:()=>u(y)}):null]}),l.jsxs("span",{className:"sidebar-user-identity",children:[l.jsxs("span",{className:"sidebar-user-primary",children:[l.jsx("span",{className:"sidebar-user-name",children:d}),l.jsx(kS,{role:e.role})]}),f&&f!==d&&l.jsx("span",{className:"sidebar-user-email",children:f})]})]}),s&&l.jsxs(l.Fragment,{children:[l.jsx("div",{className:"menu-scrim",onClick:()=>i(!1)}),l.jsxs("div",{className:"account-pop sidebar-user-pop",children:[l.jsxs("div",{className:"account-head",children:[l.jsxs("span",{className:`account-avatar account-avatar--lg${y?" has-image":""}`,style:p,children:[h,y?l.jsx("img",{className:"account-avatar-image",src:y,alt:"","aria-hidden":"true",referrerPolicy:"no-referrer",onError:()=>u(y)}):null]}),l.jsxs("div",{className:"account-id",children:[l.jsxs("div",{className:"account-name-row",children:[l.jsx("div",{className:"account-name",children:d}),l.jsx(kS,{role:e.role})]}),f&&f!==d&&l.jsx("div",{className:"account-sub",children:f})]})]}),l.jsxs("button",{type:"button",className:"account-action",onClick:()=>{i(!1),o(!0)},children:[l.jsx(Ya,{className:"icon"})," 系统信息"]}),l.jsxs("button",{type:"button",className:"account-action",onClick:()=>{i(!1),r()},children:[l.jsx(HH,{className:"icon"})," 退出登录"]})]})]}),a?l.jsx(tV,{version:n,onClose:()=>o(!1)}):null]})}function rV({branding:e,sessions:t,currentSessionId:n,features:r,access:s,streamingSids:i,onNewChat:a,onSearch:o,onQuickCreate:c,onSkillCenter:u,onAddAgent:d,onManageAgents:f,onPickSession:h,onDeleteSession:p,userInfo:m,version:y,onLogout:E}){const g=A=>(r==null?void 0:r[A])!==!1,[x,b]=w.useState(null),_=w.useRef(typeof window<"u"&&window.matchMedia(_S).matches),[k,N]=w.useState(_.current),C=[...t].sort((A,O)=>(O.lastUpdateTime??0)-(A.lastUpdateTime??0)),S=()=>{_.current=!1,N(A=>!A),b(null)};return w.useEffect(()=>{const A=window.matchMedia(_S),O=D=>{D.matches?N(F=>F||(_.current=!0,!0)):_.current&&(_.current=!1,N(!1))};return A.addEventListener("change",O),()=>A.removeEventListener("change",O)},[]),l.jsxs("aside",{className:`sidebar ${k?"is-collapsed":""}`,children:[l.jsxs("div",{className:"sidebar-top",children:[l.jsxs("div",{className:"sidebar-brand-row",children:[l.jsxs("button",{type:"button",className:"brand",onClick:a,"aria-label":"返回首页",title:"返回首页",children:[l.jsx("img",{className:"brand-logo",src:e.logoUrl||Yw,width:20,height:20,alt:"","aria-hidden":!0}),l.jsx("span",{className:"brand-title",children:e.title})]}),l.jsx("button",{type:"button",className:"sidebar-collapse-toggle",onClick:S,"aria-label":k?"展开侧边栏":"收起侧边栏",title:k?"展开侧边栏":"收起侧边栏",children:k?l.jsx(GH,{className:"icon"}):l.jsx(YH,{className:"icon"})})]}),g("newChat")&&l.jsxs("button",{className:"new-chat new-chat--conversation",onClick:a,"aria-label":"新会话",title:"新会话",children:[l.jsx(sr,{className:"icon"}),l.jsx("span",{className:"sidebar-nav-label",children:"新会话"})]}),l.jsxs("button",{className:"new-chat new-chat--agents",onClick:f,"aria-label":"智能体",title:"智能体",children:[l.jsx(Zz,{}),l.jsx("span",{className:"sidebar-nav-label",children:"智能体"})]}),g("search")&&l.jsx(Wz,{onClick:o})]}),g("history")&&l.jsxs("div",{className:"sidebar-history",children:[l.jsxs("div",{className:"history-head",children:[l.jsx("span",{children:"历史会话"}),g("newChat")&&l.jsx("button",{type:"button",className:"history-new-chat",onClick:a,"aria-label":"新建会话",title:"新建会话",children:l.jsx(sr,{className:"icon"})})]}),l.jsxs("div",{className:"history-list",children:[C.length===0&&l.jsx("div",{className:"history-empty",children:"暂无会话"}),C.map(A=>{const O=Bz(A.events);return l.jsxs("div",{className:`history-item ${A.id===n?"active":""}`,children:[l.jsxs("button",{className:"history-item-btn",onClick:()=>h(A.id),title:O,children:[(i==null?void 0:i.has(A.id))&&l.jsx("span",{className:"history-streaming",title:"正在生成…","aria-label":"正在生成"}),l.jsx("span",{className:"history-title",children:O})]}),l.jsx("button",{className:"history-more",title:"更多",onClick:()=>b(D=>D===A.id?null:A.id),children:l.jsx(NH,{className:"icon"})}),x===A.id&&l.jsxs(l.Fragment,{children:[l.jsx("div",{className:"menu-scrim",onClick:()=>b(null)}),l.jsx("div",{className:"history-menu",children:l.jsxs("button",{className:"menu-item menu-item--danger",onClick:()=>{b(null),p(A.id)},children:[l.jsx(ta,{className:"icon"})," 删除"]})})]})]},A.id)})]})]}),l.jsx(nV,{access:s,userInfo:m,version:y,onLogout:E})]})}const EM="veadk_agentkit_connections";function fs(){try{const e=localStorage.getItem(EM);return e?JSON.parse(e):[]}catch{return[]}}function Pg(e){try{localStorage.setItem(EM,JSON.stringify(e))}catch{}}function Mo(e,t){return`agentkit:${e}:${t}`}function xM(e){try{return new URL(e).host}catch{return e}}function Wc(e){zL();for(const t of e)for(const n of t.apps)HL(Mo(t.id,n),t.runtimeId?{app:n,runtimeId:t.runtimeId,region:t.region}:{app:n,base:t.base,apiKey:t.apiKey})}function wM(e,t,n,r,s,i){const a={id:`rt_${e}`,name:t||e,runtimeId:e,region:n,apps:r,appLabels:s,currentVersion:i},o=[...fs().filter(c=>c.runtimeId!==e),a];return Pg(o),Wc(o),a}async function Cm(e,t,n,r){let s;try{s=await dM(e,n)}catch(o){throw o instanceof Tf&&Im(e),o}if(!s||s.length===0)throw Im(e),new Error("该 Runtime 暂不支持连接,请确认服务已正常运行。");const i=Object.fromEntries(s.map(o=>[o,t])),a=wM(e,t,n,s,i,r);return Mo(a.id,s[0])}async function vM(e,t,n,r){const s=t.trim().replace(/\/+$/,""),i=await jg(s,n.trim()),a={id:Date.now().toString(36),name:e.trim()||xM(s),base:s,apiKey:n.trim(),apps:i,appLabels:r&&i.length>0?{[i[0]]:r}:void 0},o=[...fs().filter(c=>c.base!==s),a];return Pg(o),Wc(o),a}function sV(e){const t=fs().filter(n=>n.id!==e);return Pg(t),Wc(t),t}function Im(e){const t=fs().filter(n=>n.runtimeId!==e);return Pg(t),Wc(t),t}function _M(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:Mo(s.id,i),label:a,app:i,remote:!0,host:s.runtimeId?s.name:xM(s.base??""),runtimeId:s.runtimeId,region:s.region,currentVersion:s.currentVersion}}));return[...n,...r]}const NS=Object.freeze(Object.defineProperty({__proto__:null,addConnection:vM,addRuntimeConnection:wM,buildAgentEntries:_M,connectRuntime:Cm,loadConnections:fs,registerConnections:Wc,remoteAppId:Mo,removeConnection:sV,removeRuntimeConnection:Im},Symbol.toStringTag,{value:"Module"}));function wc({className:e="icon"}){return l.jsxs("svg",{className:e,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"1.8",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":!0,children:[l.jsx("path",{d:"m10.05 3.7 1.95-1.12 1.95 1.12"}),l.jsx("path",{d:"m16.25 5.03 3.9 2.25v4.5"}),l.jsx("path",{d:"M20.15 15.08v1.64l-3.9 2.25"}),l.jsx("path",{d:"m13.95 20.3-1.95 1.12-1.95-1.12"}),l.jsx("path",{d:"m7.75 18.97-3.9-2.25v-4.5"}),l.jsx("path",{d:"M3.85 8.92V7.28l3.9-2.25"}),l.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 J1({className:e="icon"}){return l.jsxs("svg",{className:e,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"1.7",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":!0,children:[l.jsx("path",{d:"M4.5 6.7h4.2M12.3 6.7h7.2"}),l.jsx("path",{d:"M4.5 12h8.2M16.3 12h3.2"}),l.jsx("path",{d:"M4.5 17.3h2.7M10.8 17.3h8.7"}),l.jsx("circle",{cx:"10.5",cy:"6.7",r:"1.8",fill:"currentColor",stroke:"none"}),l.jsx("circle",{cx:"14.5",cy:"12",r:"1.8",fill:"currentColor",stroke:"none"}),l.jsx("circle",{cx:"9",cy:"17.3",r:"1.8",fill:"currentColor",stroke:"none"})]})}function iV({className:e="icon"}){return l.jsx("svg",{className:e,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"1.7",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":!0,children:l.jsxs("g",{transform:"translate(0 2)",children:[l.jsx("path",{d:"M11.6 3.5c.45 3.75 2.75 6.05 6.5 6.5-3.75.45-6.05 2.75-6.5 6.5-.45-3.75-2.75-6.05-6.5-6.5 3.75-.45 6.05-2.75 6.5-6.5Z"}),l.jsx("path",{d:"M18.7 3.8v3.4M20.4 5.5H17"})]})})}function kM({className:e="icon"}){return l.jsxs("svg",{className:e,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"1.7",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":!0,children:[l.jsx("path",{d:"M18.7 8.15A7.55 7.55 0 0 0 5.35 7.1"}),l.jsx("path",{d:"m18.7 8.15-.2-3.05-3.02.3"}),l.jsx("path",{d:"M5.3 15.85A7.55 7.55 0 0 0 18.65 16.9"}),l.jsx("path",{d:"m5.3 15.85.2 3.05 3.02-.3"}),l.jsx("path",{d:"M6.85 12h2.8l1.4-2.9 1.9 5.8 1.42-2.9h2.78"})]})}const SS=15,aV=1e4,oV=[{value:"cn-beijing",label:"北京"},{value:"cn-shanghai",label:"上海"}];function lV(e){return e==="cn-beijing"?"北京":e==="cn-shanghai"?"上海":e}function NM(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 _y(e,t=aV){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 cV({open:e,onClose:t,variant:n="drawer",anchorTop:r=0,agentsSource:s,localApps:i,currentId:a,currentRuntime:o,runtimeScope:c,onSelect:u}){const[d,f]=w.useState([]),[h,p]=w.useState([""]),[m,y]=w.useState(0),[E,g]=w.useState(c==="mine"),[x,b]=w.useState(null),[_,k]=w.useState("cn-beijing"),[N,C]=w.useState(!1),[S,A]=w.useState(""),[O,D]=w.useState(""),[F,X]=w.useState(null),[L,j]=w.useState(new Set),[T,R]=w.useState(),[M,B]=w.useState("agent"),I=w.useRef(!1);function V(re){R(pe=>(pe==null?void 0:pe.runtimeId)===re.runtimeId?void 0:{runtimeId:re.runtimeId,name:re.name,region:re.region})}const G=w.useCallback(async re=>{if(d[re]){y(re);return}const pe=h[re];if(pe!==void 0){C(!0),A("");try{const ye=await _y(dd({nextToken:pe,pageSize:SS,region:_,scope:"all"}));f(J=>{const fe=[...J];return fe[re]=ye.runtimes,fe}),p(J=>{const fe=[...J];return ye.nextToken&&(fe[re+1]=ye.nextToken),fe}),y(re)}catch(ye){A(ye instanceof Error?ye.message:String(ye))}finally{C(!1)}}},[h,d,_]),P=w.useCallback(async()=>{C(!0),A("");try{const re=[];let pe="";do{const ye=await _y(dd({scope:"mine",nextToken:pe,pageSize:100,region:_}));re.push(...ye.runtimes),pe=ye.nextToken}while(pe&&re.length<2e3);b(re)}catch(re){A(re instanceof Error?re.message:String(re))}finally{C(!1)}},[_]);w.useEffect(()=>{g(c==="mine"),f([]),p([""]),y(0),b(null),I.current=!1},[c]),w.useEffect(()=>{e&&s==="cloud"&&!E&&!I.current&&(I.current=!0,G(0))},[e,s,E,G]),w.useEffect(()=>{E&&x===null&&s==="cloud"&&P()},[E,x,s,P]),w.useEffect(()=>{e&&(R(void 0),B("agent"))},[e]);function ie(){j(new Set),E?(b(null),P()):(f([]),p([""]),y(0),I.current=!0,C(!0),A(""),_y(dd({nextToken:"",pageSize:SS,region:_,scope:"all"})).then(re=>{f([re.runtimes]),p(re.nextToken?["",re.nextToken]:[""])}).catch(re=>A(re instanceof Error?re.message:String(re))).finally(()=>C(!1)))}function q(re){re!==_&&(k(re),f([]),p([""]),y(0),b(null),j(new Set),I.current=!1)}const ne=!E&&(d[m+1]!==void 0||h[m+1]!==void 0);function oe(re){X(re.runtimeId),Cm(re.runtimeId,re.name,re.region).then(pe=>{u(pe),t()}).catch(pe=>{if(pe instanceof Tf){A(pe.message);return}if(pe instanceof qd){pe.unsupported&&j(ye=>new Set(ye).add(re.runtimeId)),A(pe.message);return}j(ye=>new Set(ye).add(re.runtimeId))}).finally(()=>X(null))}if(!e)return null;const ce=(E?x??[]:d[m]??[]).filter(re=>O?re.name.toLowerCase().includes(O.toLowerCase()):!0);return l.jsxs(l.Fragment,{children:[n==="drawer"?l.jsx("div",{className:"menu-scrim",onClick:t}):null,l.jsxs("div",{className:`agentsel agentsel--${n}${T&&n==="drawer"?" has-detail":""}`,role:"dialog","aria-label":"选择 Agent",style:n==="drawer"?{top:r,height:`min(640px, calc(100dvh - ${r}px - 10px))`}:void 0,children:[l.jsxs("div",{className:"agentsel-main",children:[l.jsxs("div",{className:"agentsel-head",children:[l.jsxs("span",{className:"agentsel-title",children:[l.jsx(wc,{})," 选择 Agent"]}),l.jsxs("div",{className:"agentsel-head-actions",children:[s==="cloud"&&l.jsx("button",{className:"agentsel-refresh",onClick:ie,title:"刷新",disabled:N,children:l.jsx(K1,{className:`icon ${N?"spin":""}`})}),l.jsx("button",{className:"agentsel-refresh",onClick:t,title:"关闭",children:l.jsx(Hr,{className:"icon"})})]})]}),s==="local"?l.jsx("div",{className:"agentsel-body",children:i.length===0?l.jsx("div",{className:"agentsel-empty",children:"暂无本地 Agent。"}):l.jsx("ul",{className:"agentsel-list",children:i.map(re=>l.jsx("li",{children:l.jsxs("button",{className:`agentsel-item ${re===a?"active":""}`,onClick:()=>{u(re),t()},children:[l.jsx(wc,{}),l.jsx("span",{className:"agentsel-item-name",children:re})]})},re))})}):l.jsxs("div",{className:"agentsel-body agentsel-body--cloud",children:[l.jsxs("div",{className:"agentsel-tools",children:[l.jsxs("div",{className:"agentsel-search",children:[l.jsx(Wd,{className:"icon"}),l.jsx("input",{value:O,onChange:re=>D(re.target.value),placeholder:"搜索 Runtime 名称"})]}),l.jsx("div",{className:"agentsel-regions","aria-label":"按部署地域筛选",children:oV.map(re=>l.jsx("button",{type:"button",className:_===re.value?"active":"","aria-pressed":_===re.value,onClick:()=>q(re.value),children:re.label},re.value))}),c==="all"&&l.jsxs("label",{className:"agentsel-mine",children:[l.jsx("input",{type:"checkbox",checked:E,onChange:re=>g(re.target.checked)}),"只看我创建的"]})]}),S&&l.jsx("div",{className:"agentsel-error",children:S}),l.jsxs("div",{className:"agentsel-listwrap",children:[ce.length===0&&!N?l.jsx("div",{className:"agentsel-empty",children:"暂无 Runtime。"}):l.jsx("ul",{className:"agentsel-list",children:ce.map(re=>{const pe=L.has(re.runtimeId),ye=F===re.runtimeId,J=(o==null?void 0:o.runtimeId)===re.runtimeId,fe=(T==null?void 0:T.runtimeId)===re.runtimeId;return l.jsx("li",{children:l.jsxs("div",{className:`agentsel-item agentsel-runtime-item ${J?"active":""} ${fe?"is-previewed":""}`,title:re.runtimeId,children:[l.jsx(kM,{}),l.jsxs("div",{className:"agentsel-item-main",children:[l.jsx("span",{className:"agentsel-item-name",title:re.name,children:re.name}),l.jsxs("div",{className:"agentsel-item-meta",children:[l.jsx("span",{className:`agentsel-status is-${pe?"bad":gV(re.status)}`,children:pe?"不支持":SM(re.status)}),re.isMine&&l.jsx("span",{className:"agentsel-badge",children:"我创建的"})]})]}),l.jsxs("div",{className:"agentsel-item-actions",children:[l.jsx("button",{type:"button",className:"agentsel-connect",disabled:ye||J,onClick:()=>oe(re),children:ye?"连接中…":J?"已连接":pe?"重试":"连接"}),n==="drawer"?l.jsx("button",{type:"button",className:`agentsel-info ${fe?"active":""}`,"aria-label":`查看 ${re.name} 信息`,"aria-pressed":fe,title:"查看信息",onClick:()=>V(re),children:l.jsx(Ya,{className:"icon"})}):null]})]})},re.runtimeId)})}),N&&l.jsxs("div",{className:"agentsel-loading",children:[l.jsx(Mt,{className:"icon spin"})," 加载中…"]})]}),l.jsxs("div",{className:"agentsel-pager",children:[l.jsx("button",{disabled:E||m===0||N,onClick:()=>void G(m-1),"aria-label":"上一页",children:l.jsx(wH,{className:"icon"})}),l.jsx("span",{className:"agentsel-pager-label",children:E?1:m+1}),l.jsx("button",{disabled:E||!ne||N,onClick:()=>void G(m+1),"aria-label":"下一页",children:l.jsx(xs,{className:"icon"})})]})]})]}),n==="drawer"&&s==="cloud"&&T&&l.jsx(hV,{runtime:T,tab:M,onTabChange:B})]})]})}const uV={knowledgebase:"知识库",memory:"记忆",prompt_manager:"提示词管理",example_store:"样例库",run_processor:"运行处理器",tracer:"链路追踪",toolset:"工具集",plugin:"插件",other:"其他"};function dV(e){return uV[e.toLowerCase()]??e}function fV(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 hV({runtime:e,tab:t,onTabChange:n}){return l.jsxs("section",{className:"agentsel-detail agentsel-preview","aria-label":"Agent 与 Runtime 信息",children:[l.jsx("div",{className:"agentsel-head agentsel-preview-head",children:l.jsxs("div",{className:`agentsel-detail-tabs is-${t}`,role:"tablist","aria-label":"详情类型",children:[l.jsx("span",{className:"agentsel-detail-tabs-slider","aria-hidden":!0}),l.jsx("button",{id:"agentsel-agent-tab",type:"button",role:"tab","aria-selected":t==="agent","aria-controls":"agentsel-agent-panel",onClick:()=>n("agent"),children:"Agent 信息"}),l.jsx("button",{id:"agentsel-runtime-tab",type:"button",role:"tab","aria-selected":t==="runtime","aria-controls":"agentsel-runtime-panel",onClick:()=>n("runtime"),children:"Runtime 信息"})]})}),l.jsx("div",{id:"agentsel-agent-panel",className:"agentsel-tab-panel",role:"tabpanel","aria-labelledby":"agentsel-agent-tab",hidden:t!=="agent",children:l.jsx(pV,{runtime:e})}),l.jsx("div",{id:"agentsel-runtime-panel",className:"agentsel-tab-panel",role:"tabpanel","aria-labelledby":"agentsel-runtime-tab",hidden:t!=="runtime",children:l.jsx(mV,{runtime:e})})]})}function pV({runtime:e}){const[t,n]=w.useState(null),[r,s]=w.useState(!0),[i,a]=w.useState(""),o=e.runtimeId,c=e.region;w.useEffect(()=>{let d=!0;return n(null),s(!0),a(""),nM(o,c).then(f=>d&&n(f)).catch(f=>{if(!d)return;const h=f instanceof Error?f.message:String(f);a(NM(h))}).finally(()=>d&&s(!1)),()=>{d=!1}},[o,c]);const u=(t==null?void 0:t.components)??[];return l.jsx("div",{className:"agentsel-detail-body",children:r?l.jsxs("div",{className:"agentsel-panel-state",children:[l.jsx(Mt,{className:"icon spin"})," 读取 Agent 信息…"]}):i?l.jsxs("div",{className:"agentsel-panel-empty",children:[l.jsx("span",{children:"暂时无法读取 Agent 信息"}),l.jsx("small",{title:i,children:i})]}):t?l.jsxs(l.Fragment,{children:[l.jsxs("div",{className:"agentsel-identity",children:[l.jsx(wc,{className:"agentsel-identity-icon"}),l.jsxs("div",{className:"agentsel-identity-copy",children:[l.jsx("strong",{title:t.name,children:t.name||"未命名 Agent"}),t.model&&l.jsx("span",{title:t.model,children:t.model})]})]}),t.description&&l.jsxs("section",{className:"agentsel-info-section",children:[l.jsx("h3",{children:"描述"}),l.jsx("p",{className:"agentsel-description",title:t.description,children:t.description})]}),t.subAgents.length>0&&l.jsx(TS,{icon:l.jsx(ML,{className:"icon"}),title:"子 Agent",values:t.subAgents}),t.tools.length>0&&l.jsx(TS,{icon:l.jsx(J1,{}),title:"工具",values:t.tools}),l.jsxs("section",{className:"agentsel-info-section",children:[l.jsxs("h3",{children:[l.jsx(iV,{})," 技能"]}),t.skillsPreviewSupported?t.skills.length>0?l.jsx("div",{className:"agentsel-info-list",children:t.skills.map(d=>l.jsxs("div",{className:"agentsel-info-list-item",children:[l.jsx("strong",{title:d.name,children:d.name}),d.description&&l.jsx("span",{title:d.description,children:d.description})]},d.name))}):l.jsx("div",{className:"agentsel-info-empty",children:"未配置"}):l.jsx("div",{className:"agentsel-info-empty",children:"暂不支持预览"})]}),u.length>0&&l.jsxs("section",{className:"agentsel-info-section",children:[l.jsxs("h3",{children:[l.jsx(kL,{className:"icon"})," 挂载组件"]}),l.jsx("div",{className:"agentsel-info-list",children:u.map((d,f)=>l.jsxs("div",{className:"agentsel-info-list-item agentsel-component",children:[l.jsxs("div",{className:"agentsel-component-head",children:[l.jsx("strong",{title:d.name,children:d.name}),l.jsxs("span",{children:[dV(d.kind),d.backend?` · ${fV(d.backend)}`:""]})]}),d.description&&l.jsx("span",{title:d.description,children:d.description})]},`${d.kind}:${d.name}:${f}`))})]}),!t.description&&t.subAgents.length===0&&t.tools.length===0&&t.skillsPreviewSupported&&t.skills.length===0&&u.length===0&&l.jsx("div",{className:"agentsel-panel-empty",children:"暂无更多 Agent 配置信息。"})]}):null})}function TS({icon:e,title:t,values:n}){return l.jsxs("section",{className:"agentsel-info-section",children:[l.jsxs("h3",{children:[e,t]}),l.jsx("div",{className:"agentsel-chips",children:n.map((r,s)=>l.jsx("span",{className:"agentsel-chip",title:r,children:r},`${r}:${s}`))})]})}function mV({runtime:e}){const[t,n]=w.useState(null),[r,s]=w.useState(!0),[i,a]=w.useState(""),o=e.runtimeId,c=e.region;w.useEffect(()=>{let d=!0;return s(!0),a(""),n(null),Vw(o,c).then(f=>d&&n(f)).catch(f=>d&&a(NM(f instanceof Error?f.message:String(f)))).finally(()=>d&&s(!1)),()=>{d=!1}},[o,c]);const u=[];if(t){t.model&&u.push(["模型",t.model]),t.description&&u.push(["描述",t.description]),t.status&&u.push(["状态",SM(t.status)]),t.region&&u.push(["区域",lV(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 l.jsxs("div",{className:"agentsel-detail-body",children:[l.jsxs("div",{className:"agentsel-runtime-identity",children:[l.jsx(kM,{}),l.jsxs("div",{children:[l.jsx("strong",{title:e.name,children:e.name}),l.jsx("span",{title:e.runtimeId,children:e.runtimeId})]})]}),r?l.jsxs("div",{className:"agentsel-apps-note",children:[l.jsx(Mt,{className:"icon spin"})," 读取详情…"]}):i?l.jsx("div",{className:"agentsel-error",children:i}):t?l.jsxs(l.Fragment,{children:[l.jsx("dl",{className:"agentsel-kv",children:u.map(([d,f])=>l.jsxs("div",{className:"agentsel-kv-row",children:[l.jsx("dt",{children:d}),l.jsx("dd",{children:f})]},d))}),t.envs.length>0&&l.jsxs("div",{className:"agentsel-envs",children:[l.jsx("div",{className:"agentsel-envs-head",children:"环境变量"}),t.envs.map(d=>l.jsxs("div",{className:"agentsel-env",children:[l.jsx("span",{className:"agentsel-env-k",children:d.key}),l.jsx("span",{className:"agentsel-env-v",children:d.value})]},d.key))]})]}):null]})}function gV(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 yV={ready:"就绪",unreleased:"未发布",running:"运行中",active:"运行中",creating:"创建中",pending:"等待中",deploying:"部署中",updating:"更新中",failed:"失败",error:"异常",stopping:"停止中",stopped:"已停止",deleting:"删除中",deleted:"已删除"};function SM(e){const t=e.toLowerCase().replace(/[\s_-]/g,"");return yV[t]??(e||"-")}function bV({appName:e,onAppChange:t,agentLabel:n,agentsSource:r,localApps:s,currentRuntime:i,runtimeScope:a,title:o,titleLeading:c,crumbs:u,rightContent:d}){return l.jsxs("div",{className:"navbar",children:[l.jsxs("div",{className:"navbar-left",children:[l.jsx("div",{className:"navbar-default",children:u&&u.length>0?l.jsx("nav",{className:"navbar-crumbs","aria-label":"面包屑",children:u.map((f,h)=>l.jsxs(w.Fragment,{children:[h>0&&l.jsx(xs,{className:"crumb-sep"}),f.onClick?l.jsx("button",{className:"crumb crumb-link",onClick:f.onClick,children:f.label}):l.jsx("span",{className:"crumb crumb-current",children:f.label})]},h))}):o?l.jsxs("div",{className:"navbar-title-group",children:[c,l.jsx("div",{className:"navbar-title",title:o,children:o})]}):l.jsxs("div",{className:"navbar-title-group",children:[c,l.jsx(EV,{appName:e,onAppChange:t,agentLabel:n,agentsSource:r,localApps:s,currentRuntime:i,runtimeScope:a})]})}),l.jsx("div",{id:"veadk-page-header-left",className:"navbar-portal-slot"})]}),l.jsxs("div",{className:"navbar-right",children:[l.jsx("div",{id:"veadk-page-header-actions",className:"navbar-portal-actions"}),d]})]})}function EV({appName:e,onAppChange:t,agentLabel:n,agentsSource:r,localApps:s,currentRuntime:i,runtimeScope:a}){const[o,c]=w.useState(!1),u=f=>n?n(f):f;function d(){c(!1)}return l.jsxs("div",{className:"agent-dd",children:[l.jsxs("button",{className:"agent-dd-trigger",onClick:()=>c(f=>!f),children:[l.jsx("span",{className:"agent-dd-current",children:e?u(e):"选择 Agent"}),l.jsx(Cw,{className:`agent-dd-chev ${o?"open":""}`})]}),o&&l.jsxs(l.Fragment,{children:[l.jsx("div",{className:"menu-scrim",onClick:d}),l.jsx(cV,{open:!0,variant:"navbar",agentsSource:r,localApps:s,currentId:e,currentRuntime:i,runtimeScope:a,onSelect:f=>{t(f),d()},onClose:d})]})]})}async function Af(e){const t=await fetch(e,{headers:{accept:"application/json"},signal:Ws(void 0,Gc)});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 TM(){return(await Af("/web/skill-spaces?region=all")).items||[]}async function xV(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),Af(`/web/skill-spaces?${t.toString()}`)}async function AM(e,t){const n=t?`?region=${encodeURIComponent(t)}`:"";return(await Af(`/web/skill-spaces/${encodeURIComponent(e)}/skills${n}`)).items||[]}async function wV(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),Af(`/web/skill-spaces/${encodeURIComponent(e)}/skills?${n.toString()}`)}async function vV(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 Af(`/web/skill-spaces/${encodeURIComponent(e)}/skills/${encodeURIComponent(t)}${a}`)}function _V(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 kV(e,t){return`https://console.volcengine.com/agentkit/${(t||"cn-beijing")==="cn-beijing"?"cn":"cn-shanghai"}/skillspace/detail/${encodeURIComponent(e)}`}const NV="https://ark.cn-beijing.volces.com/api/v3/",Ip=[{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:NV}],vc=[],wu=[{key:"FEISHU_APP_ID",required:!0,placeholder:"cli_xxx",comment:"飞书应用 App ID"},{key:"FEISHU_APP_SECRET",required:!0,placeholder:"输入 App Secret",comment:"飞书应用 App Secret"}],qs={topK:"3",region:"cn-beijing",endpoint:"https://open.volcengineapi.com/"},CM=[{key:"REGISTRY_SPACE_ID",required:!0,placeholder:"请选择智能体中心",comment:"AgentKit 智能体中心"},{key:"REGISTRY_TOP_K",required:!1,placeholder:qs.topK,comment:"召回 Agent 数量"},{key:"REGISTRY_REGION",required:!1,placeholder:qs.region,comment:"AgentKit 智能体中心地域"},{key:"REGISTRY_ENDPOINT",required:!1,placeholder:qs.endpoint,comment:"AgentKit 智能体中心 OpenAPI 地址"}],_c=[{id:"web_search",label:"联网搜索",desc:"火山引擎 Web Search,获取实时信息。",importLine:"from veadk.tools.builtin_tools.web_search import web_search",toolNames:["web_search"],env:vc},{id:"parallel_web_search",label:"并行联网搜索",desc:"并行发起多条搜索查询,更快汇总。",importLine:"from veadk.tools.builtin_tools.parallel_web_search import parallel_web_search",toolNames:["parallel_web_search"],env:vc},{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:"run_code",label:"代码执行",desc:"在沙箱中执行代码",importLine:"from veadk.tools.builtin_tools.run_code import run_code",toolNames:["run_code"],env:[{key:"AGENTKIT_TOOL_ID",required:!0,placeholder:"t-xxxx",comment:"代码执行沙箱 ID"},{key:"AGENTKIT_TOOL_REGION",required:!1,placeholder:"cn-beijing",comment:"AgentKit Tools 地域"}]},{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"}]}],eE=[{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}]}],tE=[{id:"local",label:"本地向量库",desc:"进程内 llama-index 向量库。",env:Ip,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},...Ip],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},...Ip],pipExtra:"extensions",needsEmbedding:!0},{id:"viking",label:"VikingDB Memory",desc:"火山 VikingDB 记忆库(支持用户画像)。",env:vc},{id:"mem0",label:"Mem0",desc:"Mem0 托管记忆服务。",env:[{key:"DATABASE_MEM0_API_KEY",required:!0},{key:"DATABASE_MEM0_BASE_URL",required:!1}]}],kc="viking",nE=[{id:"viking",label:"VikingDB Knowledge",desc:"火山 VikingDB 知识库。",env:vc},{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},...Ip],pipExtra:"extensions",needsEmbedding:!0},{id:"context_search",label:"Context Search",desc:"火山 Context Search 引擎(无需向量化)。",env:[...vc,{key:"DATABASE_CONTEXT_SEARCH_ENGINE_ID",required:!0},{key:"DATABASE_CONTEXT_SEARCH_ENGINE_ENDPOINT",required:!0},{key:"DATABASE_CONTEXT_SEARCH_ENGINE_APIKEY",required:!0}]}],rE=[{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:[...vc,{key:"OBSERVABILITY_OPENTELEMETRY_TLS_SERVICE_NAME",required:!1,comment:"TLS topic_id,留空自动创建"}]}],SV={coding:"智能编程",get_city_weather:"城市天气查询",get_location_weather:"位置天气查询",web_fetch:"网页内容获取"};function sE(e){const t=_c.find(n=>n.id===e||n.toolNames.includes(e));return SV[e]??(t==null?void 0:t.label)??e}function AS(e){const t=_c.find(r=>r.id===e||r.toolNames.includes(e));return((t==null?void 0:t.desc)??"由 VeADK 提供的内置工具").replace(/[。.]+$/,"")}function TV(){return l.jsx("svg",{viewBox:"0 0 24 24",fill:"none","aria-hidden":"true",children:l.jsx("path",{d:"m7 7 10 10M17 7 7 17",stroke:"currentColor",strokeWidth:"1.7",strokeLinecap:"round"})})}function AV(){return l.jsxs("svg",{viewBox:"0 0 24 24",fill:"none","aria-hidden":"true",children:[l.jsx("circle",{cx:"10.8",cy:"10.8",r:"5.8",stroke:"currentColor",strokeWidth:"1.7"}),l.jsx("path",{d:"m15.2 15.2 4 4",stroke:"currentColor",strokeWidth:"1.7",strokeLinecap:"round"})]})}function CS(){return l.jsx("svg",{viewBox:"0 0 24 24",fill:"none","aria-hidden":"true",children:l.jsx("path",{d:"M12 5.5v13M5.5 12h13",stroke:"currentColor",strokeWidth:"1.7",strokeLinecap:"round"})})}function IM({title:e,description:t,icon:n,wide:r=!1,onClose:s,children:i}){const a=w.useRef(`session-capability-${Math.random().toString(36).slice(2)}`);return w.useEffect(()=>{const o=document.body.style.overflow;document.body.style.overflow="hidden";const c=u=>{u.key==="Escape"&&s()};return document.addEventListener("keydown",c),()=>{document.removeEventListener("keydown",c),document.body.style.overflow=o}},[s]),Ns.createPortal(l.jsxs("div",{className:"session-capability-dialog-layer",children:[l.jsx("button",{type:"button",className:"session-capability-dialog-scrim","aria-label":"关闭弹窗",onClick:s}),l.jsxs("section",{className:`session-capability-dialog${r?" is-wide":""}`,role:"dialog","aria-modal":"true","aria-labelledby":a.current,children:[l.jsxs("header",{className:`session-capability-dialog-head${n?"":" is-iconless"}`,children:[n&&l.jsx("span",{className:"session-capability-dialog-mark",children:n}),l.jsxs("div",{children:[l.jsx("h2",{id:a.current,children:e}),l.jsx("p",{children:t})]}),l.jsx("button",{type:"button",className:"session-capability-dialog-close","aria-label":`关闭${e}`,onClick:s,children:l.jsx(TV,{})})]}),i]})]}),document.body)}function Op({value:e,placeholder:t,label:n,onChange:r,autoFocus:s=!1}){return l.jsxs("label",{className:"session-capability-search",children:[l.jsx(AV,{}),l.jsx("input",{value:e,"aria-label":n,placeholder:t,autoFocus:s,onChange:i=>r(i.target.value)})]})}function CV({agentName:e,tools:t,selectedNames:n,mutating:r,onAdd:s,onClose:i}){const[a,o]=w.useState(""),[c,u]=w.useState(""),d=w.useMemo(()=>new Set(n),[n]),f=w.useMemo(()=>{const p=a.trim().toLowerCase();return t.filter(m=>p?`${sE(m)} ${m} ${AS(m)}`.toLowerCase().includes(p):!0)},[a,t]),h=async p=>{u(p);const m=await s({kind:"tool",name:p});u(""),m&&i()};return l.jsx(IM,{title:"添加内置工具",description:`添加后仅对 ${e} 的当前会话生效`,icon:l.jsx(J1,{}),onClose:i,children:l.jsxs("div",{className:"session-tool-dialog-body",children:[l.jsx(Op,{value:a,label:"搜索内置工具",placeholder:"搜索中文名称或工具标识",onChange:o,autoFocus:!0}),l.jsx("div",{className:"session-tool-picker",role:"list","aria-label":"可用内置工具",children:f.length===0?l.jsx("div",{className:"session-capability-empty",children:"没有匹配的内置工具"}):f.map(p=>{const m=d.has(p),y=c===p;return l.jsxs("article",{className:"session-tool-option",role:"listitem",children:[l.jsx("span",{className:"session-tool-option-icon",children:l.jsx(J1,{})}),l.jsxs("span",{className:"session-tool-option-copy",children:[l.jsx("strong",{children:sE(p)}),l.jsx("code",{children:p}),l.jsx("span",{children:AS(p)})]}),l.jsx("button",{type:"button",disabled:m||r||!!c,onClick:()=>void h(p),children:m?"已添加":y?"添加中…":"添加"})]},p)})})]})})}function IV({appName:e,agentName:t,selectedNames:n,mutating:r,onAdd:s,onClose:i}){const[a,o]=w.useState("public"),[c,u]=w.useState(""),[d,f]=w.useState([]),[h,p]=w.useState(0),[m,y]=w.useState(!0),[E,g]=w.useState(""),[x,b]=w.useState([]),[_,k]=w.useState(null),[N,C]=w.useState([]),[S,A]=w.useState(""),[O,D]=w.useState(""),[F,X]=w.useState(!0),[L,j]=w.useState(!1),[T,R]=w.useState(""),[M,B]=w.useState(""),I=w.useMemo(()=>new Set(n),[n]);w.useEffect(()=>{if(a!=="public")return;let q=!0;const ne=window.setTimeout(()=>{y(!0),g(""),ZL(e,c.trim()).then(oe=>{q&&(f(oe.items),p(oe.totalCount))}).catch(oe=>{q&&(f([]),p(0),g(oe instanceof Error?oe.message:"搜索 Skill Hub 失败"))}).finally(()=>{q&&y(!1)})},250);return()=>{q=!1,window.clearTimeout(ne)}},[e,c,a]),w.useEffect(()=>{if(a!=="agentkit")return;let q=!0;return X(!0),R(""),TM().then(ne=>{q&&(b(ne),k(ne[0]??null))}).catch(ne=>{q&&R(ne instanceof Error?ne.message:"读取 Skill Space 失败")}).finally(()=>{q&&X(!1)}),()=>{q=!1}},[a]),w.useEffect(()=>{if(a!=="agentkit")return;if(!_){C([]);return}let q=!0;return j(!0),R(""),AM(_.id,_.region).then(ne=>{q&&C(ne)}).catch(ne=>{q&&R(ne instanceof Error?ne.message:"读取技能失败")}).finally(()=>{q&&j(!1)}),()=>{q=!1}},[_,a]);const V=w.useMemo(()=>{const q=S.trim().toLowerCase();return q?x.filter(ne=>`${ne.name} ${ne.id} ${ne.description}`.toLowerCase().includes(q)):x},[S,x]),G=w.useMemo(()=>{const q=O.trim().toLowerCase();return q?N.filter(ne=>`${ne.skillName} ${ne.skillDescription}`.toLowerCase().includes(q)):N},[O,N]),P=async q=>{if(!_)return;B(q.skillId);const ne=await s({kind:"skill",name:q.skillName,skillSourceId:_.id,description:q.skillDescription,version:q.version});B(""),ne&&i()},ie=async q=>{B(q.slug);const ne=await s({kind:"skill",name:q.name,skillSourceId:`findskill:${q.slug}`,description:q.description,version:q.version||q.updatedAt});B(""),ne&&i()};return l.jsx(IM,{title:"添加技能",description:`从公域 Skill Hub 或 AgentKit Skill 中心添加到 ${t} 当前会话`,wide:!0,onClose:i,children:l.jsxs("div",{className:"session-skill-dialog-body",children:[l.jsxs("div",{className:"session-skill-source-tabs",role:"tablist","aria-label":"技能来源",children:[l.jsxs("button",{type:"button",role:"tab","aria-selected":a==="public",className:a==="public"?"is-active":"",onClick:()=>o("public"),children:["Skill Hub",l.jsx("span",{children:"公域"})]}),l.jsx("button",{type:"button",role:"tab","aria-selected":a==="agentkit",className:a==="agentkit"?"is-active":"",onClick:()=>o("agentkit"),children:"AgentKit Skill 中心"})]}),a==="public"?l.jsxs("section",{className:"session-public-skill-browser","aria-label":"Skill Hub 公域技能",children:[l.jsxs("div",{className:"session-public-skill-head",children:[l.jsx(Op,{value:c,label:"搜索 Skill Hub",placeholder:"搜索技能名称、用途或关键词",onChange:u,autoFocus:!0}),l.jsxs("span",{children:[h.toLocaleString()," 个公域技能"]})]}),l.jsx("div",{className:"session-public-skill-list",children:E?l.jsx("div",{className:"session-capability-error",children:E}):m?l.jsx("div",{className:"session-capability-loading",children:"正在搜索 Skill Hub…"}):d.length===0?l.jsx("div",{className:"session-capability-empty",children:"没有匹配的公域技能"}):d.map(q=>{const ne=I.has(q.name),oe=M===q.slug;return l.jsxs("article",{className:"session-skill-option session-public-skill-option",children:[l.jsxs("span",{className:"session-skill-option-copy",children:[l.jsx("strong",{children:q.name}),l.jsx("span",{children:q.description||"暂无描述"}),l.jsxs("small",{children:[q.sourceRepo||q.sourceType||"FindSkill",l.jsx("span",{"aria-hidden":"true",children:" · "}),q.downloadCount.toLocaleString()," 次下载",q.evaluationScore>0&&l.jsxs(l.Fragment,{children:[l.jsx("span",{"aria-hidden":"true",children:" · "}),q.evaluationScore.toFixed(1)," 分"]})]})]}),l.jsx("button",{type:"button",disabled:ne||r||!!M,onClick:()=>void ie(q),children:ne?"已添加":oe?"添加中…":l.jsxs(l.Fragment,{children:[l.jsx(CS,{}),"添加"]})})]},q.slug)})})]}):l.jsxs("div",{className:"session-skill-browser",children:[l.jsxs("section",{className:"session-skill-spaces","aria-label":"Skill Space 列表",children:[l.jsxs("div",{className:"session-skill-pane-head",children:[l.jsxs("div",{children:[l.jsx("strong",{children:"Skill Space"}),l.jsx("span",{children:x.length})]}),l.jsx(Op,{value:S,label:"搜索 Skill Space",placeholder:"搜索空间",onChange:A,autoFocus:!0})]}),l.jsx("div",{className:"session-skill-pane-list",children:F?l.jsx("div",{className:"session-capability-loading",children:"正在读取 Skill Space…"}):V.length===0?l.jsx("div",{className:"session-capability-empty",children:"没有匹配的 Skill Space"}):V.map(q=>l.jsx("button",{type:"button",className:`session-skill-space${(_==null?void 0:_.id)===q.id?" is-active":""}`,onClick:()=>{k(q),D("")},children:l.jsxs("span",{children:[l.jsx("strong",{children:q.name||q.id}),l.jsx("small",{children:q.description||q.id}),l.jsxs("em",{children:[q.skillCount??0," 个技能"]})]})},`${q.projectName??"default"}:${q.id}`))})]}),l.jsxs("section",{className:"session-skill-results","aria-label":"AgentKit Skill 列表",children:[l.jsxs("div",{className:"session-skill-pane-head",children:[l.jsxs("div",{children:[l.jsx("strong",{title:_==null?void 0:_.name,children:(_==null?void 0:_.name)||"选择 Skill Space"}),l.jsx("span",{children:N.length})]}),l.jsx(Op,{value:O,label:"搜索 AgentKit 技能",placeholder:"搜索技能名称或描述",onChange:D})]}),l.jsx("div",{className:"session-skill-pane-list",children:T?l.jsx("div",{className:"session-capability-error",children:T}):_?L?l.jsx("div",{className:"session-capability-loading",children:"正在读取技能…"}):G.length===0?l.jsx("div",{className:"session-capability-empty",children:"没有匹配的技能"}):G.map(q=>{const ne=I.has(q.skillName),oe=M===q.skillId;return l.jsxs("article",{className:"session-skill-option",children:[l.jsxs("span",{className:"session-skill-option-copy",children:[l.jsx("strong",{children:q.skillName}),l.jsx("span",{children:q.skillDescription||"暂无描述"}),l.jsxs("small",{children:["版本 ",q.version||"—"]})]}),l.jsx("button",{type:"button",disabled:ne||r||!!M,onClick:()=>void P(q),children:ne?"已添加":oe?"添加中…":l.jsxs(l.Fragment,{children:[l.jsx(CS,{}),"添加"]})})]},`${q.skillId}:${q.version}`)}):l.jsx("div",{className:"session-capability-empty",children:"选择一个 Skill Space 查看技能"})})]})]})]})})}function na({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 l.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})}const OV={llm:"LLM",sequential:"顺序",parallel:"并行",loop:"循环",a2a:"A2A"};function OM(e){return 1+e.children.reduce((t,n)=>t+OM(n),0)}function Nc(e){return e.id||e.name}function RV(e,t){const n=Nc(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 RM(e,t=!0){return{...e,id:Nc(e),name:RV(e,t),children:e.children.map(n=>RM(n,!1))}}function LM(e,t){t.set(Nc(e),e.name||Nc(e)),e.children.forEach(n=>LM(n,t))}function LV(e){return[...new Set(e.map(t=>t.trim()).filter(Boolean))]}function MV(e){return[...new Map(e.filter(t=>t.name.trim()).map(t=>[t.name.trim(),{...t,name:t.name.trim()}])).values()]}function MM({node:e,activeAgent:t,seen:n,path:r}){const s=Nc(e),i=!!s&&s===t,a=!!s&&!i&&r.has(s),o=!!s&&!i&&!a&&n.has(s);return l.jsxs("div",{className:"topo-branch",children:[l.jsxs("div",{className:`topo-node topo-type-${e.type} ${i?"is-active":""} ${a?"is-onpath":""} ${o?"is-done":""}`,title:e.description||e.name,children:[l.jsx(wc,{className:"topo-icon"}),l.jsx("span",{className:"topo-name",children:e.name||"未命名 Agent"}),l.jsx("span",{className:"topo-badge",children:OV[e.type]??"Agent"})]}),i&&e.type==="a2a"&&l.jsx("div",{className:"topo-remote",children:"远程执行中…"}),e.children.length>0&&l.jsx("div",{className:"topo-children",children:e.children.map(c=>l.jsx(MM,{node:c,activeAgent:t,seen:n,path:r},Nc(c)))})]})}function ky({title:e,count:t}){return l.jsxs("div",{className:"topo-module-title",children:[l.jsx("span",{className:"topo-module-label",title:e,children:e}),t!==void 0&&l.jsx("span",{className:"topo-section-count","aria-label":`${t} 项`,children:t})]})}function jM({appName:e,info:t,loading:n,activeAgent:r,seenAgents:s,execPath:i=[],variant:a="rail",capabilities:o=null,capabilityLoading:c=!1,capabilityMutating:u=!1,builtinTools:d=[],onAddCapability:f,onRemoveCapability:h}){const[p,m]=w.useState(null);if(n&&!t)return l.jsx("aside",{className:`topo is-loading${a==="drawer"?" is-drawer":""}`,"aria-label":"Agent 信息","aria-live":"polite",children:l.jsx(na,{as:"span",className:"topo-loading-label",duration:2.2,children:"正在读取 Agent 信息…"})});if(!t)return null;const y=RM(t.graph??{id:t.name,name:t.name,description:t.description,type:t.type??"llm",model:t.model,tools:t.tools,skills:t.skills,path:[t.name],mentionable:!1,children:[]}),E=(o==null?void 0:o.tools)??LV(t.tools).map(k=>({id:`base:tool:${k}`,kind:"tool",name:k,custom:!1})),g=(o==null?void 0:o.skills)??MV(t.skills).map(k=>({id:`base:skill:${k.name}`,kind:"skill",name:k.name,description:k.description,custom:!1})),x=!!(o&&f&&h),b=new Set(i),_=new Map;return LM(y,_),l.jsxs("aside",{className:`topo${a==="drawer"?" is-drawer":""}`,"aria-label":"Agent 信息与拓扑",children:[l.jsxs("section",{className:"topo-agent-card","aria-label":"Agent 信息",children:[l.jsxs("div",{className:"topo-agent-heading",children:[l.jsx("h2",{title:t.name,children:t.name||"未命名 Agent"}),t.model&&l.jsx("span",{title:t.model,children:t.model})]}),t.description&&l.jsx("p",{className:"topo-description",title:t.description,children:t.description})]}),l.jsxs("div",{className:"topo-module-stack",children:[l.jsxs("section",{className:"topo-module-card topo-tools-card","aria-label":"工具",children:[l.jsx(ky,{title:"工具",count:E.length}),l.jsx("div",{className:"topo-module-scroll topo-tools-scroll",role:"region","aria-label":"工具列表",tabIndex:0,children:E.length>0?l.jsx("div",{className:"topo-tool-list",children:E.map(k=>l.jsxs("div",{className:"topo-tool",title:k.name,children:[l.jsxs("span",{className:"topo-capability-title",children:[l.jsxs("span",{className:"topo-capability-copy",children:[l.jsx("span",{className:"topo-capability-name",children:sE(k.name)}),l.jsx("code",{children:k.name})]}),k.custom&&l.jsx("span",{className:"topo-custom-badge",children:"自定义"})]}),k.custom&&l.jsx("button",{type:"button",className:"topo-remove-capability","aria-label":`移除工具 ${k.name}`,title:"移除",disabled:u,onClick:()=>h==null?void 0:h(k.id),children:"×"})]},k.id))}):l.jsx("div",{className:"topo-empty",children:"未配置"})}),x&&l.jsx("div",{className:"topo-capability-add-dock",children:l.jsxs("button",{type:"button",className:"topo-capability-add-slot","aria-label":"添加内置工具",disabled:c||u,onClick:()=>m("tool"),children:[l.jsx("span",{"aria-hidden":"true",children:"+"}),l.jsx("span",{children:"在此对话中添加工具"})]})})]}),l.jsxs("section",{className:"topo-module-card topo-skills-card","aria-label":"技能",children:[l.jsx(ky,{title:"技能",count:t.skillsPreviewSupported?g.length:void 0}),l.jsx("div",{className:"topo-module-scroll topo-skills-scroll",role:"region","aria-label":"技能列表",tabIndex:0,children:t.skillsPreviewSupported?g.length>0?l.jsx("div",{className:"topo-skill-list",children:g.map(k=>l.jsxs("div",{className:"topo-skill",title:k.description||k.name,children:[l.jsxs("div",{className:"topo-skill-title",children:[l.jsx("span",{className:"topo-skill-name",children:k.name}),k.custom&&l.jsx("span",{className:"topo-custom-badge",children:"自定义"}),k.custom&&l.jsx("button",{type:"button",className:"topo-remove-capability","aria-label":`移除技能 ${k.name}`,title:"移除",disabled:u,onClick:()=>h==null?void 0:h(k.id),children:"×"})]}),k.description&&l.jsx("span",{className:"topo-skill-description",children:k.description})]},`${k.name}:${k.description}`))}):l.jsx("div",{className:"topo-empty",children:"未配置"}):l.jsx("div",{className:"topo-empty",children:"暂不支持预览"})}),x&&l.jsx("div",{className:"topo-capability-add-dock",children:l.jsxs("button",{type:"button",className:"topo-capability-add-slot","aria-label":"添加技能",disabled:c||u,onClick:()=>m("skill"),children:[l.jsx("span",{"aria-hidden":"true",children:"+"}),l.jsx("span",{children:"在此对话中添加技能"})]})})]}),l.jsxs("section",{className:"topo-module-card topo-topology","aria-label":"Agent 拓扑",children:[l.jsx(ky,{title:"拓扑",count:OM(y)}),l.jsxs("div",{className:"topo-module-scroll topo-topology-scroll",role:"region","aria-label":"Agent 拓扑列表",tabIndex:0,children:[i.length>1&&l.jsx("div",{className:"topo-path","aria-label":"执行路径",children:i.map((k,N)=>l.jsx("span",{className:"topo-path-seg",children:l.jsx("span",{className:N===i.length-1?"topo-path-name is-current":"topo-path-name",children:_.get(k)??k})},`${k}-${N}`))}),l.jsx("div",{className:"topo-tree",children:l.jsx(MM,{node:y,activeAgent:r,seen:s,path:b})})]})]})]}),p==="tool"&&f&&l.jsx(CV,{agentName:t.name,tools:d,selectedNames:E.map(k=>k.name),mutating:u,onAdd:f,onClose:()=>m(null)}),p==="skill"&&f&&l.jsx(IV,{appName:e,agentName:t.name,selectedNames:g.map(k=>k.name),mutating:u,onAdd:f,onClose:()=>m(null)})]})}function jV(){return l.jsx("svg",{className:"icon",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"1.8",strokeLinecap:"round","aria-hidden":"true",children:l.jsx("path",{d:"M6 6l12 12M18 6 6 18"})})}function DV({appName:e,info:t,loading:n,activeAgent:r,seenAgents:s,execPath:i,capabilities:a,capabilityLoading:o,capabilityMutating:c,builtinTools:u,onAddCapability:d,onRemoveCapability:f,onClose:h,returnFocusRef:p}){return w.useEffect(()=>{const m=document.body.style.overflow;document.body.style.overflow="hidden";const y=E=>{E.key==="Escape"&&h()};return document.addEventListener("keydown",y),()=>{var E;document.removeEventListener("keydown",y),document.body.style.overflow=m,(E=p.current)==null||E.focus()}},[h,p]),l.jsxs(l.Fragment,{children:[l.jsx("div",{className:"drawer-scrim agent-info-scrim",onClick:h}),l.jsxs("aside",{className:"drawer drawer--agent-info",role:"dialog","aria-modal":"true","aria-labelledby":"agent-info-drawer-title",children:[l.jsxs("header",{className:"drawer-head",children:[l.jsxs("div",{children:[l.jsx("div",{id:"agent-info-drawer-title",className:"drawer-title",children:"Agent 信息"}),l.jsx("div",{className:"drawer-sub",children:"能力与协作拓扑"})]}),l.jsx("button",{type:"button",className:"drawer-close",onClick:h,"aria-label":"关闭 Agent 信息",autoFocus:!0,children:l.jsx(jV,{})})]}),l.jsx("div",{className:"agent-info-drawer-body",children:t||n?l.jsx(jM,{appName:e,info:t,loading:n,activeAgent:r,seenAgents:s,execPath:i,capabilities:a,capabilityLoading:o,capabilityMutating:c,builtinTools:u,onAddCapability:d,onRemoveCapability:f,variant:"drawer"}):l.jsx("div",{className:"drawer-empty",children:"暂时无法读取 Agent 信息。"})})]})]})}function Vye(){}function IS(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 DM(e,t){const n={};return(e[e.length-1]===""?[...e,""]:e).join((n.padRight?" ":"")+","+(n.padLeft===!1?"":" ")).trim()}const PV=/[$_\p{ID_Start}]/u,BV=/[$_\u{200C}\u{200D}\p{ID_Continue}]/u,FV=/[-$_\u{200C}\u{200D}\p{ID_Continue}]/u,UV=/^[$_\p{ID_Start}][$_\u{200C}\u{200D}\p{ID_Continue}]*$/u,$V=/^[$_\p{ID_Start}][-$_\u{200C}\u{200D}\p{ID_Continue}]*$/u,PM={};function Kye(e){return e?PV.test(String.fromCodePoint(e)):!1}function Yye(e,t){const r=(t||PM).jsx?FV:BV;return e?r.test(String.fromCodePoint(e)):!1}function OS(e,t){return(PM.jsx?$V:UV).test(e)}const HV=/[ \t\n\f\r]/g;function zV(e){return typeof e=="object"?e.type==="text"?RS(e.value):!1:RS(e)}function RS(e){return e.replace(HV,"")===""}let Cf=class{constructor(t,n,r){this.normal=n,this.property=t,r&&(this.space=r)}};Cf.prototype.normal={};Cf.prototype.property={};Cf.prototype.space=void 0;function BM(e,t){const n={},r={};for(const s of e)Object.assign(n,s.property),Object.assign(r,s.normal);return new Cf(n,r,t)}function Zd(e){return e.toLowerCase()}class zr{constructor(t,n){this.attribute=n,this.property=t}}zr.prototype.attribute="";zr.prototype.booleanish=!1;zr.prototype.boolean=!1;zr.prototype.commaOrSpaceSeparated=!1;zr.prototype.commaSeparated=!1;zr.prototype.defined=!1;zr.prototype.mustUseProperty=!1;zr.prototype.number=!1;zr.prototype.overloadedBoolean=!1;zr.prototype.property="";zr.prototype.spaceSeparated=!1;zr.prototype.space=void 0;let VV=0;const ut=Ko(),Ln=Ko(),iE=Ko(),Ae=Ko(),Ht=Ko(),nc=Ko(),Wr=Ko();function Ko(){return 2**++VV}const aE=Object.freeze(Object.defineProperty({__proto__:null,boolean:ut,booleanish:Ln,commaOrSpaceSeparated:Wr,commaSeparated:nc,number:Ae,overloadedBoolean:iE,spaceSeparated:Ht},Symbol.toStringTag,{value:"Module"})),Ny=Object.keys(aE);class Gw extends zr{constructor(t,n,r,s){let i=-1;if(super(t,n),LS(this,"space",s),typeof r=="number")for(;++i4&&n.slice(0,4)==="data"&&qV.test(t)){if(t.charAt(4)==="-"){const i=t.slice(5).replace(MS,QV);r="data"+i.charAt(0).toUpperCase()+i.slice(1)}else{const i=t.slice(4);if(!MS.test(i)){let a=i.replace(WV,XV);a.charAt(0)!=="-"&&(a="-"+a),t="data"+a}}s=Gw}return new s(r,t)}function XV(e){return"-"+e.toLowerCase()}function QV(e){return e.charAt(1).toUpperCase()}const If=BM([FM,KV,HM,zM,VM],"html"),Ga=BM([FM,YV,HM,zM,VM],"svg");function jS(e){const t=String(e||"").trim();return t?t.split(/[ \t\n\r\f]+/g):[]}function KM(e){return e.join(" ").trim()}var Ww={},DS=/\/\*[^*]*\*+([^/*][^*]*\*+)*\//g,ZV=/\n/g,JV=/^\s*/,eK=/^(\*?[-#/*\\\w]+(\[[0-9a-z_-]+\])?)\s*/,tK=/^:\s*/,nK=/^((?:'(?:\\'|.)*?'|"(?:\\"|.)*?"|\([^)]*?\)|[^};])+)/,rK=/^[;\s]*/,sK=/^\s+|\s+$/g,iK=` +`,PS="/",BS="*",lo="",aK="comment",oK="declaration";function lK(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(ZV);y&&(n+=y.length);var E=m.lastIndexOf(iK);r=~E?m.length-E: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 c(m){var y=m.exec(e);if(y){var E=y[0];return s(E),e=e.slice(E.length),y}}function u(){c(JV)}function d(m){var y;for(m=m||[];y=f();)y!==!1&&m.push(y);return m}function f(){var m=i();if(!(PS!=e.charAt(0)||BS!=e.charAt(1))){for(var y=2;lo!=e.charAt(y)&&(BS!=e.charAt(y)||PS!=e.charAt(y+1));)++y;if(y+=2,lo===e.charAt(y-1))return o("End of comment missing");var E=e.slice(2,y-2);return r+=2,s(E),e=e.slice(y),r+=2,m({type:aK,comment:E})}}function h(){var m=i(),y=c(eK);if(y){if(f(),!c(tK))return o("property missing ':'");var E=c(nK),g=m({type:oK,property:FS(y[0].replace(DS,lo)),value:E?FS(E[0].replace(DS,lo)):lo});return c(rK),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 FS(e){return e?e.replace(sK,lo):lo}var cK=lK,uK=Kp&&Kp.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(Ww,"__esModule",{value:!0});Ww.default=fK;const dK=uK(cK);function fK(e,t){let n=null;if(!e||typeof e!="string")return n;const r=(0,dK.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 Fg={};Object.defineProperty(Fg,"__esModule",{value:!0});Fg.camelCase=void 0;var hK=/^--[a-zA-Z0-9_-]+$/,pK=/-([a-z])/g,mK=/^[^-]+$/,gK=/^-(webkit|moz|ms|o|khtml)-/,yK=/^-(ms)-/,bK=function(e){return!e||mK.test(e)||hK.test(e)},EK=function(e,t){return t.toUpperCase()},US=function(e,t){return"".concat(t,"-")},xK=function(e,t){return t===void 0&&(t={}),bK(e)?e:(e=e.toLowerCase(),t.reactCompat?e=e.replace(yK,US):e=e.replace(gK,US),e.replace(pK,EK))};Fg.camelCase=xK;var wK=Kp&&Kp.__importDefault||function(e){return e&&e.__esModule?e:{default:e}},vK=wK(Ww),_K=Fg;function oE(e,t){var n={};return!e||typeof e!="string"||(0,vK.default)(e,function(r,s){r&&s&&(n[(0,_K.camelCase)(r,t)]=s)}),n}oE.default=oE;var kK=oE;const NK=yf(kK),Ug=YM("end"),_i=YM("start");function YM(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 SK(e){const t=_i(e),n=Ug(e);if(t&&n)return{start:t,end:n}}function fd(e){return!e||typeof e!="object"?"":"position"in e||"type"in e?$S(e.position):"start"in e||"end"in e?$S(e):"line"in e||"column"in e?lE(e):""}function lE(e){return HS(e&&e.line)+":"+HS(e&&e.column)}function $S(e){return lE(e&&e.start)+"-"+lE(e&&e.end)}function HS(e){return e&&typeof e=="number"?e:1}class yr 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 c=r.indexOf(":");c===-1?i.ruleId=r:(i.source=r.slice(0,c),i.ruleId=r.slice(c+1))}if(!i.place&&i.ancestors&&i.ancestors){const c=i.ancestors[i.ancestors.length-1];c&&(i.place=c.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=fd(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}}yr.prototype.file="";yr.prototype.name="";yr.prototype.reason="";yr.prototype.message="";yr.prototype.stack="";yr.prototype.column=void 0;yr.prototype.line=void 0;yr.prototype.ancestors=void 0;yr.prototype.cause=void 0;yr.prototype.fatal=void 0;yr.prototype.place=void 0;yr.prototype.ruleId=void 0;yr.prototype.source=void 0;const qw={}.hasOwnProperty,TK=new Map,AK=/[A-Z]/g,CK=new Set(["table","tbody","thead","tfoot","tr"]),IK=new Set(["td","th"]),GM="https://github.com/syntax-tree/hast-util-to-jsx-runtime";function OK(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=FK(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=BK(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"?Ga:If,stylePropertyNameCase:t.stylePropertyNameCase||"dom",tableCellAlignToStyle:t.tableCellAlignToStyle!==!1},i=WM(s,e,void 0);return i&&typeof i!="string"?i:s.create(e,s.Fragment,{children:i||void 0},void 0)}function WM(e,t,n){if(t.type==="element")return RK(e,t,n);if(t.type==="mdxFlowExpression"||t.type==="mdxTextExpression")return LK(e,t);if(t.type==="mdxJsxFlowElement"||t.type==="mdxJsxTextElement")return jK(e,t,n);if(t.type==="mdxjsEsm")return MK(e,t);if(t.type==="root")return DK(e,t,n);if(t.type==="text")return PK(e,t)}function RK(e,t,n){const r=e.schema;let s=r;t.tagName.toLowerCase()==="svg"&&r.space==="html"&&(s=Ga,e.schema=s),e.ancestors.push(t);const i=XM(e,t.tagName,!1),a=UK(e,t);let o=Qw(e,t);return CK.has(t.tagName)&&(o=o.filter(function(c){return typeof c=="string"?!zV(c):!0})),qM(e,a,i,t),Xw(a,o),e.ancestors.pop(),e.schema=r,e.create(t,i,a,n)}function LK(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)}Jd(e,t.position)}function MK(e,t){if(t.data&&t.data.estree&&e.evaluater)return e.evaluater.evaluateProgram(t.data.estree);Jd(e,t.position)}function jK(e,t,n){const r=e.schema;let s=r;t.name==="svg"&&r.space==="html"&&(s=Ga,e.schema=s),e.ancestors.push(t);const i=t.name===null?e.Fragment:XM(e,t.name,!0),a=$K(e,t),o=Qw(e,t);return qM(e,a,i,t),Xw(a,o),e.ancestors.pop(),e.schema=r,e.create(t,i,a,n)}function DK(e,t,n){const r={};return Xw(r,Qw(e,t)),e.create(t,e.Fragment,r,n)}function PK(e,t){return t.value}function qM(e,t,n,r){typeof n!="string"&&n!==e.Fragment&&e.passNode&&(t.node=r)}function Xw(e,t){if(t.length>0){const n=t.length>1?t:t[0];n&&(e.children=n)}}function BK(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 FK(e,t){return n;function n(r,s,i,a){const o=Array.isArray(i.children),c=_i(r);return t(s,i,a,o,{columnNumber:c?c.column-1:void 0,fileName:e,lineNumber:c?c.line:void 0},void 0)}}function UK(e,t){const n={};let r,s;for(s in t.properties)if(s!=="children"&&qw.call(t.properties,s)){const i=HK(e,s,t.properties[s]);if(i){const[a,o]=i;e.tableCellAlignToStyle&&a==="align"&&typeof o=="string"&&IK.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 $K(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 Jd(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 Jd(e,t.position);else i=r.value===null?!0:r.value;n[s]=i}return n}function Qw(e,t){const n=[];let r=-1;const s=e.passKeys?new Map:TK;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?(es(e,e.length,0,t),e):t}const KS={}.hasOwnProperty;function ZM(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 Xs(e){return e.replace(/[\t\n\r ]+/g," ").replace(/^ | $/g,"").toLowerCase().toUpperCase()}const kr=Wa(/[A-Za-z]/),pr=Wa(/[\dA-Za-z]/),QK=Wa(/[#-'*+\--9=?A-Z^-~]/);function Om(e){return e!==null&&(e<32||e===127)}const cE=Wa(/\d/),ZK=Wa(/[\dA-Fa-f]/),JK=Wa(/[!-/:-@[-`{-~]/);function Ze(e){return e!==null&&e<-2}function $t(e){return e!==null&&(e<0||e===32)}function bt(e){return e===-2||e===-1||e===32}const $g=Wa(new RegExp("\\p{P}|\\p{S}","u")),jo=Wa(/\s/);function Wa(e){return t;function t(n){return n!==null&&n>-1&&e.test(String.fromCharCode(n))}}function Xc(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 vt(e,t,n,r){const s=r?r-1:Number.POSITIVE_INFINITY;let i=0;return a;function a(c){return bt(c)?(e.enter(n),o(c)):t(c)}function o(c){return bt(c)&&i++a))return;const C=t.events.length;let S=C,A,O;for(;S--;)if(t.events[S][0]==="exit"&&t.events[S][1].type==="chunkFlow"){if(A){O=t.events[S][1].end;break}A=!0}for(g(r),N=C;Nb;){const k=n[_];t.containerState=k[1],k[0].exit.call(t,e)}n.length=b}function x(){s.write([null]),i=void 0,s=void 0,t.containerState._closeFlow=void 0}}function sY(e,t,n){return vt(e,e.attempt(this.parser.constructs.document,t,n),"linePrefix",this.parser.constructs.disable.null.includes("codeIndented")?void 0:4)}function Sc(e){if(e===null||$t(e)||jo(e))return 1;if($g(e))return 2}function Hg(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};GS(f,-c),GS(h,c),a={type:c>1?"strongSequence":"emphasisSequence",start:f,end:{...e[r][1].end}},o={type:c>1?"strongSequence":"emphasisSequence",start:{...e[n][1].start},end:h},i={type:c>1?"strongText":"emphasisText",start:{...e[r][1].end},end:{...e[n][1].start}},s={type:c>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=ms(u,[["enter",e[r][1],t],["exit",e[r][1],t]])),u=ms(u,[["enter",s,t],["enter",a,t],["exit",a,t],["enter",i,t]]),u=ms(u,Hg(t.parser.constructs.insideSpan.null,e.slice(r+1,n),t)),u=ms(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=ms(u,[["enter",e[n][1],t],["exit",e[n][1],t]])):d=0,es(e,r-1,n-r+3,u),n=r+u.length-d-2;break}}for(n=-1;++n0&&bt(N)?vt(e,x,"linePrefix",i+1)(N):x(N)}function x(N){return N===null||Ze(N)?e.check(WS,y,_)(N):(e.enter("codeFlowValue"),b(N))}function b(N){return N===null||Ze(N)?(e.exit("codeFlowValue"),x(N)):(e.consume(N),b)}function _(N){return e.exit("codeFenced"),t(N)}function k(N,C,S){let A=0;return O;function O(j){return N.enter("lineEnding"),N.consume(j),N.exit("lineEnding"),D}function D(j){return N.enter("codeFencedFence"),bt(j)?vt(N,F,"linePrefix",r.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(j):F(j)}function F(j){return j===o?(N.enter("codeFencedFenceSequence"),X(j)):S(j)}function X(j){return j===o?(A++,N.consume(j),X):A>=a?(N.exit("codeFencedFenceSequence"),bt(j)?vt(N,L,"whitespace")(j):L(j)):S(j)}function L(j){return j===null||Ze(j)?(N.exit("codeFencedFence"),C(j)):S(j)}}}function gY(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 Ty={name:"codeIndented",tokenize:bY},yY={partial:!0,tokenize:EY};function bY(e,t,n){const r=this;return s;function s(u){return e.enter("codeIndented"),vt(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?c(u):Ze(u)?e.attempt(yY,a,c)(u):(e.enter("codeFlowValue"),o(u))}function o(u){return u===null||Ze(u)?(e.exit("codeFlowValue"),a(u)):(e.consume(u),o)}function c(u){return e.exit("codeIndented"),t(u)}}function EY(e,t,n){const r=this;return s;function s(a){return r.parser.lazy[r.now().line]?n(a):Ze(a)?(e.enter("lineEnding"),e.consume(a),e.exit("lineEnding"),s):vt(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):Ze(a)?s(a):n(a)}}const xY={name:"codeText",previous:vY,resolve:wY,tokenize:_Y};function wY(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&&vu(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),vu(this.left,t)}unshift(t){this.setCursor(0),this.right.push(t)}unshiftMany(t){this.setCursor(0),vu(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 s3(e,t,n,r,s,i,a,o,c){const u=c||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||Om(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||Ze(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||$t(g))?(e.exit("chunkString"),e.exit(o),e.exit(a),e.exit(r),t(g)):d999||p===null||p===91||p===93&&!c||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):Ze(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||Ze(p)||o++>999?(e.exit("chunkString"),d(p)):(e.consume(p),c||(c=!bt(p)),p===92?h:f)}function h(p){return p===91||p===92||p===93?(e.consume(p),o++,f):f(p)}}function a3(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,c):n(h)}function c(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),c(a)):h===null?n(h):Ze(h)?(e.enter("lineEnding"),e.consume(h),e.exit("lineEnding"),vt(e,u,"linePrefix")):(e.enter("chunkString",{contentType:"string"}),d(h))}function d(h){return h===a||h===null||Ze(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 hd(e,t){let n;return r;function r(s){return Ze(s)?(e.enter("lineEnding"),e.consume(s),e.exit("lineEnding"),n=!0,r):bt(s)?vt(e,r,n?"linePrefix":"lineSuffix")(s):t(s)}}const OY={name:"definition",tokenize:LY},RY={partial:!0,tokenize:MY};function LY(e,t,n){const r=this;let s;return i;function i(p){return e.enter("definition"),a(p)}function a(p){return i3.call(r,e,o,n,"definitionLabel","definitionLabelMarker","definitionLabelString")(p)}function o(p){return s=Xs(r.sliceSerialize(r.events[r.events.length-1][1]).slice(1,-1)),p===58?(e.enter("definitionMarker"),e.consume(p),e.exit("definitionMarker"),c):n(p)}function c(p){return $t(p)?hd(e,u)(p):u(p)}function u(p){return s3(e,d,n,"definitionDestination","definitionDestinationLiteral","definitionDestinationLiteralMarker","definitionDestinationRaw","definitionDestinationString")(p)}function d(p){return e.attempt(RY,f,f)(p)}function f(p){return bt(p)?vt(e,h,"whitespace")(p):h(p)}function h(p){return p===null||Ze(p)?(e.exit("definition"),r.parser.defined.push(s),t(p)):n(p)}}function MY(e,t,n){return r;function r(o){return $t(o)?hd(e,s)(o):n(o)}function s(o){return a3(e,i,n,"definitionTitle","definitionTitleMarker","definitionTitleString")(o)}function i(o){return bt(o)?vt(e,a,"whitespace")(o):a(o)}function a(o){return o===null||Ze(o)?t(o):n(o)}}const jY={name:"hardBreakEscape",tokenize:DY};function DY(e,t,n){return r;function r(i){return e.enter("hardBreakEscape"),e.consume(i),s}function s(i){return Ze(i)?(e.exit("hardBreakEscape"),t(i)):n(i)}}const PY={name:"headingAtx",resolve:BY,tokenize:FY};function BY(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"},es(e,r,n-r+1,[["enter",s,t],["enter",i,t],["exit",i,t],["exit",s,t]])),e}function FY(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||$t(d)?(e.exit("atxHeadingSequence"),o(d)):n(d)}function o(d){return d===35?(e.enter("atxHeadingSequence"),c(d)):d===null||Ze(d)?(e.exit("atxHeading"),t(d)):bt(d)?vt(e,o,"whitespace")(d):(e.enter("atxHeadingText"),u(d))}function c(d){return d===35?(e.consume(d),c):(e.exit("atxHeadingSequence"),o(d))}function u(d){return d===null||d===35||$t(d)?(e.exit("atxHeadingText"),o(d)):(e.consume(d),u)}}const UY=["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"],XS=["pre","script","style","textarea"],$Y={concrete:!0,name:"htmlFlow",resolveTo:VY,tokenize:KY},HY={partial:!0,tokenize:GY},zY={partial:!0,tokenize:YY};function VY(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 KY(e,t,n){const r=this;let s,i,a,o,c;return u;function u(P){return d(P)}function d(P){return e.enter("htmlFlow"),e.enter("htmlFlowData"),e.consume(P),f}function f(P){return P===33?(e.consume(P),h):P===47?(e.consume(P),i=!0,y):P===63?(e.consume(P),s=3,r.interrupt?t:I):kr(P)?(e.consume(P),a=String.fromCharCode(P),E):n(P)}function h(P){return P===45?(e.consume(P),s=2,p):P===91?(e.consume(P),s=5,o=0,m):kr(P)?(e.consume(P),s=4,r.interrupt?t:I):n(P)}function p(P){return P===45?(e.consume(P),r.interrupt?t:I):n(P)}function m(P){const ie="CDATA[";return P===ie.charCodeAt(o++)?(e.consume(P),o===ie.length?r.interrupt?t:F:m):n(P)}function y(P){return kr(P)?(e.consume(P),a=String.fromCharCode(P),E):n(P)}function E(P){if(P===null||P===47||P===62||$t(P)){const ie=P===47,q=a.toLowerCase();return!ie&&!i&&XS.includes(q)?(s=1,r.interrupt?t(P):F(P)):UY.includes(a.toLowerCase())?(s=6,ie?(e.consume(P),g):r.interrupt?t(P):F(P)):(s=7,r.interrupt&&!r.parser.lazy[r.now().line]?n(P):i?x(P):b(P))}return P===45||pr(P)?(e.consume(P),a+=String.fromCharCode(P),E):n(P)}function g(P){return P===62?(e.consume(P),r.interrupt?t:F):n(P)}function x(P){return bt(P)?(e.consume(P),x):O(P)}function b(P){return P===47?(e.consume(P),O):P===58||P===95||kr(P)?(e.consume(P),_):bt(P)?(e.consume(P),b):O(P)}function _(P){return P===45||P===46||P===58||P===95||pr(P)?(e.consume(P),_):k(P)}function k(P){return P===61?(e.consume(P),N):bt(P)?(e.consume(P),k):b(P)}function N(P){return P===null||P===60||P===61||P===62||P===96?n(P):P===34||P===39?(e.consume(P),c=P,C):bt(P)?(e.consume(P),N):S(P)}function C(P){return P===c?(e.consume(P),c=null,A):P===null||Ze(P)?n(P):(e.consume(P),C)}function S(P){return P===null||P===34||P===39||P===47||P===60||P===61||P===62||P===96||$t(P)?k(P):(e.consume(P),S)}function A(P){return P===47||P===62||bt(P)?b(P):n(P)}function O(P){return P===62?(e.consume(P),D):n(P)}function D(P){return P===null||Ze(P)?F(P):bt(P)?(e.consume(P),D):n(P)}function F(P){return P===45&&s===2?(e.consume(P),T):P===60&&s===1?(e.consume(P),R):P===62&&s===4?(e.consume(P),V):P===63&&s===3?(e.consume(P),I):P===93&&s===5?(e.consume(P),B):Ze(P)&&(s===6||s===7)?(e.exit("htmlFlowData"),e.check(HY,G,X)(P)):P===null||Ze(P)?(e.exit("htmlFlowData"),X(P)):(e.consume(P),F)}function X(P){return e.check(zY,L,G)(P)}function L(P){return e.enter("lineEnding"),e.consume(P),e.exit("lineEnding"),j}function j(P){return P===null||Ze(P)?X(P):(e.enter("htmlFlowData"),F(P))}function T(P){return P===45?(e.consume(P),I):F(P)}function R(P){return P===47?(e.consume(P),a="",M):F(P)}function M(P){if(P===62){const ie=a.toLowerCase();return XS.includes(ie)?(e.consume(P),V):F(P)}return kr(P)&&a.length<8?(e.consume(P),a+=String.fromCharCode(P),M):F(P)}function B(P){return P===93?(e.consume(P),I):F(P)}function I(P){return P===62?(e.consume(P),V):P===45&&s===2?(e.consume(P),I):F(P)}function V(P){return P===null||Ze(P)?(e.exit("htmlFlowData"),G(P)):(e.consume(P),V)}function G(P){return e.exit("htmlFlow"),t(P)}}function YY(e,t,n){const r=this;return s;function s(a){return Ze(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 GY(e,t,n){return r;function r(s){return e.enter("lineEnding"),e.consume(s),e.exit("lineEnding"),e.attempt(Of,t,n)}}const WY={name:"htmlText",tokenize:qY};function qY(e,t,n){const r=this;let s,i,a;return o;function o(I){return e.enter("htmlText"),e.enter("htmlTextData"),e.consume(I),c}function c(I){return I===33?(e.consume(I),u):I===47?(e.consume(I),k):I===63?(e.consume(I),b):kr(I)?(e.consume(I),S):n(I)}function u(I){return I===45?(e.consume(I),d):I===91?(e.consume(I),i=0,m):kr(I)?(e.consume(I),x):n(I)}function d(I){return I===45?(e.consume(I),p):n(I)}function f(I){return I===null?n(I):I===45?(e.consume(I),h):Ze(I)?(a=f,R(I)):(e.consume(I),f)}function h(I){return I===45?(e.consume(I),p):f(I)}function p(I){return I===62?T(I):I===45?h(I):f(I)}function m(I){const V="CDATA[";return I===V.charCodeAt(i++)?(e.consume(I),i===V.length?y:m):n(I)}function y(I){return I===null?n(I):I===93?(e.consume(I),E):Ze(I)?(a=y,R(I)):(e.consume(I),y)}function E(I){return I===93?(e.consume(I),g):y(I)}function g(I){return I===62?T(I):I===93?(e.consume(I),g):y(I)}function x(I){return I===null||I===62?T(I):Ze(I)?(a=x,R(I)):(e.consume(I),x)}function b(I){return I===null?n(I):I===63?(e.consume(I),_):Ze(I)?(a=b,R(I)):(e.consume(I),b)}function _(I){return I===62?T(I):b(I)}function k(I){return kr(I)?(e.consume(I),N):n(I)}function N(I){return I===45||pr(I)?(e.consume(I),N):C(I)}function C(I){return Ze(I)?(a=C,R(I)):bt(I)?(e.consume(I),C):T(I)}function S(I){return I===45||pr(I)?(e.consume(I),S):I===47||I===62||$t(I)?A(I):n(I)}function A(I){return I===47?(e.consume(I),T):I===58||I===95||kr(I)?(e.consume(I),O):Ze(I)?(a=A,R(I)):bt(I)?(e.consume(I),A):T(I)}function O(I){return I===45||I===46||I===58||I===95||pr(I)?(e.consume(I),O):D(I)}function D(I){return I===61?(e.consume(I),F):Ze(I)?(a=D,R(I)):bt(I)?(e.consume(I),D):A(I)}function F(I){return I===null||I===60||I===61||I===62||I===96?n(I):I===34||I===39?(e.consume(I),s=I,X):Ze(I)?(a=F,R(I)):bt(I)?(e.consume(I),F):(e.consume(I),L)}function X(I){return I===s?(e.consume(I),s=void 0,j):I===null?n(I):Ze(I)?(a=X,R(I)):(e.consume(I),X)}function L(I){return I===null||I===34||I===39||I===60||I===61||I===96?n(I):I===47||I===62||$t(I)?A(I):(e.consume(I),L)}function j(I){return I===47||I===62||$t(I)?A(I):n(I)}function T(I){return I===62?(e.consume(I),e.exit("htmlTextData"),e.exit("htmlText"),t):n(I)}function R(I){return e.exit("htmlTextData"),e.enter("lineEnding"),e.consume(I),e.exit("lineEnding"),M}function M(I){return bt(I)?vt(e,B,"linePrefix",r.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(I):B(I)}function B(I){return e.enter("htmlTextData"),a(I)}}const ev={name:"labelEnd",resolveAll:JY,resolveTo:eG,tokenize:tG},XY={tokenize:nG},QY={tokenize:rG},ZY={tokenize:sG};function JY(e){let t=-1;const n=[];for(;++t=3&&(u===null||Ze(u))?(e.exit("thematicBreak"),t(u)):n(u)}function c(u){return u===s?(e.consume(u),r++,c):(e.exit("thematicBreakSequence"),bt(u)?vt(e,o,"whitespace")(u):o(u))}}const Mr={continuation:{tokenize:pG},exit:gG,name:"list",tokenize:hG},dG={partial:!0,tokenize:yG},fG={partial:!0,tokenize:mG};function hG(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:cE(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(Rp,n,u)(p):u(p);if(!r.interrupt||p===49)return e.enter("listItemPrefix"),e.enter("listItemValue"),c(p)}return n(p)}function c(p){return cE(p)&&++a<10?(e.consume(p),c):(!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(Of,r.interrupt?n:d,e.attempt(dG,h,f))}function d(p){return r.containerState.initialBlankLine=!0,i++,h(p)}function f(p){return bt(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 pG(e,t,n){const r=this;return r.containerState._closeFlow=void 0,e.check(Of,s,i);function s(o){return r.containerState.furtherBlankLines=r.containerState.furtherBlankLines||r.containerState.initialBlankLine,vt(e,t,"listItemIndent",r.containerState.size+1)(o)}function i(o){return r.containerState.furtherBlankLines||!bt(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(fG,t,a)(o))}function a(o){return r.containerState._closeFlow=!0,r.interrupt=void 0,vt(e,e.attempt(Mr,t,n),"linePrefix",r.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(o)}}function mG(e,t,n){const r=this;return vt(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 gG(e){e.exit(this.containerState.type)}function yG(e,t,n){const r=this;return vt(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!bt(i)&&a&&a[1].type==="listItemPrefixWhitespace"?t(i):n(i)}}const QS={name:"setextUnderline",resolveTo:bG,tokenize:EG};function bG(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 EG(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"),bt(u)?vt(e,c,"lineSuffix")(u):c(u))}function c(u){return u===null||Ze(u)?(e.exit("setextHeadingLine"),t(u)):n(u)}}const xG={tokenize:wG};function wG(e){const t=this,n=e.attempt(Of,r,e.attempt(this.parser.constructs.flowInitial,s,vt(e,e.attempt(this.parser.constructs.flow,s,e.attempt(SY,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 vG={resolveAll:l3()},_G=o3("string"),kG=o3("text");function o3(e){return{resolveAll:l3(e==="text"?NG: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),c}function c(d){return u(d)?(n.exit("data"),i(d)):(n.consume(d),c)}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 BG(e,t){let n=-1;const r=[];let s;for(;++n0){const Ke=le.tokenStack[le.tokenStack.length-1];(Ke[1]||JS).call(le,void 0,Ke[0])}for(Z.position={start:ua(H.length>0?H[0][1].start:{line:1,column:1,offset:0}),end:ua(H.length>0?H[H.length-2][1].end:{line:1,column:1,offset:0})},Le=-1;++Le0&&(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 ZG(e,t){const n={type:"element",tagName:"del",properties:{},children:e.all(t)};return e.patch(t,n),e.applyData(t,n)}function JG(e,t){const n={type:"element",tagName:"em",properties:{},children:e.all(t)};return e.patch(t,n),e.applyData(t,n)}function eW(e,t){const n=typeof e.options.clobberPrefix=="string"?e.options.clobberPrefix:"user-content-",r=String(t.identifier).toUpperCase(),s=Xc(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 c={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,c);const u={type:"element",tagName:"sup",properties:{},children:[c]};return e.patch(t,u),e.applyData(t,u)}function tW(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 nW(e,t){if(e.options.allowDangerousHtml){const n={type:"raw",value:t.value};return e.patch(t,n),e.applyData(t,n)}}function d3(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 rW(e,t){const n=String(t.identifier).toUpperCase(),r=e.definitionById.get(n);if(!r)return d3(e,t);const s={src:Xc(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 sW(e,t){const n={src:Xc(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 iW(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 aW(e,t){const n=String(t.identifier).toUpperCase(),r=e.definitionById.get(n);if(!r)return d3(e,t);const s={href:Xc(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 oW(e,t){const n={href:Xc(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 lW(e,t,n){const r=e.all(t),s=n?cW(n):f3(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 uW(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=_i(t.children[1]),c=Ug(t.children[t.children.length-1]);o&&c&&(a.position={start:o,end:c}),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 mW(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 c=-1;const u=[];for(;++c0,!0),r[0]),s=r.index+r[0].length,r=n.exec(t);return i.push(nT(t.slice(s),s>0,!1)),i.join("")}function nT(e,t,n){let r=0,s=e.length;if(t){let i=e.codePointAt(r);for(;i===eT||i===tT;)r++,i=e.codePointAt(r)}if(n){let i=e.codePointAt(s-1);for(;i===eT||i===tT;)s--,i=e.codePointAt(s-1)}return s>r?e.slice(r,s):""}function bW(e,t){const n={type:"text",value:yW(String(t.value))};return e.patch(t,n),e.applyData(t,n)}function EW(e,t){const n={type:"element",tagName:"hr",properties:{},children:[]};return e.patch(t,n),e.applyData(t,n)}const xW={blockquote:qG,break:XG,code:QG,delete:ZG,emphasis:JG,footnoteReference:eW,heading:tW,html:nW,imageReference:rW,image:sW,inlineCode:iW,linkReference:aW,link:oW,listItem:lW,list:uW,paragraph:dW,root:fW,strong:hW,table:pW,tableCell:gW,tableRow:mW,text:bW,thematicBreak:EW,toml:Bh,yaml:Bh,definition:Bh,footnoteDefinition:Bh};function Bh(){}const h3=-1,zg=0,pd=1,Rm=2,tv=3,nv=4,rv=5,sv=6,p3=7,m3=8,wW=typeof self=="object"?self:globalThis,rT=(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 wW[e](t)},vW=(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 zg:case h3:return n(a,s);case pd:{const o=n([],s);for(const c of a)o.push(r(c));return o}case Rm:{const o=n({},s);for(const[c,u]of a)o[r(c)]=r(u);return o}case tv:return n(new Date(a),s);case nv:{const{source:o,flags:c}=a;return n(new RegExp(o,c),s)}case rv:{const o=n(new Map,s);for(const[c,u]of a)o.set(r(c),r(u));return o}case sv:{const o=n(new Set,s);for(const c of a)o.add(r(c));return o}case p3:{const{name:o,message:c}=a;return n(rT(o,c),s)}case m3: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(rT(i,a),s)};return r},sT=e=>vW(new Map,e)(0),dl="",{toString:_W}={},{keys:kW}=Object,_u=e=>{const t=typeof e;if(t!=="object"||!e)return[zg,t];const n=_W.call(e).slice(8,-1);switch(n){case"Array":return[pd,dl];case"Object":return[Rm,dl];case"Date":return[tv,dl];case"RegExp":return[nv,dl];case"Map":return[rv,dl];case"Set":return[sv,dl];case"DataView":return[pd,n]}return n.includes("Array")?[pd,n]:n.includes("Error")?[p3,n]:[Rm,n]},Fh=([e,t])=>e===zg&&(t==="function"||t==="symbol"),NW=(e,t,n,r)=>{const s=(a,o)=>{const c=r.push(a)-1;return n.set(o,c),c},i=a=>{if(n.has(a))return n.get(a);let[o,c]=_u(a);switch(o){case zg:{let d=a;switch(c){case"bigint":o=m3,d=a.toString();break;case"function":case"symbol":if(e)throw new TypeError("unable to serialize "+c);d=null;break;case"undefined":return s([h3],a)}return s([o,d],a)}case pd:{if(c){let h=a;return c==="DataView"?h=new Uint8Array(a.buffer):c==="ArrayBuffer"&&(h=new Uint8Array(a)),s([c,[...h]],a)}const d=[],f=s([o,d],a);for(const h of a)d.push(i(h));return f}case Rm:{if(c)switch(c){case"BigInt":return s([c,a.toString()],a);case"Boolean":case"Number":case"String":return s([c,a.valueOf()],a)}if(t&&"toJSON"in a)return i(a.toJSON());const d=[],f=s([o,d],a);for(const h of kW(a))(e||!Fh(_u(a[h])))&&d.push([i(h),i(a[h])]);return f}case tv:return s([o,a.toISOString()],a);case nv:{const{source:d,flags:f}=a;return s([o,{source:d,flags:f}],a)}case rv:{const d=[],f=s([o,d],a);for(const[h,p]of a)(e||!(Fh(_u(h))||Fh(_u(p))))&&d.push([i(h),i(p)]);return f}case sv:{const d=[],f=s([o,d],a);for(const h of a)(e||!Fh(_u(h)))&&d.push(i(h));return f}}const{message:u}=a;return s([o,{name:c,message:u}],a)};return i},iT=(e,{json:t,lossy:n}={})=>{const r=[];return NW(!(t||n),!!t,new Map,r)(e),r},Tc=typeof structuredClone=="function"?(e,t)=>t&&("json"in t||"lossy"in t)?sT(iT(e,t)):structuredClone(e):(e,t)=>sT(iT(e,t));function SW(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 TW(e,t){return"Back to reference "+(e+1)+(t>1?"-"+t:"")}function AW(e){const t=typeof e.options.clobberPrefix=="string"?e.options.clobberPrefix:"user-content-",n=e.options.footnoteBackContent||SW,r=e.options.footnoteBackLabel||TW,s=e.options.footnoteLabel||"Footnotes",i=e.options.footnoteLabelTagName||"h2",a=e.options.footnoteLabelProperties||{className:["sr-only"]},o=[];let c=-1;for(;++c0&&m.push({type:"text",value:" "});let x=typeof n=="string"?n:n(c,p);typeof x=="string"&&(x={type:"text",value:x}),m.push({type:"element",tagName:"a",properties:{href:"#"+t+"fnref-"+h+(p>1?"-"+p:""),dataFootnoteBackref:"",ariaLabel:typeof r=="string"?r:r(c,p),className:["data-footnote-backref"]},children:Array.isArray(x)?x:[x]})}const E=d[d.length-1];if(E&&E.type==="element"&&E.tagName==="p"){const x=E.children[E.children.length-1];x&&x.type==="text"?x.value+=" ":E.children.push({type:"text",value:" "}),E.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:{...Tc(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 Rf=function(e){if(e==null)return RW;if(typeof e=="function")return Vg(e);if(typeof e=="object")return Array.isArray(e)?CW(e):IW(e);if(typeof e=="string")return OW(e);throw new Error("Expected function, string, or object as test")};function CW(e){const t=[];let n=-1;for(;++n":""))+")"})}return h;function h(){let p=g3,m,y,E;if((!t||i(c,u,d[d.length-1]||void 0))&&(p=DW(n(c,d)),p[0]===dE))return p;if("children"in c&&c.children){const g=c;if(g.children&&p[0]!==jW)for(y=(r?g.children.length:-1)+a,E=d.concat(g);y>-1&&y0&&n.push({type:"text",value:` +`}),n}function aT(e){let t=0,n=e.charCodeAt(t);for(;n===9||n===32;)t++,n=e.charCodeAt(t);return e.slice(t)}function oT(e,t){const n=BW(e,t),r=n.one(e,void 0),s=AW(n),i=Array.isArray(r)?{type:"root",children:r}:r||{type:"root",children:[]};return s&&i.children.push({type:"text",value:` +`},s),i}function zW(e,t){return e&&"run"in e?async function(n,r){const s=oT(n,{file:r,...t});await e.run(s,r)}:function(n,r){return oT(n,{file:r,...e||t})}}function lT(e){if(e)throw e}var Lp=Object.prototype.hasOwnProperty,b3=Object.prototype.toString,cT=Object.defineProperty,uT=Object.getOwnPropertyDescriptor,dT=function(t){return typeof Array.isArray=="function"?Array.isArray(t):b3.call(t)==="[object Array]"},fT=function(t){if(!t||b3.call(t)!=="[object Object]")return!1;var n=Lp.call(t,"constructor"),r=t.constructor&&t.constructor.prototype&&Lp.call(t.constructor.prototype,"isPrototypeOf");if(t.constructor&&!n&&!r)return!1;var s;for(s in t);return typeof s>"u"||Lp.call(t,s)},hT=function(t,n){cT&&n.name==="__proto__"?cT(t,n.name,{enumerable:!0,configurable:!0,value:n.newValue,writable:!0}):t[n.name]=n.newValue},pT=function(t,n){if(n==="__proto__")if(Lp.call(t,n)){if(uT)return uT(t,n).value}else return;return t[n]},VW=function e(){var t,n,r,s,i,a,o=arguments[0],c=1,u=arguments.length,d=!1;for(typeof o=="boolean"&&(d=o,o=arguments[1]||{},c=2),(o==null||typeof o!="object"&&typeof o!="function")&&(o={});ca.length;let c;o&&a.push(s);try{c=e.apply(this,a)}catch(u){const d=u;if(o&&n)throw d;return s(d)}o||(c&&c.then&&typeof c.then=="function"?c.then(i,s):c instanceof Error?s(c):i(c))}function s(a,...o){n||(n=!0,t(a,...o))}function i(a){s(null,a)}}const di={basename:GW,dirname:WW,extname:qW,join:XW,sep:"/"};function GW(e,t){if(t!==void 0&&typeof t!="string")throw new TypeError('"ext" argument must be a string');Mf(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 WW(e){if(Mf(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 qW(e){Mf(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 XW(...e){let t=-1,n;for(;++t0&&e.codePointAt(e.length-1)===47&&(n+="/"),t?"/"+n:n}function ZW(e,t){let n="",r=0,s=-1,i=0,a=-1,o,c;for(;++a<=e.length;){if(a2){if(c=n.lastIndexOf("/"),c!==n.length-1){c<0?(n="",r=0):(n=n.slice(0,c),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 Mf(e){if(typeof e!="string")throw new TypeError("Path must be a string. Received "+JSON.stringify(e))}const JW={cwd:eq};function eq(){return"/"}function pE(e){return!!(e!==null&&typeof e=="object"&&"href"in e&&e.href&&"protocol"in e&&e.protocol&&e.auth===void 0)}function tq(e){if(typeof e=="string")e=new URL(e);else if(!pE(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 nq(e)}function nq(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];hE(y)&&hE(p)&&(p=Cy(!0,y,p)),r[h]=[u,p,...m]}}}}const aq=new iv().freeze();function Ly(e,t){if(typeof t!="function")throw new TypeError("Cannot `"+e+"` without `parser`")}function My(e,t){if(typeof t!="function")throw new TypeError("Cannot `"+e+"` without `compiler`")}function jy(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 gT(e){if(!hE(e)||typeof e.type!="string")throw new TypeError("Expected node, got `"+e+"`")}function yT(e,t,n){if(!n)throw new Error("`"+e+"` finished async. Use `"+t+"` instead")}function Uh(e){return oq(e)?e:new E3(e)}function oq(e){return!!(e&&typeof e=="object"&&"message"in e&&"messages"in e)}function lq(e){return typeof e=="string"||cq(e)}function cq(e){return!!(e&&typeof e=="object"&&"byteLength"in e&&"byteOffset"in e)}const uq="https://github.com/remarkjs/react-markdown/blob/main/changelog.md",bT=[],ET={allowDangerousHtml:!0},dq=/^(https?|ircs?|mailto|xmpp)$/i,fq=[{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 hq(e){const t=pq(e),n=mq(e);return gq(t.runSync(t.parse(n),n),e)}function pq(e){const t=e.rehypePlugins||bT,n=e.remarkPlugins||bT,r=e.remarkRehypeOptions?{...e.remarkRehypeOptions,...ET}:ET;return aq().use(WG).use(n).use(zW,r).use(t)}function mq(e){const t=e.children||"",n=new E3;return typeof t=="string"&&(n.value=t),n}function gq(e,t){const n=t.allowedElements,r=t.allowElement,s=t.components,i=t.disallowedElements,a=t.skipHtml,o=t.unwrapDisallowed,c=t.urlTransform||yq;for(const d of fq)Object.hasOwn(t,d.from)&&(""+d.from+(d.to?"use `"+d.to+"` instead":"remove it")+uq+d.id,void 0);return t.className&&(e={type:"element",tagName:"div",properties:{className:t.className},children:e.type==="root"?e.children:[e]}),Lf(e,u),OK(e,{Fragment:l.Fragment,components:s,ignoreInvalidStyle:!0,jsx:l.jsx,jsxs:l.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 Sy)if(Object.hasOwn(Sy,p)&&Object.hasOwn(d.properties,p)){const m=d.properties[p],y=Sy[p];(y===null||y.includes(d.tagName))&&(d.properties[p]=c(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 yq(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||dq.test(e.slice(0,t))?e:""}function xT(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 bq(e){if(typeof e!="string")throw new TypeError("Expected a string");return e.replace(/[|\\{}()[\]^$+*?.]/g,"\\$&").replace(/-/g,"\\x2d")}function Eq(e,t,n){const s=Rf((n||{}).ignore||[]),i=xq(t);let a=-1;for(;++a0?{type:"text",value:N}:void 0),N===!1?h.lastIndex=_+1:(m!==_&&x.push({type:"text",value:u.value.slice(m,_)}),Array.isArray(N)?x.push(...N):N&&x.push(N),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=xT(e,"(");let i=xT(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 x3(e,t){const n=e.input.charCodeAt(e.index-1);return(e.index===0||jo(n)||$g(n))&&(!t||n!==47)}w3.peek=zq;function jq(){this.buffer()}function Dq(e){this.enter({type:"footnoteReference",identifier:"",label:""},e)}function Pq(){this.buffer()}function Bq(e){this.enter({type:"footnoteDefinition",identifier:"",label:"",children:[]},e)}function Fq(e){const t=this.resume(),n=this.stack[this.stack.length-1];n.type,n.identifier=Xs(this.sliceSerialize(e)).toLowerCase(),n.label=t}function Uq(e){this.exit(e)}function $q(e){const t=this.resume(),n=this.stack[this.stack.length-1];n.type,n.identifier=Xs(this.sliceSerialize(e)).toLowerCase(),n.label=t}function Hq(e){this.exit(e)}function zq(){return"["}function w3(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 Vq(){return{enter:{gfmFootnoteCallString:jq,gfmFootnoteCall:Dq,gfmFootnoteDefinitionLabelString:Pq,gfmFootnoteDefinition:Bq},exit:{gfmFootnoteCallString:Fq,gfmFootnoteCall:Uq,gfmFootnoteDefinitionLabelString:$q,gfmFootnoteDefinition:Hq}}}function Kq(e){let t=!1;return e&&e.firstLineBlank&&(t=!0),{handlers:{footnoteDefinition:n,footnoteReference:w3},unsafe:[{character:"[",inConstruct:["label","phrasing","reference"]}]};function n(r,s,i,a){const o=i.createTracker(a);let c=o.move("[^");const u=i.enter("footnoteDefinition"),d=i.enter("label");return c+=o.move(i.safe(i.associationId(r),{before:c,after:"]"})),d(),c+=o.move("]:"),r.children&&r.children.length>0&&(o.shift(4),c+=o.move((t?` +`:" ")+i.indentLines(i.containerFlow(r,o.current()),t?v3:Yq))),u(),c}}function Yq(e,t,n){return t===0?e:v3(e,t,n)}function v3(e,t,n){return(n?"":" ")+e}const Gq=["autolink","destinationLiteral","destinationRaw","reference","titleQuote","titleApostrophe"];_3.peek=Zq;function Wq(){return{canContainEols:["delete"],enter:{strikethrough:Xq},exit:{strikethrough:Qq}}}function qq(){return{unsafe:[{character:"~",inConstruct:"phrasing",notInConstruct:Gq}],handlers:{delete:_3}}}function Xq(e){this.enter({type:"delete",children:[]},e)}function Qq(e){this.exit(e)}function _3(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 Zq(){return"~"}function Jq(e){return e.length}function eX(e,t){const n=t||{},r=(n.align||[]).concat(),s=n.stringLength||Jq,i=[],a=[],o=[],c=[];let u=0,d=-1;for(;++du&&(u=e[d].length);++gc[g])&&(c[g]=b)}y.push(x)}a[d]=y,o[d]=E}let f=-1;if(typeof r=="object"&&"length"in r)for(;++fc[f]&&(c[f]=x),p[f]=x),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()),rX);return s(),a}function rX(e,t,n){return">"+(n?"":" ")+e}function sX(e,t){return _T(e,t.inConstruct,!0)&&!_T(e,t.notInConstruct,!1)}function _T(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 aX(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 oX(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 lX(e,t,n,r){const s=oX(n),i=e.value||"",a=s==="`"?"GraveAccent":"Tilde";if(aX(e,n)){const f=n.enter("codeIndented"),h=n.indentLines(i,cX);return f(),h}const o=n.createTracker(r),c=s.repeat(Math.max(iX(i,s)+1,3)),u=n.enter("codeFenced");let d=o.move(c);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(c),u(),d}function cX(e,t,n){return(n?"":" ")+e}function av(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 uX(e,t,n,r){const s=av(n),i=s==='"'?"Quote":"Apostrophe",a=n.enter("definition");let o=n.enter("label");const c=n.createTracker(r);let u=c.move("[");return u+=c.move(n.safe(n.associationId(e),{before:u,after:"]",...c.current()})),u+=c.move("]: "),o(),!e.url||/[\0- \u007F]/.test(e.url)?(o=n.enter("destinationLiteral"),u+=c.move("<"),u+=c.move(n.safe(e.url,{before:u,after:">",...c.current()})),u+=c.move(">")):(o=n.enter("destinationRaw"),u+=c.move(n.safe(e.url,{before:u,after:e.title?" ":` +`,...c.current()}))),o(),e.title&&(o=n.enter(`title${i}`),u+=c.move(" "+s),u+=c.move(n.safe(e.title,{before:u,after:s,...c.current()})),u+=c.move(s),o()),a(),u}function dX(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 ef(e){return"&#x"+e.toString(16).toUpperCase()+";"}function Lm(e,t,n){const r=Sc(e),s=Sc(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}}N3.peek=fX;function N3(e,t,n,r){const s=dX(n),i=n.enter("emphasis"),a=n.createTracker(r),o=a.move(s);let c=a.move(n.containerPhrasing(e,{after:s,before:o,...a.current()}));const u=c.charCodeAt(0),d=Lm(r.before.charCodeAt(r.before.length-1),u,s);d.inside&&(c=ef(u)+c.slice(1));const f=c.charCodeAt(c.length-1),h=Lm(r.after.charCodeAt(0),f,s);h.inside&&(c=c.slice(0,-1)+ef(f));const p=a.move(s);return i(),n.attentionEncodeSurroundingInfo={after:h.outside,before:d.outside},o+c+p}function fX(e,t,n){return n.options.emphasis||"*"}function hX(e,t){let n=!1;return Lf(e,function(r){if("value"in r&&/\r?\n|\r/.test(r.value)||r.type==="break")return n=!0,dE}),!!((!e.depth||e.depth<3)&&Zw(e)&&(t.options.setext||n))}function pX(e,t,n,r){const s=Math.max(Math.min(6,e.depth||1),1),i=n.createTracker(r);if(hX(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"),c=n.enter("phrasing");i.move(a+" ");let u=n.containerPhrasing(e,{before:"# ",after:` +`,...i.current()});return/^[\t ]/.test(u)&&(u=ef(u.charCodeAt(0))+u.slice(1)),u=u?a+" "+u:a,n.options.closeAtx&&(u+=" "+a),c(),o(),u}S3.peek=mX;function S3(e){return e.value||""}function mX(){return"<"}T3.peek=gX;function T3(e,t,n,r){const s=av(n),i=s==='"'?"Quote":"Apostrophe",a=n.enter("image");let o=n.enter("label");const c=n.createTracker(r);let u=c.move("![");return u+=c.move(n.safe(e.alt,{before:u,after:"]",...c.current()})),u+=c.move("]("),o(),!e.url&&e.title||/[\0- \u007F]/.test(e.url)?(o=n.enter("destinationLiteral"),u+=c.move("<"),u+=c.move(n.safe(e.url,{before:u,after:">",...c.current()})),u+=c.move(">")):(o=n.enter("destinationRaw"),u+=c.move(n.safe(e.url,{before:u,after:e.title?" ":")",...c.current()}))),o(),e.title&&(o=n.enter(`title${i}`),u+=c.move(" "+s),u+=c.move(n.safe(e.title,{before:u,after:s,...c.current()})),u+=c.move(s),o()),u+=c.move(")"),a(),u}function gX(){return"!"}A3.peek=yX;function A3(e,t,n,r){const s=e.referenceType,i=n.enter("imageReference");let a=n.enter("label");const o=n.createTracker(r);let c=o.move("![");const u=n.safe(e.alt,{before:c,after:"]",...o.current()});c+=o.move(u+"]["),a();const d=n.stack;n.stack=[],a=n.enter("reference");const f=n.safe(n.associationId(e),{before:c,after:"]",...o.current()});return a(),n.stack=d,i(),s==="full"||!u||u!==f?c+=o.move(f+"]"):s==="shortcut"?c=c.slice(0,-1):c+=o.move("]"),c}function yX(){return"!"}C3.peek=bX;function C3(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))}O3.peek=EX;function O3(e,t,n,r){const s=av(n),i=s==='"'?"Quote":"Apostrophe",a=n.createTracker(r);let o,c;if(I3(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"),c=n.enter("label");let u=a.move("[");return u+=a.move(n.containerPhrasing(e,{before:u,after:"](",...a.current()})),u+=a.move("]("),c(),!e.url&&e.title||/[\0- \u007F]/.test(e.url)?(c=n.enter("destinationLiteral"),u+=a.move("<"),u+=a.move(n.safe(e.url,{before:u,after:">",...a.current()})),u+=a.move(">")):(c=n.enter("destinationRaw"),u+=a.move(n.safe(e.url,{before:u,after:e.title?" ":")",...a.current()}))),c(),e.title&&(c=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),c()),u+=a.move(")"),o(),u}function EX(e,t,n){return I3(e,n)?"<":"["}R3.peek=xX;function R3(e,t,n,r){const s=e.referenceType,i=n.enter("linkReference");let a=n.enter("label");const o=n.createTracker(r);let c=o.move("[");const u=n.containerPhrasing(e,{before:c,after:"]",...o.current()});c+=o.move(u+"]["),a();const d=n.stack;n.stack=[],a=n.enter("reference");const f=n.safe(n.associationId(e),{before:c,after:"]",...o.current()});return a(),n.stack=d,i(),s==="full"||!u||u!==f?c+=o.move(f+"]"):s==="shortcut"?c=c.slice(0,-1):c+=o.move("]"),c}function xX(){return"["}function ov(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 wX(e){const t=ov(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 vX(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 L3(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 _X(e,t,n,r){const s=n.enter("list"),i=n.bulletCurrent;let a=e.ordered?vX(n):ov(n);const o=e.ordered?a==="."?")":".":wX(n);let c=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&&(c=!0),L3(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 c=n.enter("listItem"),u=n.indentLines(n.containerFlow(e,o.current()),d);return c(),u;function d(f,h,p){return h?(p?"":" ".repeat(a))+f:(p?i:i+" ".repeat(a-i.length))+f}}function SX(e,t,n,r){const s=n.enter("paragraph"),i=n.enter("phrasing"),a=n.containerPhrasing(e,r);return i(),s(),a}const TX=Rf(["break","delete","emphasis","footnote","footnoteReference","image","imageReference","inlineCode","inlineMath","link","linkReference","mdxJsxTextElement","mdxTextExpression","strong","text","textDirective"]);function AX(e,t,n,r){return(e.children.some(function(a){return TX(a)})?n.containerPhrasing:n.containerFlow).call(n,e,r)}function CX(e){const t=e.options.strong||"*";if(t!=="*"&&t!=="_")throw new Error("Cannot serialize strong with `"+t+"` for `options.strong`, expected `*`, or `_`");return t}M3.peek=IX;function M3(e,t,n,r){const s=CX(n),i=n.enter("strong"),a=n.createTracker(r),o=a.move(s+s);let c=a.move(n.containerPhrasing(e,{after:s,before:o,...a.current()}));const u=c.charCodeAt(0),d=Lm(r.before.charCodeAt(r.before.length-1),u,s);d.inside&&(c=ef(u)+c.slice(1));const f=c.charCodeAt(c.length-1),h=Lm(r.after.charCodeAt(0),f,s);h.inside&&(c=c.slice(0,-1)+ef(f));const p=a.move(s+s);return i(),n.attentionEncodeSurroundingInfo={after:h.outside,before:d.outside},o+c+p}function IX(e,t,n){return n.options.strong||"*"}function OX(e,t,n,r){return n.safe(e.value,r)}function RX(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 LX(e,t,n){const r=(L3(n)+(n.options.ruleSpaces?" ":"")).repeat(RX(n));return n.options.ruleSpaces?r.slice(0,-1):r}const j3={blockquote:nX,break:kT,code:lX,definition:uX,emphasis:N3,hardBreak:kT,heading:pX,html:S3,image:T3,imageReference:A3,inlineCode:C3,link:O3,linkReference:R3,list:_X,listItem:NX,paragraph:SX,root:AX,strong:M3,text:OX,thematicBreak:LX};function MX(){return{enter:{table:jX,tableData:NT,tableHeader:NT,tableRow:PX},exit:{codeText:BX,table:DX,tableData:Fy,tableHeader:Fy,tableRow:Fy}}}function jX(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 DX(e){this.exit(e),this.data.inTable=void 0}function PX(e){this.enter({type:"tableRow",children:[]},e)}function Fy(e){this.exit(e)}function NT(e){this.enter({type:"tableCell",children:[]},e)}function BX(e){let t=this.resume();this.data.inTable&&(t=t.replace(/\\([\\|])/g,FX));const n=this.stack[this.stack.length-1];n.type,n.value=t,this.exit(e)}function FX(e,t){return t==="|"?t:e}function UX(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:c,tableRow:o}};function a(p,m,y,E){return u(d(p,y,E),p.align)}function o(p,m,y,E){const g=f(p,y,E),x=u([g]);return x.slice(0,x.indexOf(` +`))}function c(p,m,y,E){const g=y.enter("tableCell"),x=y.enter("phrasing"),b=y.containerPhrasing(p,{...E,before:i,after:i});return x(),g(),b}function u(p,m){return eX(p,{align:m,alignDelimiters:r,padding:n,stringLength:s})}function d(p,m,y){const E=p.children;let g=-1;const x=[],b=m.enter("table");for(;++g0&&!n&&(e[e.length-1][1]._gfmAutolinkLiteralWalkedInto=!0),n}const sQ={tokenize:fQ,partial:!0};function iQ(){return{document:{91:{name:"gfmFootnoteDefinition",tokenize:cQ,continuation:{tokenize:uQ},exit:dQ}},text:{91:{name:"gfmFootnoteCall",tokenize:lQ},93:{name:"gfmPotentialFootnoteCall",add:"after",tokenize:aQ,resolveTo:oQ}}}}function aQ(e,t,n){const r=this;let s=r.events.length;const i=r.parser.gfmFootnotes||(r.parser.gfmFootnotes=[]);let a;for(;s--;){const c=r.events[s][1];if(c.type==="labelImage"){a=c;break}if(c.type==="gfmFootnoteCall"||c.type==="labelLink"||c.type==="label"||c.type==="image"||c.type==="link")break}return o;function o(c){if(!a||!a._balanced)return n(c);const u=Xs(r.sliceSerialize({start:a.end,end:r.now()}));return u.codePointAt(0)!==94||!i.includes(u.slice(1))?n(c):(e.enter("gfmFootnoteCallLabelMarker"),e.consume(c),e.exit("gfmFootnoteCallLabelMarker"),t(c))}}function oQ(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 lQ(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"),c}function c(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||$t(f))return n(f);if(f===93){e.exit("chunkString");const h=e.exit("gfmFootnoteCallString");return s.includes(Xs(r.sliceSerialize(h)))?(e.enter("gfmFootnoteCallLabelMarker"),e.consume(f),e.exit("gfmFootnoteCallLabelMarker"),e.exit("gfmFootnoteCall"),t):n(f)}return $t(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 cQ(e,t,n){const r=this,s=r.parser.gfmFootnotes||(r.parser.gfmFootnotes=[]);let i,a=0,o;return c;function c(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||$t(m))return n(m);if(m===93){e.exit("chunkString");const y=e.exit("gfmFootnoteDefinitionLabelString");return i=Xs(r.sliceSerialize(y)),e.enter("gfmFootnoteDefinitionLabelMarker"),e.consume(m),e.exit("gfmFootnoteDefinitionLabelMarker"),e.exit("gfmFootnoteDefinitionLabel"),h}return $t(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),vt(e,p,"gfmFootnoteDefinitionWhitespace")):n(m)}function p(m){return t(m)}}function uQ(e,t,n){return e.check(Of,t,e.attempt(sQ,t,n))}function dQ(e){e.exit("gfmFootnoteDefinition")}function fQ(e,t,n){const r=this;return vt(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 hQ(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 c=-1;for(;++c1?c(m):(a.consume(m),f++,p);if(f<2&&!n)return c(m);const E=a.exit("strikethroughSequenceTemporary"),g=Sc(m);return E._open=!g||g===2&&!!y,E._close=!y||y===2&&!!g,o(m)}}}class pQ{constructor(){this.map=[]}add(t,n,r){mQ(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 mQ(e,t,n,r){let s=0;if(!(n===0&&r.length===0)){for(;s-1;){const L=r.events[D][1].type;if(L==="lineEnding"||L==="linePrefix")D--;else break}const F=D>-1?r.events[D][1].type:null,X=F==="tableHead"||F==="tableRow"?N:c;return X===N&&r.parser.lazy[r.now().line]?n(O):X(O)}function c(O){return e.enter("tableHead"),e.enter("tableRow"),u(O)}function u(O){return O===124||(a=!0,i+=1),d(O)}function d(O){return O===null?n(O):Ze(O)?i>1?(i=0,r.interrupt=!0,e.exit("tableRow"),e.enter("lineEnding"),e.consume(O),e.exit("lineEnding"),p):n(O):bt(O)?vt(e,d,"whitespace")(O):(i+=1,a&&(a=!1,s+=1),O===124?(e.enter("tableCellDivider"),e.consume(O),e.exit("tableCellDivider"),a=!0,d):(e.enter("data"),f(O)))}function f(O){return O===null||O===124||$t(O)?(e.exit("data"),d(O)):(e.consume(O),O===92?h:f)}function h(O){return O===92||O===124?(e.consume(O),f):f(O)}function p(O){return r.interrupt=!1,r.parser.lazy[r.now().line]?n(O):(e.enter("tableDelimiterRow"),a=!1,bt(O)?vt(e,m,"linePrefix",r.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(O):m(O))}function m(O){return O===45||O===58?E(O):O===124?(a=!0,e.enter("tableCellDivider"),e.consume(O),e.exit("tableCellDivider"),y):k(O)}function y(O){return bt(O)?vt(e,E,"whitespace")(O):E(O)}function E(O){return O===58?(i+=1,a=!0,e.enter("tableDelimiterMarker"),e.consume(O),e.exit("tableDelimiterMarker"),g):O===45?(i+=1,g(O)):O===null||Ze(O)?_(O):k(O)}function g(O){return O===45?(e.enter("tableDelimiterFiller"),x(O)):k(O)}function x(O){return O===45?(e.consume(O),x):O===58?(a=!0,e.exit("tableDelimiterFiller"),e.enter("tableDelimiterMarker"),e.consume(O),e.exit("tableDelimiterMarker"),b):(e.exit("tableDelimiterFiller"),b(O))}function b(O){return bt(O)?vt(e,_,"whitespace")(O):_(O)}function _(O){return O===124?m(O):O===null||Ze(O)?!a||s!==i?k(O):(e.exit("tableDelimiterRow"),e.exit("tableHead"),t(O)):k(O)}function k(O){return n(O)}function N(O){return e.enter("tableRow"),C(O)}function C(O){return O===124?(e.enter("tableCellDivider"),e.consume(O),e.exit("tableCellDivider"),C):O===null||Ze(O)?(e.exit("tableRow"),t(O)):bt(O)?vt(e,C,"whitespace")(O):(e.enter("data"),S(O))}function S(O){return O===null||O===124||$t(O)?(e.exit("data"),C(O)):(e.consume(O),O===92?A:S)}function A(O){return O===92||O===124?(e.consume(O),S):S(O)}}function EQ(e,t){let n=-1,r=!0,s=0,i=[0,0,0,0],a=[0,0,0,0],o=!1,c=0,u,d,f;const h=new pQ;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({},El(t.events,s)),e.add(s,0,[["exit",i,t]]),i=void 0),i}function TT(e,t,n,r,s){const i=[],a=El(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 El(e,t){const n=e[t],r=n[0]==="enter"?"start":"end";return n[1][r]}const xQ={name:"tasklistCheck",tokenize:vQ};function wQ(){return{text:{91:xQ}}}function vQ(e,t,n){const r=this;return s;function s(c){return r.previous!==null||!r._gfmTasklistFirstContentOfListItem?n(c):(e.enter("taskListCheck"),e.enter("taskListCheckMarker"),e.consume(c),e.exit("taskListCheckMarker"),i)}function i(c){return $t(c)?(e.enter("taskListCheckValueUnchecked"),e.consume(c),e.exit("taskListCheckValueUnchecked"),a):c===88||c===120?(e.enter("taskListCheckValueChecked"),e.consume(c),e.exit("taskListCheckValueChecked"),a):n(c)}function a(c){return c===93?(e.enter("taskListCheckMarker"),e.consume(c),e.exit("taskListCheckMarker"),e.exit("taskListCheck"),o):n(c)}function o(c){return Ze(c)?t(c):bt(c)?e.check({tokenize:_Q},t,n)(c):n(c)}}function _Q(e,t,n){return vt(e,r,"whitespace");function r(s){return s===null?n(s):t(s)}}function kQ(e){return ZM([qX(),iQ(),hQ(e),yQ(),wQ()])}const NQ={};function SQ(e){const t=this,n=e||NQ,r=t.data(),s=r.micromarkExtensions||(r.micromarkExtensions=[]),i=r.fromMarkdownExtensions||(r.fromMarkdownExtensions=[]),a=r.toMarkdownExtensions||(r.toMarkdownExtensions=[]);s.push(kQ(n)),i.push(KX()),a.push(YX(n))}const AT=function(e,t,n){const r=Rf(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&&c.push(` +`.repeat(u)||" "),u=-1,c.push(d))}return c.join("")}function K3(e,t,n){return e.type==="element"?MQ(e,t,n):e.type==="text"?n.whitespace==="normal"?Y3(e,n):jQ(e):[]}function MQ(e,t,n){const r=G3(e,n),s=e.children||[];let i=-1,a=[];if(RQ(e))return a;let o,c;for(gE(e)||RT(e)&&AT(t,e,RT)?c=` +`:OQ(e)?(o=2,c=2):V3(e)&&(o=1,c=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"],E=["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:E},k={className:"function.dispatch",relevance:0,keywords:{_hint:g},begin:t.concat(/\b/,/(?!decltype)/,/(?!if)/,/(?!for)/,/(?!switch)/,/(?!while)/,e.IDENT_RE,t.lookahead(/(<[^<>]+>|)\s*\(/))},N=[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:N.concat([{begin:/\(/,end:/\)/,keywords:_,contains:N.concat(["self"]),relevance:0}]),relevance:0},S={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 HQ(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=$Q(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 W3(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 c={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"],E=["true","false"],g={match:/(\/[a-z._-]+)+/},x=["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:E,built_in:[...x,...b,"set","shopt",..._,...k]},contains:[p,e.SHEBANG(),m,f,i,a,g,o,c,u,d,n]}}function zQ(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*\\(",E={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],x={variants:[{begin:/=/,end:/;/},{begin:/\(/,end:/\)/},{beginKeywords:"new throw return else",end:/;/}],keywords:E,contains:g.concat([{begin:/\(/,end:/\)/,keywords:E,contains:g.concat(["self"]),relevance:0}]),relevance:0},b={begin:"("+a+"[\\*&\\s]+)+"+p,returnBegin:!0,end:/[{;=]/,excludeEnd:!0,keywords:E,illegal:/[^\w\s\*&:<>.]/,contains:[{begin:r,keywords:E,relevance:0},{begin:p,returnBegin:!0,contains:[e.inherit(h,{className:"title.function"})],relevance:0},{relevance:0,match:/,/},{className:"params",begin:/\(/,end:/\)/,keywords:E,relevance:0,contains:[n,e.C_BLOCK_COMMENT_MODE,u,d,o,{begin:/\(/,end:/\)/,keywords:E,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:E,disableAutodetect:!0,illegal:"=]/,contains:[{beginKeywords:"final class struct"},e.TITLE_MODE]}]),exports:{preprocessor:f,strings:u,keywords:E}}}function VQ(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"],E=["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:E},k={className:"function.dispatch",relevance:0,keywords:{_hint:g},begin:t.concat(/\b/,/(?!decltype)/,/(?!if)/,/(?!for)/,/(?!switch)/,/(?!while)/,e.IDENT_RE,t.lookahead(/(<[^<>]+>|)\s*\(/))},N=[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:N.concat([{begin:/\(/,end:/\)/,keywords:_,contains:N.concat(["self"]),relevance:0}]),relevance:0},S={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 KQ(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)*"}),c={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]},E=e.inherit(y,{illegal:/\n/,contains:[{begin:/\{\{/},{begin:/\}\}/},{begin:'""'},p]});h.contains=[y,m,d,e.APOS_STRING_MODE,e.QUOTE_STRING_MODE,c,e.C_BLOCK_COMMENT_MODE],p.contains=[E,m,f,e.APOS_STRING_MODE,e.QUOTE_STRING_MODE,c,e.inherit(e.C_BLOCK_COMMENT_MODE,{illegal:/\n/})];const g={variants:[u,y,m,d,e.APOS_STRING_MODE,e.QUOTE_STRING_MODE]},x={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,c,{beginKeywords:"class interface",relevance:0,end:/[{;=]/,illegal:/[^\s:,]/,contains:[{beginKeywords:"where class"},o,x,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,x,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,x],relevance:0},{match:/\(\)/},{className:"params",begin:/\(/,end:/\)/,excludeBegin:!0,excludeEnd:!0,keywords:a,relevance:0,contains:[g,c,e.C_BLOCK_COMMENT_MODE]},e.C_LINE_COMMENT_MODE,e.C_BLOCK_COMMENT_MODE]},_]}}const YQ=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_-]*/}}),GQ=["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"],WQ=["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"],qQ=[...GQ,...WQ],XQ=["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(),QQ=["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(),ZQ=["after","backdrop","before","cue","cue-region","first-letter","first-line","grammar-error","marker","part","placeholder","selection","slotted","spelling-error"].sort().reverse(),JQ=["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 eZ(e){const t=e.regex,n=YQ(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:":("+QQ.join("|")+")"},{begin:":(:)?("+ZQ.join("|")+")"}]},n.CSS_VARIABLE,{className:"attribute",begin:"\\b("+JQ.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:XQ.join(" ")},contains:[{begin:/[a-z-]+(?=:)/,className:"attribute"},...o,n.CSS_NUMBER_MODE]}]},{className:"selector-tag",begin:"\\b("+qQ.join("|")+")\\b"}]}}function tZ(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 nZ(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:"X3(e,t,n-1))}function sZ(e){const t=e.regex,n="[À-ʸa-zA-Z_$][À-ʸa-zA-Z_$0-9]*",r=n+X3("(?:<"+n+"~~~(?:\\s*,\\s*"+n+"~~~)*>)?",/~~~/g,2),c={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:c,relevance:0,contains:[e.C_BLOCK_COMMENT_MODE],endsParent:!0};return{name:"Java",aliases:["jsp"],keywords:c,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:c,contains:[{className:"params",begin:/\(/,end:/\)/,keywords:c,relevance:0,contains:[u,e.APOS_STRING_MODE,e.QUOTE_STRING_MODE,LT,e.C_BLOCK_COMMENT_MODE]},e.C_LINE_COMMENT_MODE,e.C_BLOCK_COMMENT_MODE]},LT,u]}}const MT="[A-Za-z$_][0-9A-Za-z$_]*",iZ=["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"],aZ=["true","false","null","undefined","NaN","Infinity"],Q3=["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"],Z3=["Error","EvalError","InternalError","RangeError","ReferenceError","SyntaxError","TypeError","URIError"],J3=["setInterval","setTimeout","clearInterval","clearTimeout","require","exports","eval","isFinite","isNaN","parseFloat","parseInt","decodeURI","decodeURIComponent","encodeURI","encodeURIComponent","escape","unescape"],oZ=["arguments","this","super","console","window","document","localStorage","sessionStorage","module","global"],lZ=[].concat(J3,Q3,Z3);function ej(e){const t=e.regex,n=(M,{after:B})=>{const I="",end:""},i=/<[A-Za-z0-9\\._:-]+\s*\/>/,a={begin:/<[A-Za-z0-9\\._:-]+/,end:/\/[A-Za-z0-9\\._:-]+>|\/>/,isTrulyOpeningTag:(M,B)=>{const I=M[0].length+M.index,V=M.input[I];if(V==="<"||V===","){B.ignoreMatch();return}V===">"&&(n(M,{after:I})||B.ignoreMatch());let G;const P=M.input.substring(I);if(G=P.match(/^\s*=/)){B.ignoreMatch();return}if((G=P.match(/^\s+extends\s+/))&&G.index===0){B.ignoreMatch();return}}},o={$pattern:MT,keyword:iZ,literal:aZ,built_in:lZ,"variable.language":oZ},c="[0-9](_?[0-9])*",u=`\\.(${c})`,d="0|[1-9](_?[0-9])*|0[0-7]*[89][0-9]*",f={className:"number",variants:[{begin:`(\\b(${d})((${u})|\\.)?|(${u}))[eE][+-]?(${c})\\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"}},E={className:"string",begin:"`",end:"`",contains:[e.BACKSLASH_ESCAPE,h]},x={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,E,{match:/\$\d+/},f];h.contains=b.concat({begin:/\{/,end:/\}/,keywords:o,contains:["self"].concat(b)});const _=[].concat(x,h.contains),k=_.concat([{begin:/(\s*)\(/,end:/\)/,keywords:o,contains:["self"].concat(_)}]),N={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"}}]},S={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:{_:[...Q3,...Z3]}},A={label:"use_strict",className:"meta",relevance:10,begin:/^\s*['"]use (strict|asm)['"]/},O={variants:[{match:[/function/,/\s+/,r,/(?=\s*\()/]},{match:[/function/,/\s*(?=\()/]}],className:{1:"keyword",3:"title.function"},label:"func.def",contains:[N],illegal:/%/},D={relevance:0,match:/\b[A-Z][A-Z_0-9]+\b/,className:"variable.constant"};function F(M){return t.concat("(?!",M.join("|"),")")}const X={match:t.concat(/\b/,F([...J3,"super","import"].map(M=>`${M}\\s*\\(`)),r,t.lookahead(/\s*\(/)),className:"title.function",relevance:0},L={begin:t.concat(/\./,t.lookahead(t.concat(r,/(?![0-9A-Za-z$_(])/))),end:r,excludeBegin:!0,keywords:"prototype",className:"property",relevance:0},j={match:[/get|set/,/\s+/,r,/(?=\()/],className:{1:"keyword",3:"title.function"},contains:[{begin:/\(\)/},N]},T="(\\([^()]*(\\([^()]*(\\([^()]*\\)[^()]*)*\\)[^()]*)*\\)|"+e.UNDERSCORE_IDENT_RE+")\\s*=>",R={match:[/const|var|let/,/\s+/,r,/\s*/,/=\s*/,/(async\s*)?/,t.lookahead(T)],keywords:"async",className:{1:"keyword",3:"title.function"},contains:[N]};return{name:"JavaScript",aliases:["js","jsx","mjs","cjs"],keywords:o,exports:{PARAMS_CONTAINS:k,CLASS_REFERENCE:S},illegal:/#(?![$_A-z])/,contains:[e.SHEBANG({label:"shebang",binary:"node",relevance:5}),A,e.APOS_STRING_MODE,e.QUOTE_STRING_MODE,p,m,y,E,x,{match:/\$\d+/},f,S,{scope:"attr",match:r+t.lookahead(":"),relevance:0},R,{begin:"("+e.RE_STARTERS_RE+"|\\b(case|return|throw)\\b)\\s*",keywords:"return throw case",relevance:0,contains:[x,e.REGEXP_MODE,{className:"function",begin:T,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"]}]}]},O,{beginKeywords:"while if switch catch for"},{begin:"\\b(?!function)"+e.UNDERSCORE_IDENT_RE+"\\([^()]*(\\([^()]*(\\([^()]*\\)[^()]*)*\\)[^()]*)*\\)\\s*\\{",returnBegin:!0,label:"func.def",contains:[N,e.inherit(e.TITLE_MODE,{begin:r,className:"title.function"})]},{match:/\.\.\./,relevance:0},L,{match:"\\$"+r,relevance:0},{match:[/\bconstructor(?=\s*\()/],className:{1:"title.function"},contains:[N]},X,D,C,j,{match:/\$[(.]/}]}}function tj(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 wl="[0-9](_*[0-9])*",Vh=`\\.(${wl})`,Kh="[0-9a-fA-F](_*[0-9a-fA-F])*",cZ={className:"number",variants:[{begin:`(\\b(${wl})((${Vh})|\\.)?|(${Vh}))[eE][+-]?(${wl})[fFdD]?\\b`},{begin:`\\b(${wl})((${Vh})[fFdD]?\\b|\\.([fFdD]\\b)?)`},{begin:`(${Vh})[fFdD]?\\b`},{begin:`\\b(${wl})[fFdD]\\b`},{begin:`\\b0[xX]((${Kh})\\.?|(${Kh})?\\.(${Kh}))[pP][+-]?(${wl})[fFdD]?\\b`},{begin:"\\b(0|[1-9](_*[0-9])*)[lL]?\\b"},{begin:`\\b0[xX](${Kh})[lL]?\\b`},{begin:"\\b0(_*[0-7])*[lL]?\\b"},{begin:"\\b0[bB][01](_*[01])*[lL]?\\b"}],relevance:0};function uZ(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+")?"},c={className:"meta",begin:"@"+e.UNDERSCORE_IDENT_RE,contains:[{begin:/\(/,end:/\)/,contains:[e.inherit(a,{className:"string"}),"self"]}]},u=cZ,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,c,{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,c,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,c]},a,{className:"meta",begin:"^#!/usr/bin/env",end:"$",illegal:` +`},u]}}const dZ=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_-]*/}}),fZ=["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"],hZ=["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"],pZ=[...fZ,...hZ],mZ=["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(),nj=["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(),rj=["after","backdrop","before","cue","cue-region","first-letter","first-line","grammar-error","marker","part","placeholder","selection","slotted","spelling-error"].sort().reverse(),gZ=["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(),yZ=nj.concat(rj).sort().reverse();function bZ(e){const t=dZ(e),n=yZ,r="and or not only",s="[\\w-]+",i="("+s+"|@\\{"+s+"\\})",a=[],o=[],c=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:mZ.join(" ")},f={begin:"\\(",end:"\\)",contains:o,keywords:d,relevance:0};o.push(e.C_LINE_COMMENT_MODE,e.C_BLOCK_COMMENT_MODE,c("'"),c('"'),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("+gZ.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}},E={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("+pZ.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:":("+nj.join("|")+")"},{className:"selector-pseudo",begin:":(:)?("+rj.join("|")+")"},{begin:/\(/,end:/\)/,relevance:0,contains:h},{begin:"!important"},t.FUNCTION_DISPATCH]},x={begin:s+`:(:)?(${n.join("|")})`,returnBegin:!0,contains:[g]};return a.push(e.C_LINE_COMMENT_MODE,e.C_BLOCK_COMMENT_MODE,y,E,x,m,g,p,t.FUNCTION_DISPATCH),{name:"Less",case_insensitive:!0,illegal:`[=>'/<($"]`,contains:a}}function EZ(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 sj(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+.-]*/,c={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,c];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,c,a,{scope:"literal",match:/&([a-zA-Z0-9]+|#[0-9]{1,7}|#[Xx][0-9a-fA-F]{1,6});/}]}}function xZ(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"]},c={$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:"("+c.keyword.join("|")+")\\b",end:/(\{|$)/,excludeEnd:!0,keywords:c,contains:[e.UNDERSCORE_TITLE_MODE]},{begin:"\\."+e.UNDERSCORE_IDENT_RE,relevance:0}]}}function wZ(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*\(.*?\))?/},c={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,c],f=[/!/,/\//,/\|/,/\?/,/'/,/"/,/#/],h=(y,E,g="\\1")=>{const x=g==="\\1"?g:t.concat(g,E);return t.concat(t.concat("(?:",y,")"),E,/(?:\\.|[^\\\/])*?/,x,/(?:\\.|[^\\\/])*?/,g,r)},p=(y,E,g)=>t.concat(t.concat("(?:",y,")"),E,/(?:\\.|[^\\\/])*?/,g,r),m=[c,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 vZ(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:/\?>/}]},c={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(c)}),f={begin:/<<<[ \t]*(?:(\w+)|"(\w+)")\n/,end:/[ \t]*(\w+)\b/,contains:e.QUOTE_STRING_MODE.contains.concat(c),"on:begin":(L,j)=>{j.data._beginMatch=L[1]||L[2]},"on:end":(L,j)=>{j.data._beginMatch!==L[1]&&j.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},E=["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"],x=["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:(L=>{const j=[];return L.forEach(T=>{j.push(T),T.toLowerCase()===T?j.push(T.toUpperCase()):j.push(T.toLowerCase())}),j})(E),built_in:x},k=L=>L.map(j=>j.replace(/\|\d+$/,"")),N={variants:[{match:[/new/,t.concat(p,"+"),t.concat("(?!",k(x).join("\\b|"),"\\b)"),s],scope:{1:"keyword",4:"title.class"}}]},C=t.concat(r,"\\b(?!\\()"),S={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"}}]},A={scope:"attr",match:t.concat(r,t.lookahead(":"),t.lookahead(/(?!::)/))},O={relevance:0,begin:/\(/,end:/\)/,keywords:_,contains:[A,a,S,e.C_BLOCK_COMMENT_MODE,m,y,N]},D={relevance:0,match:[/\b/,t.concat("(?!fn\\b|function\\b|",k(g).join("\\b|"),"|",k(x).join("\\b|"),"\\b)"),r,t.concat(p,"*"),t.lookahead(/(?=\()/)],scope:{3:"title.function.invoke"},contains:[O]};O.contains.push(D);const F=[A,S,e.C_BLOCK_COMMENT_MODE,m,y,N],X={begin:t.concat(/#\[\s*\\?/,t.either(s,i)),beginScope:"meta",end:/]/,endScope:"meta",keywords:{literal:E,keyword:["new","array"]},contains:[{begin:/\[/,end:/]/,keywords:{literal:E,keyword:["new","array"]},contains:["self",...F]},...F,{scope:"meta",variants:[{match:s},{match:i}]}]};return{case_insensitive:!1,keywords:_,contains:[X,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,D,S,{match:[/const/,/\s/,r],scope:{1:"keyword",3:"variable.constant"}},N,{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",X,a,S,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 _Z(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 kZ(e){return{name:"Plain text",aliases:["text","txt"],disableAutodetect:!0}}function aj(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"]},c={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,c],relevance:10},{begin:/([uU]|[bB]|[rR]|[bB][rR]|[rR][bB])?"""/,end:/"""/,contains:[e.BACKSLASH_ESCAPE,c],relevance:10},{begin:/([fF][rR]|[rR][fF]|[fF])'''/,end:/'''/,contains:[e.BACKSLASH_ESCAPE,c,d,u]},{begin:/([fF][rR]|[rR][fF]|[fF])"""/,end:/"""/,contains:[e.BACKSLASH_ESCAPE,c,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})`}]},E={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",c,y,f,e.HASH_COMMENT_MODE]}]};return u.contains=[f,y,c],{name:"Python",aliases:["py","gyp","ipython"],unicodeRegex:!0,keywords:o,illegal:/(<\/|\?)|=>/,contains:[c,y,{scope:"variable.language",match:/\bself\b/},{beginKeywords:"if",relevance:0},{match:/\bor\b/,scope:"keyword"},f,E,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 NZ(e){return{aliases:["pycon"],contains:[{className:"meta.prompt",starts:{end:/ |$/,starts:{end:"$",subLanguage:"python"}},variants:[{begin:/^>>>(?=[ ]|$)/},{begin:/^\.\.\.(?=[ ]|$)/}]}]}}function SZ(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 TZ(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]+"},c={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}]},N=[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(c,u),relevance:0}].concat(c,u);d.contains=N,y.contains=N;const O=[{begin:/^\s*=>/,starts:{end:"$",contains:N}},{className:"meta.prompt",begin:"^("+"[>?]>"+"|"+"[\\w#]+\\(\\w+\\):\\d+:\\d+[>*]"+"|"+"(\\w+-)?\\d+\\.\\d+\\.\\d+(p\\d+)?[^\\d][^>]+>"+")(?=[ ])",starts:{end:"$",keywords:a,contains:N}}];return u.unshift(c),{name:"Ruby",aliases:["rb","gemspec","podspec","thor","irb"],keywords:a,illegal:/\/\*/,contains:[e.SHEBANG({binary:"ruby"})].concat(O).concat(u).concat(N)}}function AZ(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"],c=["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:c,built_in:u},illegal:""},i]}}const CZ=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_-]*/}}),IZ=["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"],OZ=["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"],RZ=[...IZ,...OZ],LZ=["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(),MZ=["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(),jZ=["after","backdrop","before","cue","cue-region","first-letter","first-line","grammar-error","marker","part","placeholder","selection","slotted","spelling-error"].sort().reverse(),DZ=["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 PZ(e){const t=CZ(e),n=jZ,r=MZ,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("+RZ.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("+DZ.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:LZ.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 BZ(e){return{name:"Shell Session",aliases:["console","shellsession"],contains:[{className:"meta.prompt",begin:/^\s{0,3}[/~\w\d[\]()@-]*[>%$#][ ]?/,starts:{end:/[^\\](?=\s*$)/,subLanguage:"bash"}}]}}function FZ(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"],c=["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,...c].filter(k=>!d.includes(k)),y={scope:"variable",match:/@[a-z0-9][a-z0-9_]*/},E={scope:"operator",match:/[-+*/=%^~]|&&?|\|\|?|!=?|<(?:=>?|<|>)?|>[>=]?/,relevance:0},g={match:t.concat(/\b/,t.either(...p),/\s*\(/),relevance:0,keywords:{built_in:p}};function x(k){return t.concat(/\b/,t.either(...k.map(N=>N.replace(/\s+/,"\\s+"))),/\b/)}const b={scope:"keyword",match:x(h),relevance:0};function _(k,{exceptions:N,when:C}={}){const S=C;return N=N||[],k.map(A=>A.match(/\|\d+$/)||N.includes(A)?A:S(A)?`${A}|0`:A)}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:x(a)},b,g,y,r,s,e.C_NUMBER_MODE,e.C_BLOCK_COMMENT_MODE,n,E]}}function oj(e){return e?typeof e=="string"?e:e.source:null}function ku(e){return jt("(?=",e,")")}function jt(...e){return e.map(n=>oj(n)).join("")}function UZ(e){const t=e[e.length-1];return typeof t=="object"&&t.constructor===Object?(e.splice(e.length-1,1),t):{}}function wr(...e){return"("+(UZ(e).capture?"":"?:")+e.map(r=>oj(r)).join("|")+")"}const uv=e=>jt(/\b/,e,/\w$/.test(e)?/\b/:/\B/),$Z=["Protocol","Type"].map(uv),jT=["init","self"].map(uv),HZ=["Any","Self"],Uy=["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"],DT=["false","nil","true"],zZ=["assignment","associativity","higherThan","left","lowerThan","none","right"],VZ=["#colorLiteral","#column","#dsohandle","#else","#elseif","#endif","#error","#file","#fileID","#fileLiteral","#filePath","#function","#if","#imageLiteral","#keyPath","#line","#selector","#sourceLocation","#warning"],PT=["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"],lj=wr(/[/=\-+!*%<>&|^~?]/,/[\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]/),cj=wr(lj,/[\u0300-\u036F]/,/[\u1DC0-\u1DFF]/,/[\u20D0-\u20FF]/,/[\uFE00-\uFE0F]/,/[\uFE20-\uFE2F]/),$y=jt(lj,cj,"*"),uj=wr(/[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]/),Mm=wr(uj,/\d/,/[\u0300-\u036F\u1DC0-\u1DFF\u20D0-\u20FF\uFE20-\uFE2F]/),ci=jt(uj,Mm,"*"),Yh=jt(/[A-Z]/,Mm,"*"),KZ=["attached","autoclosure",jt(/convention\(/,wr("swift","block","c"),/\)/),"discardableResult","dynamicCallable","dynamicMemberLookup","escaping","freestanding","frozen","GKInspectable","IBAction","IBDesignable","IBInspectable","IBOutlet","IBSegueAction","inlinable","main","nonobjc","NSApplicationMain","NSCopying","NSManaged",jt(/objc\(/,ci,/\)/),"objc","objcMembers","propertyWrapper","requires_stored_property_inits","resultBuilder","Sendable","testable","UIApplicationMain","unchecked","unknown","usableFromInline","warn_unqualified_access"],YZ=["iOS","iOSApplicationExtension","macOS","macOSApplicationExtension","macCatalyst","macCatalystApplicationExtension","watchOS","watchOSApplicationExtension","tvOS","tvOSApplicationExtension","swift"];function GZ(e){const t={match:/\s+/,relevance:0},n=e.COMMENT("/\\*","\\*/",{contains:["self"]}),r=[e.C_LINE_COMMENT_MODE,n],s={match:[/\./,wr(...$Z,...jT)],className:{2:"keyword"}},i={match:jt(/\./,wr(...Uy)),relevance:0},a=Uy.filter(Te=>typeof Te=="string").concat(["_|0"]),o=Uy.filter(Te=>typeof Te!="string").concat(HZ).map(uv),c={variants:[{className:"keyword",match:wr(...o,...jT)}]},u={$pattern:wr(/\b\w+/,/#\w+/),keyword:a.concat(VZ),literal:DT},d=[s,i,c],f={match:jt(/\./,wr(...PT)),relevance:0},h={className:"built_in",match:jt(/\b/,wr(...PT),/(?=\()/)},p=[f,h],m={match:/->/,relevance:0},y={className:"operator",relevance:0,variants:[{match:$y},{match:`\\.(\\.|${cj})+`}]},E=[m,y],g="([0-9]_*)+",x="([0-9a-fA-F]_*)+",b={className:"number",relevance:0,variants:[{match:`\\b(${g})(\\.(${g}))?([eE][+-]?(${g}))?\\b`},{match:`\\b0x(${x})(\\.(${x}))?([pP][+-]?(${g}))?\\b`},{match:/\b0o([0-7]_*)+\b/},{match:/\b0b([01]_*)+\b/}]},_=(Te="")=>({className:"subst",variants:[{match:jt(/\\/,Te,/[0\\tnr"']/)},{match:jt(/\\/,Te,/u\{[0-9a-fA-F]{1,8}\}/)}]}),k=(Te="")=>({className:"subst",match:jt(/\\/,Te,/[\t ]*(?:[\r\n]|\r\n)/)}),N=(Te="")=>({className:"subst",label:"interpol",begin:jt(/\\/,Te,/\(/),end:/\)/}),C=(Te="")=>({begin:jt(Te,/"""/),end:jt(/"""/,Te),contains:[_(Te),k(Te),N(Te)]}),S=(Te="")=>({begin:jt(Te,/"/),end:jt(/"/,Te),contains:[_(Te),N(Te)]}),A={className:"string",variants:[C(),C("#"),C("##"),C("###"),S(),S("#"),S("##"),S("###")]},O=[e.BACKSLASH_ESCAPE,{begin:/\[/,end:/\]/,relevance:0,contains:[e.BACKSLASH_ESCAPE]}],D={begin:/\/[^\s](?=[^/\n]*\/)/,end:/\//,contains:O},F=Te=>{const Ge=jt(Te,/\//),ke=jt(/\//,Te);return{begin:Ge,end:ke,contains:[...O,{scope:"comment",begin:`#(?!.*${ke})`,end:/$/}]}},X={scope:"regexp",variants:[F("###"),F("##"),F("#"),D]},L={match:jt(/`/,ci,/`/)},j={className:"variable",match:/\$\d+/},T={className:"variable",match:`\\$${Mm}+`},R=[L,j,T],M={match:/(@|#(un)?)available/,scope:"keyword",starts:{contains:[{begin:/\(/,end:/\)/,keywords:YZ,contains:[...E,b,A]}]}},B={scope:"keyword",match:jt(/@/,wr(...KZ),ku(wr(/\(/,/\s+/)))},I={scope:"meta",match:jt(/@/,ci)},V=[M,B,I],G={match:ku(/\b[A-Z]/),relevance:0,contains:[{className:"type",match:jt(/(AV|CA|CF|CG|CI|CL|CM|CN|CT|MK|MP|MTK|MTL|NS|SCN|SK|UI|WK|XC)/,Mm,"+")},{className:"type",match:Yh,relevance:0},{match:/[?!]+/,relevance:0},{match:/\.\.\./,relevance:0},{match:jt(/\s+&\s+/,ku(Yh)),relevance:0}]},P={begin://,keywords:u,contains:[...r,...d,...V,m,G]};G.contains.push(P);const ie={match:jt(ci,/\s*:/),keywords:"_|0",relevance:0},q={begin:/\(/,end:/\)/,relevance:0,keywords:u,contains:["self",ie,...r,X,...d,...p,...E,b,A,...R,...V,G]},ne={begin://,keywords:"repeat each",contains:[...r,G]},oe={begin:wr(ku(jt(ci,/\s*:/)),ku(jt(ci,/\s+/,ci,/\s*:/))),end:/:/,relevance:0,contains:[{className:"keyword",match:/\b_\b/},{className:"params",match:ci}]},ee={begin:/\(/,end:/\)/,keywords:u,contains:[oe,...r,...d,...E,b,A,...V,G,q],endsParent:!0,illegal:/["']/},ce={match:[/(func|macro)/,/\s+/,wr(L.match,ci,$y)],className:{1:"keyword",3:"title.function"},contains:[ne,ee,t],illegal:[/\[/,/%/]},re={match:[/\b(?:subscript|init[?!]?)/,/\s*(?=[<(])/],className:{1:"keyword"},contains:[ne,ee,t],illegal:/\[|%/},pe={match:[/operator/,/\s+/,$y],className:{1:"keyword",3:"title"}},ye={begin:[/precedencegroup/,/\s+/,Yh],className:{1:"keyword",3:"title"},contains:[G],keywords:[...zZ,...DT],end:/}/},J={match:[/class\b/,/\s+/,/func\b/,/\s+/,/\b[A-Za-z_][A-Za-z0-9_]*\b/],scope:{1:"keyword",3:"keyword",5:"title.function"}},fe={match:[/class\b/,/\s+/,/var\b/],scope:{1:"keyword",3:"keyword"}},Ee={begin:[/(struct|protocol|class|extension|enum|actor)/,/\s+/,ci,/\s*/],beginScope:{1:"keyword",3:"title.class"},keywords:u,contains:[ne,...d,{begin:/:/,end:/\{/,keywords:u,contains:[{scope:"title.class.inherited",match:Yh},...d],relevance:0}]};for(const Te of A.variants){const Ge=Te.contains.find(rt=>rt.label==="interpol");Ge.keywords=u;const ke=[...d,...p,...E,b,A,...R];Ge.contains=[...ke,{begin:/\(/,end:/\)/,contains:["self",...ke]}]}return{name:"Swift",keywords:u,contains:[...r,ce,re,J,fe,Ee,pe,ye,{beginKeywords:"import",end:/$/,contains:[...r],relevance:0},X,...d,...p,...E,b,A,...R,...V,G,q]}}const jm="[A-Za-z$_][0-9A-Za-z$_]*",dj=["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"],fj=["true","false","null","undefined","NaN","Infinity"],hj=["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"],pj=["Error","EvalError","InternalError","RangeError","ReferenceError","SyntaxError","TypeError","URIError"],mj=["setInterval","setTimeout","clearInterval","clearTimeout","require","exports","eval","isFinite","isNaN","parseFloat","parseInt","decodeURI","decodeURIComponent","encodeURI","encodeURIComponent","escape","unescape"],gj=["arguments","this","super","console","window","document","localStorage","sessionStorage","module","global"],yj=[].concat(mj,hj,pj);function WZ(e){const t=e.regex,n=(M,{after:B})=>{const I="",end:""},i=/<[A-Za-z0-9\\._:-]+\s*\/>/,a={begin:/<[A-Za-z0-9\\._:-]+/,end:/\/[A-Za-z0-9\\._:-]+>|\/>/,isTrulyOpeningTag:(M,B)=>{const I=M[0].length+M.index,V=M.input[I];if(V==="<"||V===","){B.ignoreMatch();return}V===">"&&(n(M,{after:I})||B.ignoreMatch());let G;const P=M.input.substring(I);if(G=P.match(/^\s*=/)){B.ignoreMatch();return}if((G=P.match(/^\s+extends\s+/))&&G.index===0){B.ignoreMatch();return}}},o={$pattern:jm,keyword:dj,literal:fj,built_in:yj,"variable.language":gj},c="[0-9](_?[0-9])*",u=`\\.(${c})`,d="0|[1-9](_?[0-9])*|0[0-7]*[89][0-9]*",f={className:"number",variants:[{begin:`(\\b(${d})((${u})|\\.)?|(${u}))[eE][+-]?(${c})\\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"}},E={className:"string",begin:"`",end:"`",contains:[e.BACKSLASH_ESCAPE,h]},x={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,E,{match:/\$\d+/},f];h.contains=b.concat({begin:/\{/,end:/\}/,keywords:o,contains:["self"].concat(b)});const _=[].concat(x,h.contains),k=_.concat([{begin:/(\s*)\(/,end:/\)/,keywords:o,contains:["self"].concat(_)}]),N={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"}}]},S={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:{_:[...hj,...pj]}},A={label:"use_strict",className:"meta",relevance:10,begin:/^\s*['"]use (strict|asm)['"]/},O={variants:[{match:[/function/,/\s+/,r,/(?=\s*\()/]},{match:[/function/,/\s*(?=\()/]}],className:{1:"keyword",3:"title.function"},label:"func.def",contains:[N],illegal:/%/},D={relevance:0,match:/\b[A-Z][A-Z_0-9]+\b/,className:"variable.constant"};function F(M){return t.concat("(?!",M.join("|"),")")}const X={match:t.concat(/\b/,F([...mj,"super","import"].map(M=>`${M}\\s*\\(`)),r,t.lookahead(/\s*\(/)),className:"title.function",relevance:0},L={begin:t.concat(/\./,t.lookahead(t.concat(r,/(?![0-9A-Za-z$_(])/))),end:r,excludeBegin:!0,keywords:"prototype",className:"property",relevance:0},j={match:[/get|set/,/\s+/,r,/(?=\()/],className:{1:"keyword",3:"title.function"},contains:[{begin:/\(\)/},N]},T="(\\([^()]*(\\([^()]*(\\([^()]*\\)[^()]*)*\\)[^()]*)*\\)|"+e.UNDERSCORE_IDENT_RE+")\\s*=>",R={match:[/const|var|let/,/\s+/,r,/\s*/,/=\s*/,/(async\s*)?/,t.lookahead(T)],keywords:"async",className:{1:"keyword",3:"title.function"},contains:[N]};return{name:"JavaScript",aliases:["js","jsx","mjs","cjs"],keywords:o,exports:{PARAMS_CONTAINS:k,CLASS_REFERENCE:S},illegal:/#(?![$_A-z])/,contains:[e.SHEBANG({label:"shebang",binary:"node",relevance:5}),A,e.APOS_STRING_MODE,e.QUOTE_STRING_MODE,p,m,y,E,x,{match:/\$\d+/},f,S,{scope:"attr",match:r+t.lookahead(":"),relevance:0},R,{begin:"("+e.RE_STARTERS_RE+"|\\b(case|return|throw)\\b)\\s*",keywords:"return throw case",relevance:0,contains:[x,e.REGEXP_MODE,{className:"function",begin:T,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"]}]}]},O,{beginKeywords:"while if switch catch for"},{begin:"\\b(?!function)"+e.UNDERSCORE_IDENT_RE+"\\([^()]*(\\([^()]*(\\([^()]*\\)[^()]*)*\\)[^()]*)*\\)\\s*\\{",returnBegin:!0,label:"func.def",contains:[N,e.inherit(e.TITLE_MODE,{begin:r,className:"title.function"})]},{match:/\.\.\./,relevance:0},L,{match:"\\$"+r,relevance:0},{match:[/\bconstructor(?=\s*\()/],className:{1:"title.function"},contains:[N]},X,D,C,j,{match:/\$[(.]/}]}}function bj(e){const t=e.regex,n=WZ(e),r=jm,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['"]/},c=["type","interface","public","private","protected","implements","declare","abstract","readonly","enum","override","satisfies"],u={$pattern:jm,keyword:dj.concat(c),literal:fj,built_in:yj.concat(s),"variable.language":gj},d={className:"meta",begin:"@"+r},f=(y,E,g)=>{const x=y.contains.findIndex(b=>b.label===E);if(x===-1)throw new Error("can not find mode to replace");y.contains.splice(x,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 qZ(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}/,c={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,c,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 XZ(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/},c={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,c,u,o]}}function QZ(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"}),c=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,c,o,a,{begin:/\[/,end:/\]/,contains:[{className:"meta",begin://,contains:[i,a,c,o]}]}]},e.COMMENT(//,{relevance:10}),{begin://,relevance:10},s,{className:"meta",end:/\?>/,variants:[{begin:/<\?xml/,relevance:10,contains:[c]},{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 Ej(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},E=[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=[...E];return g.pop(),g.push(o),p.contains=g,{name:"YAML",case_insensitive:!0,aliases:["yml"],contains:E}}const ZZ={arduino:HQ,bash:W3,c:zQ,cpp:VQ,csharp:KQ,css:eZ,diff:tZ,go:nZ,graphql:rZ,ini:q3,java:sZ,javascript:ej,json:tj,kotlin:uZ,less:bZ,lua:EZ,makefile:sj,markdown:ij,objectivec:xZ,perl:wZ,php:vZ,"php-template":_Z,plaintext:kZ,python:aj,"python-repl":NZ,r:SZ,ruby:TZ,rust:AZ,scss:PZ,shell:BZ,sql:FZ,swift:GZ,typescript:bj,vbnet:qZ,wasm:XZ,xml:QZ,yaml:Ej};function xj(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)&&xj(n)}),e}let BT=class{constructor(t){t.data===void 0&&(t.data={}),this.data=t.data,this.isMatchIgnored=!1}ignoreMatch(){this.isMatchIgnored=!0}};function wj(e){return e.replace(/&/g,"&").replace(//g,">").replace(/"/g,""").replace(/'/g,"'")}function Sa(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 JZ="",FT=e=>!!e.scope,eJ=(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 tJ{constructor(t,n){this.buffer="",this.classPrefix=n.classPrefix,t.walk(this)}addText(t){this.buffer+=wj(t)}openNode(t){if(!FT(t))return;const n=eJ(t.scope,{prefix:this.classPrefix});this.span(n)}closeNode(t){FT(t)&&(this.buffer+=JZ)}value(){return this.buffer}span(t){this.buffer+=``}}const UT=(e={})=>{const t={children:[]};return Object.assign(t,e),t};class dv{constructor(){this.rootNode=UT(),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=UT({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=>{dv._collapse(n)}))}}class nJ extends dv{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 tJ(this,this.options).value()}finalize(){return this.closeAllNodes(),!0}}function tf(e){return e?typeof e=="string"?e:e.source:null}function vj(e){return Go("(?=",e,")")}function rJ(e){return Go("(?:",e,")*")}function sJ(e){return Go("(?:",e,")?")}function Go(...e){return e.map(n=>tf(n)).join("")}function iJ(e){const t=e[e.length-1];return typeof t=="object"&&t.constructor===Object?(e.splice(e.length-1,1),t):{}}function fv(...e){return"("+(iJ(e).capture?"":"?:")+e.map(r=>tf(r)).join("|")+")"}function _j(e){return new RegExp(e.toString()+"|").exec("").length-1}function aJ(e,t){const n=e&&e.exec(t);return n&&n.index===0}const oJ=/\[(?:[^\\\]]|\\.)*\]|\(\??|\\([1-9][0-9]*)|\\./;function hv(e,{joinWith:t}){let n=0;return e.map(r=>{n+=1;const s=n;let i=tf(r),a="";for(;i.length>0;){const o=oJ.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 lJ=/\b\B/,kj="[a-zA-Z]\\w*",pv="[a-zA-Z_]\\w*",Nj="\\b\\d+(\\.\\d+)?",Sj="(-?)(\\b0[xX][a-fA-F0-9]+|(\\b\\d+(\\.\\d*)?|\\.\\d+)([eE][-+]?\\d+)?)",Tj="\\b(0b[01]+)",cJ="!|!=|!==|%|%=|&|&&|&=|\\*|\\*=|\\+|\\+=|,|-|-=|/=|/|:|;|<<|<<=|<=|<|===|==|=|>>>=|>>=|>=|>>>|>>|>|\\?|\\[|\\{|\\(|\\^|\\^=|\\||\\|=|\\|\\||~",uJ=(e={})=>{const t=/^#![ ]*\//;return e.binary&&(e.begin=Go(t,/.*\b/,e.binary,/\b.*/)),Sa({scope:"meta",begin:t,end:/$/,relevance:0,"on:begin":(n,r)=>{n.index!==0&&r.ignoreMatch()}},e)},nf={begin:"\\\\[\\s\\S]",relevance:0},dJ={scope:"string",begin:"'",end:"'",illegal:"\\n",contains:[nf]},fJ={scope:"string",begin:'"',end:'"',illegal:"\\n",contains:[nf]},hJ={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/},Kg=function(e,t,n={}){const r=Sa({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=fv("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:Go(/[ ]+/,"(",s,/[.]?[:]?([.][ ]|[ ])/,"){3}")}),r},pJ=Kg("//","$"),mJ=Kg("/\\*","\\*/"),gJ=Kg("#","$"),yJ={scope:"number",begin:Nj,relevance:0},bJ={scope:"number",begin:Sj,relevance:0},EJ={scope:"number",begin:Tj,relevance:0},xJ={scope:"regexp",begin:/\/(?=[^/\n]*\/)/,end:/\/[gimuy]*/,contains:[nf,{begin:/\[/,end:/\]/,relevance:0,contains:[nf]}]},wJ={scope:"title",begin:kj,relevance:0},vJ={scope:"title",begin:pv,relevance:0},_J={begin:"\\.\\s*"+pv,relevance:0},kJ=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 Gh=Object.freeze({__proto__:null,APOS_STRING_MODE:dJ,BACKSLASH_ESCAPE:nf,BINARY_NUMBER_MODE:EJ,BINARY_NUMBER_RE:Tj,COMMENT:Kg,C_BLOCK_COMMENT_MODE:mJ,C_LINE_COMMENT_MODE:pJ,C_NUMBER_MODE:bJ,C_NUMBER_RE:Sj,END_SAME_AS_BEGIN:kJ,HASH_COMMENT_MODE:gJ,IDENT_RE:kj,MATCH_NOTHING_RE:lJ,METHOD_GUARD:_J,NUMBER_MODE:yJ,NUMBER_RE:Nj,PHRASAL_WORDS_MODE:hJ,QUOTE_STRING_MODE:fJ,REGEXP_MODE:xJ,RE_STARTERS_RE:cJ,SHEBANG:uJ,TITLE_MODE:wJ,UNDERSCORE_IDENT_RE:pv,UNDERSCORE_TITLE_MODE:vJ});function NJ(e,t){e.input[e.index-1]==="."&&t.ignoreMatch()}function SJ(e,t){e.className!==void 0&&(e.scope=e.className,delete e.className)}function TJ(e,t){t&&e.beginKeywords&&(e.begin="\\b("+e.beginKeywords.split(" ").join("|")+")(?!\\.)(?=\\b|\\s)",e.__beforeBegin=NJ,e.keywords=e.keywords||e.beginKeywords,delete e.beginKeywords,e.relevance===void 0&&(e.relevance=0))}function AJ(e,t){Array.isArray(e.illegal)&&(e.illegal=fv(...e.illegal))}function CJ(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 IJ(e,t){e.relevance===void 0&&(e.relevance=1)}const OJ=(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=Go(n.beforeMatch,vj(n.begin)),e.starts={relevance:0,contains:[Object.assign(n,{endsParent:!0})]},e.relevance=0,delete n.beforeMatch},RJ=["of","and","for","in","not","or","if","then","parent","list","value"],LJ="keyword";function Aj(e,t,n=LJ){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,Aj(e[i],t,i))}),r;function s(i,a){t&&(a=a.map(o=>o.toLowerCase())),a.forEach(function(o){const c=o.split("|");r[c[0]]=[i,MJ(c[0],c[1])]})}}function MJ(e,t){return t?Number(t):jJ(e)?0:1}function jJ(e){return RJ.includes(e.toLowerCase())}const $T={},_o=e=>{console.error(e)},HT=(e,...t)=>{console.log(`WARN: ${e}`,...t)},fl=(e,t)=>{$T[`${e}/${t}`]||(console.log(`Deprecated as of ${e}. ${t}`),$T[`${e}/${t}`]=!0)},Dm=new Error;function Cj(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+=_j(t[o-1]);e[n]=a,e[n]._emit=i,e[n]._multi=!0}function DJ(e){if(Array.isArray(e.begin)){if(e.skip||e.excludeBegin||e.returnBegin)throw _o("skip, excludeBegin, returnBegin not compatible with beginScope: {}"),Dm;if(typeof e.beginScope!="object"||e.beginScope===null)throw _o("beginScope must be object"),Dm;Cj(e,e.begin,{key:"beginScope"}),e.begin=hv(e.begin,{joinWith:""})}}function PJ(e){if(Array.isArray(e.end)){if(e.skip||e.excludeEnd||e.returnEnd)throw _o("skip, excludeEnd, returnEnd not compatible with endScope: {}"),Dm;if(typeof e.endScope!="object"||e.endScope===null)throw _o("endScope must be object"),Dm;Cj(e,e.end,{key:"endScope"}),e.end=hv(e.end,{joinWith:""})}}function BJ(e){e.scope&&typeof e.scope=="object"&&e.scope!==null&&(e.beginScope=e.scope,delete e.scope)}function FJ(e){BJ(e),typeof e.beginScope=="string"&&(e.beginScope={_wrap:e.beginScope}),typeof e.endScope=="string"&&(e.endScope={_wrap:e.endScope}),DJ(e),PJ(e)}function UJ(e){function t(a,o){return new RegExp(tf(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,c){c.position=this.position++,this.matchIndexes[this.matchAt]=c,this.regexes.push([c,o]),this.matchAt+=_j(o)+1}compile(){this.regexes.length===0&&(this.exec=()=>null);const o=this.regexes.map(c=>c[1]);this.matcherRe=t(hv(o,{joinWith:"|"}),!0),this.lastIndex=0}exec(o){this.matcherRe.lastIndex=this.lastIndex;const c=this.matcherRe.exec(o);if(!c)return null;const u=c.findIndex((f,h)=>h>0&&f!==void 0),d=this.matchIndexes[u];return c.splice(0,u),Object.assign(c,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 c=new n;return this.rules.slice(o).forEach(([u,d])=>c.addRule(u,d)),c.compile(),this.multiRegexes[o]=c,c}resumingScanAtSamePosition(){return this.regexIndex!==0}considerAll(){this.regexIndex=0}addRule(o,c){this.rules.push([o,c]),c.type==="begin"&&this.count++}exec(o){const c=this.getMatcher(this.regexIndex);c.lastIndex=this.lastIndex;let u=c.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(c=>o.addRule(c.begin,{rule:c,type:"begin"})),a.terminatorEnd&&o.addRule(a.terminatorEnd,{type:"end"}),a.illegal&&o.addRule(a.illegal,{type:"illegal"}),o}function i(a,o){const c=a;if(a.isCompiled)return c;[SJ,CJ,FJ,OJ].forEach(d=>d(a,o)),e.compilerExtensions.forEach(d=>d(a,o)),a.__beforeBegin=null,[TJ,AJ,IJ].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=Aj(a.keywords,e.case_insensitive)),c.keywordPatternRe=t(u,!0),o&&(a.begin||(a.begin=/\B|\b/),c.beginRe=t(c.begin),!a.end&&!a.endsWithParent&&(a.end=/\B|\b/),a.end&&(c.endRe=t(c.end)),c.terminatorEnd=tf(c.end)||"",a.endsWithParent&&o.terminatorEnd&&(c.terminatorEnd+=(a.end?"|":"")+o.terminatorEnd)),a.illegal&&(c.illegalRe=t(a.illegal)),a.contains||(a.contains=[]),a.contains=[].concat(...a.contains.map(function(d){return $J(d==="self"?a:d)})),a.contains.forEach(function(d){i(d,c)}),a.starts&&i(a.starts,o),c.matcher=s(c),c}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=Sa(e.classNameAliases||{}),i(e)}function Ij(e){return e?e.endsWithParent||Ij(e.starts):!1}function $J(e){return e.variants&&!e.cachedVariants&&(e.cachedVariants=e.variants.map(function(t){return Sa(e,{variants:null},t)})),e.cachedVariants?e.cachedVariants:Ij(e)?Sa(e,{starts:e.starts?Sa(e.starts):null}):Object.isFrozen(e)?Sa(e):e}var HJ="11.11.1";class zJ extends Error{constructor(t,n){super(t),this.name="HTMLInjectionError",this.html=n}}const Hy=wj,zT=Sa,VT=Symbol("nomatch"),VJ=7,Oj=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:nJ};function c(T){return o.noHighlightRe.test(T)}function u(T){let R=T.className+" ";R+=T.parentNode?T.parentNode.className:"";const M=o.languageDetectRe.exec(R);if(M){const B=S(M[1]);return B||(HT(i.replace("{}",M[1])),HT("Falling back to no-highlight mode for this block.",T)),B?M[1]:"no-highlight"}return R.split(/\s+/).find(B=>c(B)||S(B))}function d(T,R,M){let B="",I="";typeof R=="object"?(B=T,M=R.ignoreIllegals,I=R.language):(fl("10.7.0","highlight(lang, code, ...args) has been deprecated."),fl("10.7.0",`Please use highlight(code, options) instead. +https://github.com/highlightjs/highlight.js/issues/2277`),I=T,B=R),M===void 0&&(M=!0);const V={code:B,language:I};L("before:highlight",V);const G=V.result?V.result:f(V.language,V.code,M);return G.code=V.code,L("after:highlight",G),G}function f(T,R,M,B){const I=Object.create(null);function V(H,Z){return H.keywords[Z]}function G(){if(!ke.keywords){ze.addText(We);return}let H=0;ke.keywordPatternRe.lastIndex=0;let Z=ke.keywordPatternRe.exec(We),le="";for(;Z;){le+=We.substring(H,Z.index);const be=Ee.case_insensitive?Z[0].toLowerCase():Z[0],Le=V(ke,be);if(Le){const[Ke,Ot]=Le;if(ze.addText(le),le="",I[be]=(I[be]||0)+1,I[be]<=VJ&&(yt+=Ot),Ke.startsWith("_"))le+=Z[0];else{const He=Ee.classNameAliases[Ke]||Ke;q(Z[0],He)}}else le+=Z[0];H=ke.keywordPatternRe.lastIndex,Z=ke.keywordPatternRe.exec(We)}le+=We.substring(H),ze.addText(le)}function P(){if(We==="")return;let H=null;if(typeof ke.subLanguage=="string"){if(!t[ke.subLanguage]){ze.addText(We);return}H=f(ke.subLanguage,We,!0,rt[ke.subLanguage]),rt[ke.subLanguage]=H._top}else H=p(We,ke.subLanguage.length?ke.subLanguage:null);ke.relevance>0&&(yt+=H.relevance),ze.__addSublanguage(H._emitter,H.language)}function ie(){ke.subLanguage!=null?P():G(),We=""}function q(H,Z){H!==""&&(ze.startScope(Z),ze.addText(H),ze.endScope())}function ne(H,Z){let le=1;const be=Z.length-1;for(;le<=be;){if(!H._emit[le]){le++;continue}const Le=Ee.classNameAliases[H[le]]||H[le],Ke=Z[le];Le?q(Ke,Le):(We=Ke,G(),We=""),le++}}function oe(H,Z){return H.scope&&typeof H.scope=="string"&&ze.openNode(Ee.classNameAliases[H.scope]||H.scope),H.beginScope&&(H.beginScope._wrap?(q(We,Ee.classNameAliases[H.beginScope._wrap]||H.beginScope._wrap),We=""):H.beginScope._multi&&(ne(H.beginScope,Z),We="")),ke=Object.create(H,{parent:{value:ke}}),ke}function ee(H,Z,le){let be=aJ(H.endRe,le);if(be){if(H["on:end"]){const Le=new BT(H);H["on:end"](Z,Le),Le.isMatchIgnored&&(be=!1)}if(be){for(;H.endsParent&&H.parent;)H=H.parent;return H}}if(H.endsWithParent)return ee(H.parent,Z,le)}function ce(H){return ke.matcher.regexIndex===0?(We+=H[0],1):(Tt=!0,0)}function re(H){const Z=H[0],le=H.rule,be=new BT(le),Le=[le.__beforeBegin,le["on:begin"]];for(const Ke of Le)if(Ke&&(Ke(H,be),be.isMatchIgnored))return ce(Z);return le.skip?We+=Z:(le.excludeBegin&&(We+=Z),ie(),!le.returnBegin&&!le.excludeBegin&&(We=Z)),oe(le,H),le.returnBegin?0:Z.length}function pe(H){const Z=H[0],le=R.substring(H.index),be=ee(ke,H,le);if(!be)return VT;const Le=ke;ke.endScope&&ke.endScope._wrap?(ie(),q(Z,ke.endScope._wrap)):ke.endScope&&ke.endScope._multi?(ie(),ne(ke.endScope,H)):Le.skip?We+=Z:(Le.returnEnd||Le.excludeEnd||(We+=Z),ie(),Le.excludeEnd&&(We=Z));do ke.scope&&ze.closeNode(),!ke.skip&&!ke.subLanguage&&(yt+=ke.relevance),ke=ke.parent;while(ke!==be.parent);return be.starts&&oe(be.starts,H),Le.returnEnd?0:Z.length}function ye(){const H=[];for(let Z=ke;Z!==Ee;Z=Z.parent)Z.scope&&H.unshift(Z.scope);H.forEach(Z=>ze.openNode(Z))}let J={};function fe(H,Z){const le=Z&&Z[0];if(We+=H,le==null)return ie(),0;if(J.type==="begin"&&Z.type==="end"&&J.index===Z.index&&le===""){if(We+=R.slice(Z.index,Z.index+1),!s){const be=new Error(`0 width match regex (${T})`);throw be.languageName=T,be.badRule=J.rule,be}return 1}if(J=Z,Z.type==="begin")return re(Z);if(Z.type==="illegal"&&!M){const be=new Error('Illegal lexeme "'+le+'" for mode "'+(ke.scope||"")+'"');throw be.mode=ke,be}else if(Z.type==="end"){const be=pe(Z);if(be!==VT)return be}if(Z.type==="illegal"&&le==="")return We+=` +`,1;if(St>1e5&&St>Z.index*3)throw new Error("potential infinite loop, way more iterations than matches");return We+=le,le.length}const Ee=S(T);if(!Ee)throw _o(i.replace("{}",T)),new Error('Unknown language: "'+T+'"');const Te=UJ(Ee);let Ge="",ke=B||Te;const rt={},ze=new o.__emitter(o);ye();let We="",yt=0,at=0,St=0,Tt=!1;try{if(Ee.__emitTokens)Ee.__emitTokens(R,ze);else{for(ke.matcher.considerAll();;){St++,Tt?Tt=!1:ke.matcher.considerAll(),ke.matcher.lastIndex=at;const H=ke.matcher.exec(R);if(!H)break;const Z=R.substring(at,H.index),le=fe(Z,H);at=H.index+le}fe(R.substring(at))}return ze.finalize(),Ge=ze.toHTML(),{language:T,value:Ge,relevance:yt,illegal:!1,_emitter:ze,_top:ke}}catch(H){if(H.message&&H.message.includes("Illegal"))return{language:T,value:Hy(R),illegal:!0,relevance:0,_illegalBy:{message:H.message,index:at,context:R.slice(at-100,at+100),mode:H.mode,resultSoFar:Ge},_emitter:ze};if(s)return{language:T,value:Hy(R),illegal:!1,relevance:0,errorRaised:H,_emitter:ze,_top:ke};throw H}}function h(T){const R={value:Hy(T),illegal:!1,relevance:0,_top:a,_emitter:new o.__emitter(o)};return R._emitter.addText(T),R}function p(T,R){R=R||o.languages||Object.keys(t);const M=h(T),B=R.filter(S).filter(O).map(ie=>f(ie,T,!1));B.unshift(M);const I=B.sort((ie,q)=>{if(ie.relevance!==q.relevance)return q.relevance-ie.relevance;if(ie.language&&q.language){if(S(ie.language).supersetOf===q.language)return 1;if(S(q.language).supersetOf===ie.language)return-1}return 0}),[V,G]=I,P=V;return P.secondBest=G,P}function m(T,R,M){const B=R&&n[R]||M;T.classList.add("hljs"),T.classList.add(`language-${B}`)}function y(T){let R=null;const M=u(T);if(c(M))return;if(L("before:highlightElement",{el:T,language:M}),T.dataset.highlighted){console.log("Element previously highlighted. To highlight again, first unset `dataset.highlighted`.",T);return}if(T.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(T)),o.throwUnescapedHTML))throw new zJ("One of your code blocks includes unescaped HTML.",T.innerHTML);R=T;const B=R.textContent,I=M?d(B,{language:M,ignoreIllegals:!0}):p(B);T.innerHTML=I.value,T.dataset.highlighted="yes",m(T,M,I.language),T.result={language:I.language,re:I.relevance,relevance:I.relevance},I.secondBest&&(T.secondBest={language:I.secondBest.language,relevance:I.secondBest.relevance}),L("after:highlightElement",{el:T,result:I,text:B})}function E(T){o=zT(o,T)}const g=()=>{_(),fl("10.6.0","initHighlighting() deprecated. Use highlightAll() now.")};function x(){_(),fl("10.6.0","initHighlightingOnLoad() deprecated. Use highlightAll() now.")}let b=!1;function _(){function T(){_()}if(document.readyState==="loading"){b||window.addEventListener("DOMContentLoaded",T,!1),b=!0;return}document.querySelectorAll(o.cssSelector).forEach(y)}function k(T,R){let M=null;try{M=R(e)}catch(B){if(_o("Language definition for '{}' could not be registered.".replace("{}",T)),s)_o(B);else throw B;M=a}M.name||(M.name=T),t[T]=M,M.rawDefinition=R.bind(null,e),M.aliases&&A(M.aliases,{languageName:T})}function N(T){delete t[T];for(const R of Object.keys(n))n[R]===T&&delete n[R]}function C(){return Object.keys(t)}function S(T){return T=(T||"").toLowerCase(),t[T]||t[n[T]]}function A(T,{languageName:R}){typeof T=="string"&&(T=[T]),T.forEach(M=>{n[M.toLowerCase()]=R})}function O(T){const R=S(T);return R&&!R.disableAutodetect}function D(T){T["before:highlightBlock"]&&!T["before:highlightElement"]&&(T["before:highlightElement"]=R=>{T["before:highlightBlock"](Object.assign({block:R.el},R))}),T["after:highlightBlock"]&&!T["after:highlightElement"]&&(T["after:highlightElement"]=R=>{T["after:highlightBlock"](Object.assign({block:R.el},R))})}function F(T){D(T),r.push(T)}function X(T){const R=r.indexOf(T);R!==-1&&r.splice(R,1)}function L(T,R){const M=T;r.forEach(function(B){B[M]&&B[M](R)})}function j(T){return fl("10.7.0","highlightBlock will be removed entirely in v12.0"),fl("10.7.0","Please use highlightElement now."),y(T)}Object.assign(e,{highlight:d,highlightAuto:p,highlightAll:_,highlightElement:y,highlightBlock:j,configure:E,initHighlighting:g,initHighlightingOnLoad:x,registerLanguage:k,unregisterLanguage:N,listLanguages:C,getLanguage:S,registerAliases:A,autoDetection:O,inherit:zT,addPlugin:F,removePlugin:X}),e.debugMode=function(){s=!1},e.safeMode=function(){s=!0},e.versionString=HJ,e.regex={concat:Go,lookahead:vj,either:fv,optional:sJ,anyNumberOfTimes:rJ};for(const T in Gh)typeof Gh[T]=="object"&&xj(Gh[T]);return Object.assign(e,Gh),e},Ac=Oj({});Ac.newInstance=()=>Oj({});var KJ=Ac;Ac.HighlightJS=Ac;Ac.default=Ac;const $r=yf(KJ),KT={},YJ="hljs-";function GJ(e){const t=$r.newInstance();return e&&i(e),{highlight:n,highlightAuto:r,listLanguages:s,register:i,registerAlias:a,registered:o};function n(c,u,d){const f=d||KT,h=typeof f.prefix=="string"?f.prefix:YJ;if(!t.getLanguage(c))throw new Error("Unknown language: `"+c+"` is not registered");t.configure({__emitter:WJ,classPrefix:h});const p=t.highlight(u,{ignoreIllegals:!0,language:c});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(c,u){const f=(u||KT).subset||s();let h=-1,p=0,m;for(;++hp&&(p=E.data.relevance,m=E)}return m||{type:"root",children:[],data:{language:void 0,relevance:p}}}function s(){return t.listLanguages()}function i(c,u){if(typeof c=="string")t.registerLanguage(c,u);else{let d;for(d in c)Object.hasOwn(c,d)&&t.registerLanguage(d,c[d])}}function a(c,u){if(typeof c=="string")t.registerAliases(typeof u=="string"?u:[...u],{languageName:c});else{let d;for(d in c)if(Object.hasOwn(c,d)){const f=c[d];t.registerAliases(typeof f=="string"?f:[...f],{languageName:d})}}}function o(c){return!!t.getLanguage(c)}}class WJ{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 qJ={};function YT(e){const t=e||qJ,n=t.aliases,r=t.detect||!1,s=t.languages||ZZ,i=t.plainText,a=t.prefix,o=t.subset;let c="hljs";const u=GJ(s);if(n&&u.registerAlias(n),a){const d=a.indexOf("-");c=d===-1?a:a.slice(0,d)}return function(d,f){Lf(d,"element",function(h,p,m){if(h.tagName!=="code"||!m||m.type!=="element"||m.tagName!=="pre")return;const y=XJ(h);if(y===!1||!y&&!r||y&&i&&i.includes(y))return;Array.isArray(h.properties.className)||(h.properties.className=[]),h.properties.className.includes(c)||h.properties.className.unshift(c);const E=LQ(h,{whitespace:"pre"});let g;try{g=y?u.highlight(y,E,{prefix:a}):u.highlightAuto(E,{prefix:a,subset:o})}catch(x){const b=x;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 XJ(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 c=qT(t,n[a-1]);o=c===-1?t.length+1:c+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 vee(e){return e>=56320&&e<=57343}function _ee(e,t){return(e-55296)*1024+9216+t}function Pj(e){return e!==32&&e!==10&&e!==13&&e!==9&&e!==12&&e>=1&&e<=31||e>=127&&e<=159}function Bj(e){return e>=64976&&e<=65007||wee.has(e)}var ue;(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"})(ue||(ue={}));const kee=65536;class Nee{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=kee,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(vee(n))return this.pos++,this._addGap(),_ee(t,n)}else if(!this.lastChunkWritten)return this.endOfChunkHit=!0,$.EOF;return this._err(ue.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,$.EOF;const r=this.html.charCodeAt(n);return r===$.CARRIAGE_RETURN?$.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,$.EOF;let t=this.html.charCodeAt(this.pos);return t===$.CARRIAGE_RETURN?(this.isEol=!0,this.skipNextNewLine=!0,$.LINE_FEED):t===$.LINE_FEED&&(this.isEol=!0,this.skipNextNewLine)?(this.line--,this.skipNextNewLine=!1,this._addGap(),this.advance()):(this.skipNextNewLine=!1,Dj(t)&&(t=this._processSurrogate(t)),this.handler.onParseError===null||t>31&&t<127||t===$.LINE_FEED||t===$.CARRIAGE_RETURN||t>159&&t<64976||this._checkForProblematicCharacters(t),t)}_checkForProblematicCharacters(t){Pj(t)?this._err(ue.controlCharacterInInputStream):Bj(t)&&this._err(ue.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 See=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))),Tee=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 Aee(e){var t;return e>=55296&&e<=57343||e>1114111?65533:(t=Tee.get(e))!==null&&t!==void 0?t:e}var Xn;(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"})(Xn||(Xn={}));const Cee=32;var Ta;(function(e){e[e.VALUE_LENGTH=49152]="VALUE_LENGTH",e[e.BRANCH_LENGTH=16256]="BRANCH_LENGTH",e[e.JUMP_TABLE=127]="JUMP_TABLE"})(Ta||(Ta={}));function bE(e){return e>=Xn.ZERO&&e<=Xn.NINE}function Iee(e){return e>=Xn.UPPER_A&&e<=Xn.UPPER_F||e>=Xn.LOWER_A&&e<=Xn.LOWER_F}function Oee(e){return e>=Xn.UPPER_A&&e<=Xn.UPPER_Z||e>=Xn.LOWER_A&&e<=Xn.LOWER_Z||bE(e)}function Ree(e){return e===Xn.EQUALS||Oee(e)}var Wn;(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"})(Wn||(Wn={}));var $i;(function(e){e[e.Legacy=0]="Legacy",e[e.Strict=1]="Strict",e[e.Attribute=2]="Attribute"})($i||($i={}));class Lee{constructor(t,n,r){this.decodeTree=t,this.emitCodePoint=n,this.errors=r,this.state=Wn.EntityStart,this.consumed=1,this.result=0,this.treeIndex=0,this.excess=1,this.decodeMode=$i.Strict}startEntity(t){this.decodeMode=t,this.state=Wn.EntityStart,this.result=0,this.treeIndex=0,this.excess=1,this.consumed=1}write(t,n){switch(this.state){case Wn.EntityStart:return t.charCodeAt(n)===Xn.NUM?(this.state=Wn.NumericStart,this.consumed+=1,this.stateNumericStart(t,n+1)):(this.state=Wn.NamedEntity,this.stateNamedEntity(t,n));case Wn.NumericStart:return this.stateNumericStart(t,n);case Wn.NumericDecimal:return this.stateNumericDecimal(t,n);case Wn.NumericHex:return this.stateNumericHex(t,n);case Wn.NamedEntity:return this.stateNamedEntity(t,n)}}stateNumericStart(t,n){return n>=t.length?-1:(t.charCodeAt(n)|Cee)===Xn.LOWER_X?(this.state=Wn.NumericHex,this.consumed+=1,this.stateNumericHex(t,n+1)):(this.state=Wn.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===Xn.SEMI)return this.emitNamedEntityData(this.treeIndex,i,this.consumed+this.excess);this.decodeMode!==$i.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]&Ta.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]&~Ta.VALUE_LENGTH:s[t+1],r),n===3&&this.emitCodePoint(s[t+2],r),r}end(){var t;switch(this.state){case Wn.NamedEntity:return this.result!==0&&(this.decodeMode!==$i.Attribute||this.result===this.treeIndex)?this.emitNotTerminatedNamedEntity():0;case Wn.NumericDecimal:return this.emitNumericEntity(0,2);case Wn.NumericHex:return this.emitNumericEntity(0,3);case Wn.NumericStart:return(t=this.errors)===null||t===void 0||t.absenceOfDigitsInNumericCharacterReference(this.consumed),0;case Wn.EntityStart:return 0}}}function Mee(e,t,n,r){const s=(t&Ta.BRANCH_LENGTH)>>7,i=t&Ta.JUMP_TABLE;if(s===0)return i!==0&&r===i?n:-1;if(i){const c=r-i;return c<0||c>=s?-1:e[n+c]-1}let a=n,o=a+s-1;for(;a<=o;){const c=a+o>>>1,u=e[c];if(ur)o=c-1;else return e[c+s]}return-1}var we;(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/"})(we||(we={}));var ko;(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"})(ko||(ko={}));var gs;(function(e){e.NO_QUIRKS="no-quirks",e.QUIRKS="quirks",e.LIMITED_QUIRKS="limited-quirks"})(gs||(gs={}));var se;(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"})(se||(se={}));var v;(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"})(v||(v={}));const jee=new Map([[se.A,v.A],[se.ADDRESS,v.ADDRESS],[se.ANNOTATION_XML,v.ANNOTATION_XML],[se.APPLET,v.APPLET],[se.AREA,v.AREA],[se.ARTICLE,v.ARTICLE],[se.ASIDE,v.ASIDE],[se.B,v.B],[se.BASE,v.BASE],[se.BASEFONT,v.BASEFONT],[se.BGSOUND,v.BGSOUND],[se.BIG,v.BIG],[se.BLOCKQUOTE,v.BLOCKQUOTE],[se.BODY,v.BODY],[se.BR,v.BR],[se.BUTTON,v.BUTTON],[se.CAPTION,v.CAPTION],[se.CENTER,v.CENTER],[se.CODE,v.CODE],[se.COL,v.COL],[se.COLGROUP,v.COLGROUP],[se.DD,v.DD],[se.DESC,v.DESC],[se.DETAILS,v.DETAILS],[se.DIALOG,v.DIALOG],[se.DIR,v.DIR],[se.DIV,v.DIV],[se.DL,v.DL],[se.DT,v.DT],[se.EM,v.EM],[se.EMBED,v.EMBED],[se.FIELDSET,v.FIELDSET],[se.FIGCAPTION,v.FIGCAPTION],[se.FIGURE,v.FIGURE],[se.FONT,v.FONT],[se.FOOTER,v.FOOTER],[se.FOREIGN_OBJECT,v.FOREIGN_OBJECT],[se.FORM,v.FORM],[se.FRAME,v.FRAME],[se.FRAMESET,v.FRAMESET],[se.H1,v.H1],[se.H2,v.H2],[se.H3,v.H3],[se.H4,v.H4],[se.H5,v.H5],[se.H6,v.H6],[se.HEAD,v.HEAD],[se.HEADER,v.HEADER],[se.HGROUP,v.HGROUP],[se.HR,v.HR],[se.HTML,v.HTML],[se.I,v.I],[se.IMG,v.IMG],[se.IMAGE,v.IMAGE],[se.INPUT,v.INPUT],[se.IFRAME,v.IFRAME],[se.KEYGEN,v.KEYGEN],[se.LABEL,v.LABEL],[se.LI,v.LI],[se.LINK,v.LINK],[se.LISTING,v.LISTING],[se.MAIN,v.MAIN],[se.MALIGNMARK,v.MALIGNMARK],[se.MARQUEE,v.MARQUEE],[se.MATH,v.MATH],[se.MENU,v.MENU],[se.META,v.META],[se.MGLYPH,v.MGLYPH],[se.MI,v.MI],[se.MO,v.MO],[se.MN,v.MN],[se.MS,v.MS],[se.MTEXT,v.MTEXT],[se.NAV,v.NAV],[se.NOBR,v.NOBR],[se.NOFRAMES,v.NOFRAMES],[se.NOEMBED,v.NOEMBED],[se.NOSCRIPT,v.NOSCRIPT],[se.OBJECT,v.OBJECT],[se.OL,v.OL],[se.OPTGROUP,v.OPTGROUP],[se.OPTION,v.OPTION],[se.P,v.P],[se.PARAM,v.PARAM],[se.PLAINTEXT,v.PLAINTEXT],[se.PRE,v.PRE],[se.RB,v.RB],[se.RP,v.RP],[se.RT,v.RT],[se.RTC,v.RTC],[se.RUBY,v.RUBY],[se.S,v.S],[se.SCRIPT,v.SCRIPT],[se.SEARCH,v.SEARCH],[se.SECTION,v.SECTION],[se.SELECT,v.SELECT],[se.SOURCE,v.SOURCE],[se.SMALL,v.SMALL],[se.SPAN,v.SPAN],[se.STRIKE,v.STRIKE],[se.STRONG,v.STRONG],[se.STYLE,v.STYLE],[se.SUB,v.SUB],[se.SUMMARY,v.SUMMARY],[se.SUP,v.SUP],[se.TABLE,v.TABLE],[se.TBODY,v.TBODY],[se.TEMPLATE,v.TEMPLATE],[se.TEXTAREA,v.TEXTAREA],[se.TFOOT,v.TFOOT],[se.TD,v.TD],[se.TH,v.TH],[se.THEAD,v.THEAD],[se.TITLE,v.TITLE],[se.TR,v.TR],[se.TRACK,v.TRACK],[se.TT,v.TT],[se.U,v.U],[se.UL,v.UL],[se.SVG,v.SVG],[se.VAR,v.VAR],[se.WBR,v.WBR],[se.XMP,v.XMP]]);function Zc(e){var t;return(t=jee.get(e))!==null&&t!==void 0?t:v.UNKNOWN}const _e=v,Dee={[we.HTML]:new Set([_e.ADDRESS,_e.APPLET,_e.AREA,_e.ARTICLE,_e.ASIDE,_e.BASE,_e.BASEFONT,_e.BGSOUND,_e.BLOCKQUOTE,_e.BODY,_e.BR,_e.BUTTON,_e.CAPTION,_e.CENTER,_e.COL,_e.COLGROUP,_e.DD,_e.DETAILS,_e.DIR,_e.DIV,_e.DL,_e.DT,_e.EMBED,_e.FIELDSET,_e.FIGCAPTION,_e.FIGURE,_e.FOOTER,_e.FORM,_e.FRAME,_e.FRAMESET,_e.H1,_e.H2,_e.H3,_e.H4,_e.H5,_e.H6,_e.HEAD,_e.HEADER,_e.HGROUP,_e.HR,_e.HTML,_e.IFRAME,_e.IMG,_e.INPUT,_e.LI,_e.LINK,_e.LISTING,_e.MAIN,_e.MARQUEE,_e.MENU,_e.META,_e.NAV,_e.NOEMBED,_e.NOFRAMES,_e.NOSCRIPT,_e.OBJECT,_e.OL,_e.P,_e.PARAM,_e.PLAINTEXT,_e.PRE,_e.SCRIPT,_e.SECTION,_e.SELECT,_e.SOURCE,_e.STYLE,_e.SUMMARY,_e.TABLE,_e.TBODY,_e.TD,_e.TEMPLATE,_e.TEXTAREA,_e.TFOOT,_e.TH,_e.THEAD,_e.TITLE,_e.TR,_e.TRACK,_e.UL,_e.WBR,_e.XMP]),[we.MATHML]:new Set([_e.MI,_e.MO,_e.MN,_e.MS,_e.MTEXT,_e.ANNOTATION_XML]),[we.SVG]:new Set([_e.TITLE,_e.FOREIGN_OBJECT,_e.DESC]),[we.XLINK]:new Set,[we.XML]:new Set,[we.XMLNS]:new Set},EE=new Set([_e.H1,_e.H2,_e.H3,_e.H4,_e.H5,_e.H6]);se.STYLE,se.SCRIPT,se.XMP,se.IFRAME,se.NOEMBED,se.NOFRAMES,se.PLAINTEXT;var z;(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"})(z||(z={}));const Cn={DATA:z.DATA,RCDATA:z.RCDATA,RAWTEXT:z.RAWTEXT,SCRIPT_DATA:z.SCRIPT_DATA,PLAINTEXT:z.PLAINTEXT,CDATA_SECTION:z.CDATA_SECTION};function Pee(e){return e>=$.DIGIT_0&&e<=$.DIGIT_9}function zu(e){return e>=$.LATIN_CAPITAL_A&&e<=$.LATIN_CAPITAL_Z}function Bee(e){return e>=$.LATIN_SMALL_A&&e<=$.LATIN_SMALL_Z}function ma(e){return Bee(e)||zu(e)}function QT(e){return ma(e)||Pee(e)}function Wh(e){return e+32}function Uj(e){return e===$.SPACE||e===$.LINE_FEED||e===$.TABULATION||e===$.FORM_FEED}function ZT(e){return Uj(e)||e===$.SOLIDUS||e===$.GREATER_THAN_SIGN}function Fee(e){return e===$.NULL?ue.nullCharacterReference:e>1114111?ue.characterReferenceOutsideUnicodeRange:Dj(e)?ue.surrogateCharacterReference:Bj(e)?ue.noncharacterCharacterReference:Pj(e)||e===$.CARRIAGE_RETURN?ue.controlCharacterReference:null}class Uee{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=z.DATA,this.returnState=z.DATA,this.entityStartPos=0,this.consumedAfterSnapshot=-1,this.currentCharacterToken=null,this.currentToken=null,this.currentAttr={name:"",value:""},this.preprocessor=new Nee(n),this.currentLocation=this.getCurrentLocation(-1),this.entityDecoder=new Lee(See,(r,s)=>{this.preprocessor.pos=this.entityStartPos+s-1,this._flushCodePointConsumedAsCharacterReference(r)},n.onParseError?{missingSemicolonAfterCharacterReference:()=>{this._err(ue.missingSemicolonAfterCharacterReference,1)},absenceOfDigitsInNumericCharacterReference:r=>{this._err(ue.absenceOfDigitsInNumericCharacterReference,this.entityStartPos-this.preprocessor.pos+r)},validateNumericCharacterReference:r=>{const s=Fee(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(ue.endTagWithAttributes),t.selfClosing&&this._err(ue.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 gt.CHARACTER:{this.handler.onCharacter(this.currentCharacterToken);break}case gt.NULL_CHARACTER:{this.handler.onNullCharacter(this.currentCharacterToken);break}case gt.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:gt.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=Uj(t)?gt.WHITESPACE_CHARACTER:t===$.NULL?gt.NULL_CHARACTER:gt.CHARACTER;this._appendCharToCurrentCharacterToken(n,String.fromCodePoint(t))}_emitChars(t){this._appendCharToCurrentCharacterToken(gt.CHARACTER,t)}_startCharacterReference(){this.returnState=this.state,this.state=z.CHARACTER_REFERENCE,this.entityStartPos=this.preprocessor.pos,this.entityDecoder.startEntity(this._isCharacterReferenceInAttribute()?$i.Attribute:$i.Legacy)}_isCharacterReferenceInAttribute(){return this.returnState===z.ATTRIBUTE_VALUE_DOUBLE_QUOTED||this.returnState===z.ATTRIBUTE_VALUE_SINGLE_QUOTED||this.returnState===z.ATTRIBUTE_VALUE_UNQUOTED}_flushCodePointConsumedAsCharacterReference(t){this._isCharacterReferenceInAttribute()?this.currentAttr.value+=String.fromCodePoint(t):this._emitCodePoint(t)}_callState(t){switch(this.state){case z.DATA:{this._stateData(t);break}case z.RCDATA:{this._stateRcdata(t);break}case z.RAWTEXT:{this._stateRawtext(t);break}case z.SCRIPT_DATA:{this._stateScriptData(t);break}case z.PLAINTEXT:{this._statePlaintext(t);break}case z.TAG_OPEN:{this._stateTagOpen(t);break}case z.END_TAG_OPEN:{this._stateEndTagOpen(t);break}case z.TAG_NAME:{this._stateTagName(t);break}case z.RCDATA_LESS_THAN_SIGN:{this._stateRcdataLessThanSign(t);break}case z.RCDATA_END_TAG_OPEN:{this._stateRcdataEndTagOpen(t);break}case z.RCDATA_END_TAG_NAME:{this._stateRcdataEndTagName(t);break}case z.RAWTEXT_LESS_THAN_SIGN:{this._stateRawtextLessThanSign(t);break}case z.RAWTEXT_END_TAG_OPEN:{this._stateRawtextEndTagOpen(t);break}case z.RAWTEXT_END_TAG_NAME:{this._stateRawtextEndTagName(t);break}case z.SCRIPT_DATA_LESS_THAN_SIGN:{this._stateScriptDataLessThanSign(t);break}case z.SCRIPT_DATA_END_TAG_OPEN:{this._stateScriptDataEndTagOpen(t);break}case z.SCRIPT_DATA_END_TAG_NAME:{this._stateScriptDataEndTagName(t);break}case z.SCRIPT_DATA_ESCAPE_START:{this._stateScriptDataEscapeStart(t);break}case z.SCRIPT_DATA_ESCAPE_START_DASH:{this._stateScriptDataEscapeStartDash(t);break}case z.SCRIPT_DATA_ESCAPED:{this._stateScriptDataEscaped(t);break}case z.SCRIPT_DATA_ESCAPED_DASH:{this._stateScriptDataEscapedDash(t);break}case z.SCRIPT_DATA_ESCAPED_DASH_DASH:{this._stateScriptDataEscapedDashDash(t);break}case z.SCRIPT_DATA_ESCAPED_LESS_THAN_SIGN:{this._stateScriptDataEscapedLessThanSign(t);break}case z.SCRIPT_DATA_ESCAPED_END_TAG_OPEN:{this._stateScriptDataEscapedEndTagOpen(t);break}case z.SCRIPT_DATA_ESCAPED_END_TAG_NAME:{this._stateScriptDataEscapedEndTagName(t);break}case z.SCRIPT_DATA_DOUBLE_ESCAPE_START:{this._stateScriptDataDoubleEscapeStart(t);break}case z.SCRIPT_DATA_DOUBLE_ESCAPED:{this._stateScriptDataDoubleEscaped(t);break}case z.SCRIPT_DATA_DOUBLE_ESCAPED_DASH:{this._stateScriptDataDoubleEscapedDash(t);break}case z.SCRIPT_DATA_DOUBLE_ESCAPED_DASH_DASH:{this._stateScriptDataDoubleEscapedDashDash(t);break}case z.SCRIPT_DATA_DOUBLE_ESCAPED_LESS_THAN_SIGN:{this._stateScriptDataDoubleEscapedLessThanSign(t);break}case z.SCRIPT_DATA_DOUBLE_ESCAPE_END:{this._stateScriptDataDoubleEscapeEnd(t);break}case z.BEFORE_ATTRIBUTE_NAME:{this._stateBeforeAttributeName(t);break}case z.ATTRIBUTE_NAME:{this._stateAttributeName(t);break}case z.AFTER_ATTRIBUTE_NAME:{this._stateAfterAttributeName(t);break}case z.BEFORE_ATTRIBUTE_VALUE:{this._stateBeforeAttributeValue(t);break}case z.ATTRIBUTE_VALUE_DOUBLE_QUOTED:{this._stateAttributeValueDoubleQuoted(t);break}case z.ATTRIBUTE_VALUE_SINGLE_QUOTED:{this._stateAttributeValueSingleQuoted(t);break}case z.ATTRIBUTE_VALUE_UNQUOTED:{this._stateAttributeValueUnquoted(t);break}case z.AFTER_ATTRIBUTE_VALUE_QUOTED:{this._stateAfterAttributeValueQuoted(t);break}case z.SELF_CLOSING_START_TAG:{this._stateSelfClosingStartTag(t);break}case z.BOGUS_COMMENT:{this._stateBogusComment(t);break}case z.MARKUP_DECLARATION_OPEN:{this._stateMarkupDeclarationOpen(t);break}case z.COMMENT_START:{this._stateCommentStart(t);break}case z.COMMENT_START_DASH:{this._stateCommentStartDash(t);break}case z.COMMENT:{this._stateComment(t);break}case z.COMMENT_LESS_THAN_SIGN:{this._stateCommentLessThanSign(t);break}case z.COMMENT_LESS_THAN_SIGN_BANG:{this._stateCommentLessThanSignBang(t);break}case z.COMMENT_LESS_THAN_SIGN_BANG_DASH:{this._stateCommentLessThanSignBangDash(t);break}case z.COMMENT_LESS_THAN_SIGN_BANG_DASH_DASH:{this._stateCommentLessThanSignBangDashDash(t);break}case z.COMMENT_END_DASH:{this._stateCommentEndDash(t);break}case z.COMMENT_END:{this._stateCommentEnd(t);break}case z.COMMENT_END_BANG:{this._stateCommentEndBang(t);break}case z.DOCTYPE:{this._stateDoctype(t);break}case z.BEFORE_DOCTYPE_NAME:{this._stateBeforeDoctypeName(t);break}case z.DOCTYPE_NAME:{this._stateDoctypeName(t);break}case z.AFTER_DOCTYPE_NAME:{this._stateAfterDoctypeName(t);break}case z.AFTER_DOCTYPE_PUBLIC_KEYWORD:{this._stateAfterDoctypePublicKeyword(t);break}case z.BEFORE_DOCTYPE_PUBLIC_IDENTIFIER:{this._stateBeforeDoctypePublicIdentifier(t);break}case z.DOCTYPE_PUBLIC_IDENTIFIER_DOUBLE_QUOTED:{this._stateDoctypePublicIdentifierDoubleQuoted(t);break}case z.DOCTYPE_PUBLIC_IDENTIFIER_SINGLE_QUOTED:{this._stateDoctypePublicIdentifierSingleQuoted(t);break}case z.AFTER_DOCTYPE_PUBLIC_IDENTIFIER:{this._stateAfterDoctypePublicIdentifier(t);break}case z.BETWEEN_DOCTYPE_PUBLIC_AND_SYSTEM_IDENTIFIERS:{this._stateBetweenDoctypePublicAndSystemIdentifiers(t);break}case z.AFTER_DOCTYPE_SYSTEM_KEYWORD:{this._stateAfterDoctypeSystemKeyword(t);break}case z.BEFORE_DOCTYPE_SYSTEM_IDENTIFIER:{this._stateBeforeDoctypeSystemIdentifier(t);break}case z.DOCTYPE_SYSTEM_IDENTIFIER_DOUBLE_QUOTED:{this._stateDoctypeSystemIdentifierDoubleQuoted(t);break}case z.DOCTYPE_SYSTEM_IDENTIFIER_SINGLE_QUOTED:{this._stateDoctypeSystemIdentifierSingleQuoted(t);break}case z.AFTER_DOCTYPE_SYSTEM_IDENTIFIER:{this._stateAfterDoctypeSystemIdentifier(t);break}case z.BOGUS_DOCTYPE:{this._stateBogusDoctype(t);break}case z.CDATA_SECTION:{this._stateCdataSection(t);break}case z.CDATA_SECTION_BRACKET:{this._stateCdataSectionBracket(t);break}case z.CDATA_SECTION_END:{this._stateCdataSectionEnd(t);break}case z.CHARACTER_REFERENCE:{this._stateCharacterReference();break}case z.AMBIGUOUS_AMPERSAND:{this._stateAmbiguousAmpersand(t);break}default:throw new Error("Unknown state")}}_stateData(t){switch(t){case $.LESS_THAN_SIGN:{this.state=z.TAG_OPEN;break}case $.AMPERSAND:{this._startCharacterReference();break}case $.NULL:{this._err(ue.unexpectedNullCharacter),this._emitCodePoint(t);break}case $.EOF:{this._emitEOFToken();break}default:this._emitCodePoint(t)}}_stateRcdata(t){switch(t){case $.AMPERSAND:{this._startCharacterReference();break}case $.LESS_THAN_SIGN:{this.state=z.RCDATA_LESS_THAN_SIGN;break}case $.NULL:{this._err(ue.unexpectedNullCharacter),this._emitChars(tn);break}case $.EOF:{this._emitEOFToken();break}default:this._emitCodePoint(t)}}_stateRawtext(t){switch(t){case $.LESS_THAN_SIGN:{this.state=z.RAWTEXT_LESS_THAN_SIGN;break}case $.NULL:{this._err(ue.unexpectedNullCharacter),this._emitChars(tn);break}case $.EOF:{this._emitEOFToken();break}default:this._emitCodePoint(t)}}_stateScriptData(t){switch(t){case $.LESS_THAN_SIGN:{this.state=z.SCRIPT_DATA_LESS_THAN_SIGN;break}case $.NULL:{this._err(ue.unexpectedNullCharacter),this._emitChars(tn);break}case $.EOF:{this._emitEOFToken();break}default:this._emitCodePoint(t)}}_statePlaintext(t){switch(t){case $.NULL:{this._err(ue.unexpectedNullCharacter),this._emitChars(tn);break}case $.EOF:{this._emitEOFToken();break}default:this._emitCodePoint(t)}}_stateTagOpen(t){if(ma(t))this._createStartTagToken(),this.state=z.TAG_NAME,this._stateTagName(t);else switch(t){case $.EXCLAMATION_MARK:{this.state=z.MARKUP_DECLARATION_OPEN;break}case $.SOLIDUS:{this.state=z.END_TAG_OPEN;break}case $.QUESTION_MARK:{this._err(ue.unexpectedQuestionMarkInsteadOfTagName),this._createCommentToken(1),this.state=z.BOGUS_COMMENT,this._stateBogusComment(t);break}case $.EOF:{this._err(ue.eofBeforeTagName),this._emitChars("<"),this._emitEOFToken();break}default:this._err(ue.invalidFirstCharacterOfTagName),this._emitChars("<"),this.state=z.DATA,this._stateData(t)}}_stateEndTagOpen(t){if(ma(t))this._createEndTagToken(),this.state=z.TAG_NAME,this._stateTagName(t);else switch(t){case $.GREATER_THAN_SIGN:{this._err(ue.missingEndTagName),this.state=z.DATA;break}case $.EOF:{this._err(ue.eofBeforeTagName),this._emitChars("");break}case $.NULL:{this._err(ue.unexpectedNullCharacter),this.state=z.SCRIPT_DATA_ESCAPED,this._emitChars(tn);break}case $.EOF:{this._err(ue.eofInScriptHtmlCommentLikeText),this._emitEOFToken();break}default:this.state=z.SCRIPT_DATA_ESCAPED,this._emitCodePoint(t)}}_stateScriptDataEscapedLessThanSign(t){t===$.SOLIDUS?this.state=z.SCRIPT_DATA_ESCAPED_END_TAG_OPEN:ma(t)?(this._emitChars("<"),this.state=z.SCRIPT_DATA_DOUBLE_ESCAPE_START,this._stateScriptDataDoubleEscapeStart(t)):(this._emitChars("<"),this.state=z.SCRIPT_DATA_ESCAPED,this._stateScriptDataEscaped(t))}_stateScriptDataEscapedEndTagOpen(t){ma(t)?(this.state=z.SCRIPT_DATA_ESCAPED_END_TAG_NAME,this._stateScriptDataEscapedEndTagName(t)):(this._emitChars("");break}case $.NULL:{this._err(ue.unexpectedNullCharacter),this.state=z.SCRIPT_DATA_DOUBLE_ESCAPED,this._emitChars(tn);break}case $.EOF:{this._err(ue.eofInScriptHtmlCommentLikeText),this._emitEOFToken();break}default:this.state=z.SCRIPT_DATA_DOUBLE_ESCAPED,this._emitCodePoint(t)}}_stateScriptDataDoubleEscapedLessThanSign(t){t===$.SOLIDUS?(this.state=z.SCRIPT_DATA_DOUBLE_ESCAPE_END,this._emitChars("/")):(this.state=z.SCRIPT_DATA_DOUBLE_ESCAPED,this._stateScriptDataDoubleEscaped(t))}_stateScriptDataDoubleEscapeEnd(t){if(this.preprocessor.startsWith(Lr.SCRIPT,!1)&&ZT(this.preprocessor.peek(Lr.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])!==we.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(Kee,we.HTML)}clearBackToTableBodyContext(){this.clearBackTo(Vee,we.HTML)}clearBackToTableRowContext(){this.clearBackTo(zee,we.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]===v.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]===v.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 we.HTML:{if(s===t)return!0;if(n.has(s))return!1;break}case we.SVG:{if(t2.has(s))return!1;break}case we.MATHML:{if(e2.has(s))return!1;break}}}return!0}hasInScope(t){return this.hasInDynamicScope(t,Pm)}hasInListItemScope(t){return this.hasInDynamicScope(t,$ee)}hasInButtonScope(t){return this.hasInDynamicScope(t,Hee)}hasNumberedHeaderInScope(){for(let t=this.stackTop;t>=0;t--){const n=this.tagIDs[t];switch(this.treeAdapter.getNamespaceURI(this.items[t])){case we.HTML:{if(EE.has(n))return!0;if(Pm.has(n))return!1;break}case we.SVG:{if(t2.has(n))return!1;break}case we.MATHML:{if(e2.has(n))return!1;break}}}return!0}hasInTableScope(t){for(let n=this.stackTop;n>=0;n--)if(this.treeAdapter.getNamespaceURI(this.items[n])===we.HTML)switch(this.tagIDs[n]){case t:return!0;case v.TABLE:case v.HTML:return!1}return!0}hasTableBodyContextInTableScope(){for(let t=this.stackTop;t>=0;t--)if(this.treeAdapter.getNamespaceURI(this.items[t])===we.HTML)switch(this.tagIDs[t]){case v.TBODY:case v.THEAD:case v.TFOOT:return!0;case v.TABLE:case v.HTML:return!1}return!0}hasInSelectScope(t){for(let n=this.stackTop;n>=0;n--)if(this.treeAdapter.getNamespaceURI(this.items[n])===we.HTML)switch(this.tagIDs[n]){case t:return!0;case v.OPTION:case v.OPTGROUP:break;default:return!1}return!0}generateImpliedEndTags(){for(;this.currentTagId!==void 0&&$j.has(this.currentTagId);)this.pop()}generateImpliedEndTagsThoroughly(){for(;this.currentTagId!==void 0&&JT.has(this.currentTagId);)this.pop()}generateImpliedEndTagsWithExclusion(t){for(;this.currentTagId!==void 0&&this.currentTagId!==t&&JT.has(this.currentTagId);)this.pop()}}const zy=3;var fi;(function(e){e[e.Marker=0]="Marker",e[e.Element=1]="Element"})(fi||(fi={}));const n2={type:fi.Marker};class Wee{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(c.name)===c.value)&&(i+=1,i>=zy&&this.entries.splice(o.idx,1))}}insertMarker(){this.entries.unshift(n2)}pushElement(t,n){this._ensureNoahArkCondition(t),this.entries.unshift({type:fi.Element,element:t,token:n})}insertElementAfterBookmark(t,n){const r=this.entries.indexOf(this.bookmark);this.entries.splice(r,0,{type:fi.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(n2);t===-1?this.entries.length=0:this.entries.splice(0,t+1)}getElementEntryInScopeWithTagName(t){const n=this.entries.find(r=>r.type===fi.Marker||this.treeAdapter.getTagName(r.element)===t);return n&&n.type===fi.Element?n:null}getElementEntry(t){return this.entries.find(n=>n.type===fi.Element&&n.element===t)}}const ga={createDocument(){return{nodeName:"#document",mode:gs.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};ga.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(ga.isTextNode(n)){n.value+=t;return}}ga.appendChild(e,ga.createTextNode(t))},insertTextBefore(e,t,n){const r=e.childNodes[e.childNodes.indexOf(n)-1];r&&ga.isTextNode(r)?r.value+=t:ga.insertBefore(e,ga.createTextNode(t),n)},adoptAttributes(e,t){const n=new Set(e.attrs.map(r=>r.name));for(let r=0;re.startsWith(n))}function ete(e){return e.name===Hj&&e.publicId===null&&(e.systemId===null||e.systemId===qee)}function tte(e){if(e.name!==Hj)return gs.QUIRKS;const{systemId:t}=e;if(t&&t.toLowerCase()===Xee)return gs.QUIRKS;let{publicId:n}=e;if(n!==null){if(n=n.toLowerCase(),Zee.has(n))return gs.QUIRKS;let r=t===null?Qee:zj;if(r2(n,r))return gs.QUIRKS;if(r=t===null?Vj:Jee,r2(n,r))return gs.LIMITED_QUIRKS}return gs.NO_QUIRKS}const s2={TEXT_HTML:"text/html",APPLICATION_XML:"application/xhtml+xml"},nte="definitionurl",rte="definitionURL",ste=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])),ite=new Map([["xlink:actuate",{prefix:"xlink",name:"actuate",namespace:we.XLINK}],["xlink:arcrole",{prefix:"xlink",name:"arcrole",namespace:we.XLINK}],["xlink:href",{prefix:"xlink",name:"href",namespace:we.XLINK}],["xlink:role",{prefix:"xlink",name:"role",namespace:we.XLINK}],["xlink:show",{prefix:"xlink",name:"show",namespace:we.XLINK}],["xlink:title",{prefix:"xlink",name:"title",namespace:we.XLINK}],["xlink:type",{prefix:"xlink",name:"type",namespace:we.XLINK}],["xml:lang",{prefix:"xml",name:"lang",namespace:we.XML}],["xml:space",{prefix:"xml",name:"space",namespace:we.XML}],["xmlns",{prefix:"",name:"xmlns",namespace:we.XMLNS}],["xmlns:xlink",{prefix:"xmlns",name:"xlink",namespace:we.XMLNS}]]),ate=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])),ote=new Set([v.B,v.BIG,v.BLOCKQUOTE,v.BODY,v.BR,v.CENTER,v.CODE,v.DD,v.DIV,v.DL,v.DT,v.EM,v.EMBED,v.H1,v.H2,v.H3,v.H4,v.H5,v.H6,v.HEAD,v.HR,v.I,v.IMG,v.LI,v.LISTING,v.MENU,v.META,v.NOBR,v.OL,v.P,v.PRE,v.RUBY,v.S,v.SMALL,v.SPAN,v.STRONG,v.STRIKE,v.SUB,v.SUP,v.TABLE,v.TT,v.U,v.UL,v.VAR]);function lte(e){const t=e.tagID;return t===v.FONT&&e.attrs.some(({name:r})=>r===ko.COLOR||r===ko.SIZE||r===ko.FACE)||ote.has(t)}function Kj(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)===we.HTML;this.currentNotInHTML=!r,this.tokenizer.inForeignNode=!r&&t!==void 0&&n!==void 0&&!this._isIntegrationPoint(n,t)}_switchToTextParsing(t,n){this._insertElement(t,we.HTML),this.tokenizer.state=n,this.originalInsertionMode=this.insertionMode,this.insertionMode=Y.TEXT}switchToPlaintextParsing(){this.insertionMode=Y.TEXT,this.originalInsertionMode=Y.IN_BODY,this.tokenizer.state=Cn.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)===se.FORM){this.formElement=t;break}t=this.treeAdapter.getParentNode(t)}}_initTokenizerForFragmentParsing(){if(!(!this.fragmentContext||this.treeAdapter.getNamespaceURI(this.fragmentContext)!==we.HTML))switch(this.fragmentContextID){case v.TITLE:case v.TEXTAREA:{this.tokenizer.state=Cn.RCDATA;break}case v.STYLE:case v.XMP:case v.IFRAME:case v.NOEMBED:case v.NOFRAMES:case v.NOSCRIPT:{this.tokenizer.state=Cn.RAWTEXT;break}case v.SCRIPT:{this.tokenizer.state=Cn.SCRIPT_DATA;break}case v.PLAINTEXT:{this.tokenizer.state=Cn.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,we.HTML,[]);this._attachElementToTree(r,null),this.openElements.push(r,n)}_insertTemplate(t){const n=this.treeAdapter.createElement(t.tagName,we.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(se.HTML,we.HTML,[]);this.options.sourceCodeLocationInfo&&this.treeAdapter.setNodeSourceCodeLocation(t,null),this.treeAdapter.appendChild(this.openElements.current,t),this.openElements.push(t,v.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:c,endCol:u,endOffset:d}=t.location;this.treeAdapter.updateNodeSourceCodeLocation(a,{endLine:c,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===gt.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===v.SVG&&this.treeAdapter.getTagName(n)===se.ANNOTATION_XML&&this.treeAdapter.getNamespaceURI(n)===we.MATHML?!1:this.tokenizer.inForeignNode||(t.tagID===v.MGLYPH||t.tagID===v.MALIGNMARK)&&r!==void 0&&!this._isIntegrationPoint(r,n,we.HTML)}_processToken(t){switch(t.type){case gt.CHARACTER:{this.onCharacter(t);break}case gt.NULL_CHARACTER:{this.onNullCharacter(t);break}case gt.COMMENT:{this.onComment(t);break}case gt.DOCTYPE:{this.onDoctype(t);break}case gt.START_TAG:{this._processStartTag(t);break}case gt.END_TAG:{this.onEndTag(t);break}case gt.EOF:{this.onEof(t);break}case gt.WHITESPACE_CHARACTER:{this.onWhitespaceCharacter(t);break}}}_isIntegrationPoint(t,n,r){const s=this.treeAdapter.getNamespaceURI(n),i=this.treeAdapter.getAttrList(n);return fte(t,s,i,r)}_reconstructActiveFormattingElements(){const t=this.activeFormattingElements.entries.length;if(t){const n=this.activeFormattingElements.entries.findIndex(s=>s.type===fi.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=Y.IN_ROW}_closePElement(){this.openElements.generateImpliedEndTagsWithExclusion(v.P),this.openElements.popUntilTagNamePopped(v.P)}_resetInsertionMode(){for(let t=this.openElements.stackTop;t>=0;t--)switch(t===0&&this.fragmentContext?this.fragmentContextID:this.openElements.tagIDs[t]){case v.TR:{this.insertionMode=Y.IN_ROW;return}case v.TBODY:case v.THEAD:case v.TFOOT:{this.insertionMode=Y.IN_TABLE_BODY;return}case v.CAPTION:{this.insertionMode=Y.IN_CAPTION;return}case v.COLGROUP:{this.insertionMode=Y.IN_COLUMN_GROUP;return}case v.TABLE:{this.insertionMode=Y.IN_TABLE;return}case v.BODY:{this.insertionMode=Y.IN_BODY;return}case v.FRAMESET:{this.insertionMode=Y.IN_FRAMESET;return}case v.SELECT:{this._resetInsertionModeForSelect(t);return}case v.TEMPLATE:{this.insertionMode=this.tmplInsertionModeStack[0];return}case v.HTML:{this.insertionMode=this.headElement?Y.AFTER_HEAD:Y.BEFORE_HEAD;return}case v.TD:case v.TH:{if(t>0){this.insertionMode=Y.IN_CELL;return}break}case v.HEAD:{if(t>0){this.insertionMode=Y.IN_HEAD;return}break}}this.insertionMode=Y.IN_BODY}_resetInsertionModeForSelect(t){if(t>0)for(let n=t-1;n>0;n--){const r=this.openElements.tagIDs[n];if(r===v.TEMPLATE)break;if(r===v.TABLE){this.insertionMode=Y.IN_SELECT_IN_TABLE;return}}this.insertionMode=Y.IN_SELECT}_isElementCausesFosterParenting(t){return Gj.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 v.TEMPLATE:{if(this.treeAdapter.getNamespaceURI(n)===we.HTML)return{parent:this.treeAdapter.getTemplateContent(n),beforeElement:null};break}case v.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 Dee[r].has(n)}onCharacter(t){if(this.skipNextNewLine=!1,this.tokenizer.inForeignNode){Yne(this,t);return}switch(this.insertionMode){case Y.INITIAL:{Nu(this,t);break}case Y.BEFORE_HTML:{md(this,t);break}case Y.BEFORE_HEAD:{gd(this,t);break}case Y.IN_HEAD:{yd(this,t);break}case Y.IN_HEAD_NO_SCRIPT:{bd(this,t);break}case Y.AFTER_HEAD:{Ed(this,t);break}case Y.IN_BODY:case Y.IN_CAPTION:case Y.IN_CELL:case Y.IN_TEMPLATE:{qj(this,t);break}case Y.TEXT:case Y.IN_SELECT:case Y.IN_SELECT_IN_TABLE:{this._insertCharacters(t);break}case Y.IN_TABLE:case Y.IN_TABLE_BODY:case Y.IN_ROW:{Vy(this,t);break}case Y.IN_TABLE_TEXT:{tD(this,t);break}case Y.IN_COLUMN_GROUP:{Bm(this,t);break}case Y.AFTER_BODY:{Fm(this,t);break}case Y.AFTER_AFTER_BODY:{jp(this,t);break}}}onNullCharacter(t){if(this.skipNextNewLine=!1,this.tokenizer.inForeignNode){Kne(this,t);return}switch(this.insertionMode){case Y.INITIAL:{Nu(this,t);break}case Y.BEFORE_HTML:{md(this,t);break}case Y.BEFORE_HEAD:{gd(this,t);break}case Y.IN_HEAD:{yd(this,t);break}case Y.IN_HEAD_NO_SCRIPT:{bd(this,t);break}case Y.AFTER_HEAD:{Ed(this,t);break}case Y.TEXT:{this._insertCharacters(t);break}case Y.IN_TABLE:case Y.IN_TABLE_BODY:case Y.IN_ROW:{Vy(this,t);break}case Y.IN_COLUMN_GROUP:{Bm(this,t);break}case Y.AFTER_BODY:{Fm(this,t);break}case Y.AFTER_AFTER_BODY:{jp(this,t);break}}}onComment(t){if(this.skipNextNewLine=!1,this.currentNotInHTML){xE(this,t);return}switch(this.insertionMode){case Y.INITIAL:case Y.BEFORE_HTML:case Y.BEFORE_HEAD:case Y.IN_HEAD:case Y.IN_HEAD_NO_SCRIPT:case Y.AFTER_HEAD:case Y.IN_BODY:case Y.IN_TABLE:case Y.IN_CAPTION:case Y.IN_COLUMN_GROUP:case Y.IN_TABLE_BODY:case Y.IN_ROW:case Y.IN_CELL:case Y.IN_SELECT:case Y.IN_SELECT_IN_TABLE:case Y.IN_TEMPLATE:case Y.IN_FRAMESET:case Y.AFTER_FRAMESET:{xE(this,t);break}case Y.IN_TABLE_TEXT:{Su(this,t);break}case Y.AFTER_BODY:{_te(this,t);break}case Y.AFTER_AFTER_BODY:case Y.AFTER_AFTER_FRAMESET:{kte(this,t);break}}}onDoctype(t){switch(this.skipNextNewLine=!1,this.insertionMode){case Y.INITIAL:{Nte(this,t);break}case Y.BEFORE_HEAD:case Y.IN_HEAD:case Y.IN_HEAD_NO_SCRIPT:case Y.AFTER_HEAD:{this._err(t,ue.misplacedDoctype);break}case Y.IN_TABLE_TEXT:{Su(this,t);break}}}onStartTag(t){this.skipNextNewLine=!1,this.currentToken=t,this._processStartTag(t),t.selfClosing&&!t.ackSelfClosing&&this._err(t,ue.nonVoidHtmlElementStartTagWithTrailingSolidus)}_processStartTag(t){this.shouldProcessStartTagTokenInForeignContent(t)?Gne(this,t):this._startTagOutsideForeignContent(t)}_startTagOutsideForeignContent(t){switch(this.insertionMode){case Y.INITIAL:{Nu(this,t);break}case Y.BEFORE_HTML:{Ste(this,t);break}case Y.BEFORE_HEAD:{Ate(this,t);break}case Y.IN_HEAD:{ei(this,t);break}case Y.IN_HEAD_NO_SCRIPT:{Ote(this,t);break}case Y.AFTER_HEAD:{Lte(this,t);break}case Y.IN_BODY:{br(this,t);break}case Y.IN_TABLE:{Cc(this,t);break}case Y.IN_TABLE_TEXT:{Su(this,t);break}case Y.IN_CAPTION:{Cne(this,t);break}case Y.IN_COLUMN_GROUP:{xv(this,t);break}case Y.IN_TABLE_BODY:{Wg(this,t);break}case Y.IN_ROW:{qg(this,t);break}case Y.IN_CELL:{Rne(this,t);break}case Y.IN_SELECT:{sD(this,t);break}case Y.IN_SELECT_IN_TABLE:{Mne(this,t);break}case Y.IN_TEMPLATE:{Dne(this,t);break}case Y.AFTER_BODY:{Bne(this,t);break}case Y.IN_FRAMESET:{Fne(this,t);break}case Y.AFTER_FRAMESET:{$ne(this,t);break}case Y.AFTER_AFTER_BODY:{zne(this,t);break}case Y.AFTER_AFTER_FRAMESET:{Vne(this,t);break}}}onEndTag(t){this.skipNextNewLine=!1,this.currentToken=t,this.currentNotInHTML?Wne(this,t):this._endTagOutsideForeignContent(t)}_endTagOutsideForeignContent(t){switch(this.insertionMode){case Y.INITIAL:{Nu(this,t);break}case Y.BEFORE_HTML:{Tte(this,t);break}case Y.BEFORE_HEAD:{Cte(this,t);break}case Y.IN_HEAD:{Ite(this,t);break}case Y.IN_HEAD_NO_SCRIPT:{Rte(this,t);break}case Y.AFTER_HEAD:{Mte(this,t);break}case Y.IN_BODY:{Gg(this,t);break}case Y.TEXT:{Ene(this,t);break}case Y.IN_TABLE:{rf(this,t);break}case Y.IN_TABLE_TEXT:{Su(this,t);break}case Y.IN_CAPTION:{Ine(this,t);break}case Y.IN_COLUMN_GROUP:{One(this,t);break}case Y.IN_TABLE_BODY:{wE(this,t);break}case Y.IN_ROW:{rD(this,t);break}case Y.IN_CELL:{Lne(this,t);break}case Y.IN_SELECT:{iD(this,t);break}case Y.IN_SELECT_IN_TABLE:{jne(this,t);break}case Y.IN_TEMPLATE:{Pne(this,t);break}case Y.AFTER_BODY:{oD(this,t);break}case Y.IN_FRAMESET:{Une(this,t);break}case Y.AFTER_FRAMESET:{Hne(this,t);break}case Y.AFTER_AFTER_BODY:{jp(this,t);break}}}onEof(t){switch(this.insertionMode){case Y.INITIAL:{Nu(this,t);break}case Y.BEFORE_HTML:{md(this,t);break}case Y.BEFORE_HEAD:{gd(this,t);break}case Y.IN_HEAD:{yd(this,t);break}case Y.IN_HEAD_NO_SCRIPT:{bd(this,t);break}case Y.AFTER_HEAD:{Ed(this,t);break}case Y.IN_BODY:case Y.IN_TABLE:case Y.IN_CAPTION:case Y.IN_COLUMN_GROUP:case Y.IN_TABLE_BODY:case Y.IN_ROW:case Y.IN_CELL:case Y.IN_SELECT:case Y.IN_SELECT_IN_TABLE:{Jj(this,t);break}case Y.TEXT:{xne(this,t);break}case Y.IN_TABLE_TEXT:{Su(this,t);break}case Y.IN_TEMPLATE:{aD(this,t);break}case Y.AFTER_BODY:case Y.IN_FRAMESET:case Y.AFTER_FRAMESET:case Y.AFTER_AFTER_BODY:case Y.AFTER_AFTER_FRAMESET:{Ev(this,t);break}}}onWhitespaceCharacter(t){if(this.skipNextNewLine&&(this.skipNextNewLine=!1,t.chars.charCodeAt(0)===$.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 Y.IN_HEAD:case Y.IN_HEAD_NO_SCRIPT:case Y.AFTER_HEAD:case Y.TEXT:case Y.IN_COLUMN_GROUP:case Y.IN_SELECT:case Y.IN_SELECT_IN_TABLE:case Y.IN_FRAMESET:case Y.AFTER_FRAMESET:{this._insertCharacters(t);break}case Y.IN_BODY:case Y.IN_CAPTION:case Y.IN_CELL:case Y.IN_TEMPLATE:case Y.AFTER_BODY:case Y.AFTER_AFTER_BODY:case Y.AFTER_AFTER_FRAMESET:{Wj(this,t);break}case Y.IN_TABLE:case Y.IN_TABLE_BODY:case Y.IN_ROW:{Vy(this,t);break}case Y.IN_TABLE_TEXT:{eD(this,t);break}}}};function yte(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):Zj(e,t),n}function bte(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 Ete(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),c=o&&i>=mte;!o||c?(c&&e.activeFormattingElements.removeEntry(o),e.openElements.remove(a)):(a=xte(e,o),r===t&&(e.activeFormattingElements.bookmark=o),e.treeAdapter.detachNode(r),e.treeAdapter.appendChild(a,r),r=a)}return r}function xte(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 wte(e,t,n){const r=e.treeAdapter.getTagName(t),s=Zc(r);if(e._isElementCausesFosterParenting(s))e._fosterParentElement(n);else{const i=e.treeAdapter.getNamespaceURI(t);s===v.TEMPLATE&&i===we.HTML&&(t=e.treeAdapter.getTemplateContent(t)),e.treeAdapter.appendChild(t,n)}}function vte(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 bv(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 Nte(e,t){e._setDocumentType(t);const n=t.forceQuirks?gs.QUIRKS:tte(t);ete(t)||e._err(t,ue.nonConformingDoctype),e.treeAdapter.setDocumentMode(e.document,n),e.insertionMode=Y.BEFORE_HTML}function Nu(e,t){e._err(t,ue.missingDoctype,!0),e.treeAdapter.setDocumentMode(e.document,gs.QUIRKS),e.insertionMode=Y.BEFORE_HTML,e._processToken(t)}function Ste(e,t){t.tagID===v.HTML?(e._insertElement(t,we.HTML),e.insertionMode=Y.BEFORE_HEAD):md(e,t)}function Tte(e,t){const n=t.tagID;(n===v.HTML||n===v.HEAD||n===v.BODY||n===v.BR)&&md(e,t)}function md(e,t){e._insertFakeRootElement(),e.insertionMode=Y.BEFORE_HEAD,e._processToken(t)}function Ate(e,t){switch(t.tagID){case v.HTML:{br(e,t);break}case v.HEAD:{e._insertElement(t,we.HTML),e.headElement=e.openElements.current,e.insertionMode=Y.IN_HEAD;break}default:gd(e,t)}}function Cte(e,t){const n=t.tagID;n===v.HEAD||n===v.BODY||n===v.HTML||n===v.BR?gd(e,t):e._err(t,ue.endTagWithoutMatchingOpenElement)}function gd(e,t){e._insertFakeElement(se.HEAD,v.HEAD),e.headElement=e.openElements.current,e.insertionMode=Y.IN_HEAD,e._processToken(t)}function ei(e,t){switch(t.tagID){case v.HTML:{br(e,t);break}case v.BASE:case v.BASEFONT:case v.BGSOUND:case v.LINK:case v.META:{e._appendElement(t,we.HTML),t.ackSelfClosing=!0;break}case v.TITLE:{e._switchToTextParsing(t,Cn.RCDATA);break}case v.NOSCRIPT:{e.options.scriptingEnabled?e._switchToTextParsing(t,Cn.RAWTEXT):(e._insertElement(t,we.HTML),e.insertionMode=Y.IN_HEAD_NO_SCRIPT);break}case v.NOFRAMES:case v.STYLE:{e._switchToTextParsing(t,Cn.RAWTEXT);break}case v.SCRIPT:{e._switchToTextParsing(t,Cn.SCRIPT_DATA);break}case v.TEMPLATE:{e._insertTemplate(t),e.activeFormattingElements.insertMarker(),e.framesetOk=!1,e.insertionMode=Y.IN_TEMPLATE,e.tmplInsertionModeStack.unshift(Y.IN_TEMPLATE);break}case v.HEAD:{e._err(t,ue.misplacedStartTagForHeadElement);break}default:yd(e,t)}}function Ite(e,t){switch(t.tagID){case v.HEAD:{e.openElements.pop(),e.insertionMode=Y.AFTER_HEAD;break}case v.BODY:case v.BR:case v.HTML:{yd(e,t);break}case v.TEMPLATE:{Wo(e,t);break}default:e._err(t,ue.endTagWithoutMatchingOpenElement)}}function Wo(e,t){e.openElements.tmplCount>0?(e.openElements.generateImpliedEndTagsThoroughly(),e.openElements.currentTagId!==v.TEMPLATE&&e._err(t,ue.closingOfElementWithOpenChildElements),e.openElements.popUntilTagNamePopped(v.TEMPLATE),e.activeFormattingElements.clearToLastMarker(),e.tmplInsertionModeStack.shift(),e._resetInsertionMode()):e._err(t,ue.endTagWithoutMatchingOpenElement)}function yd(e,t){e.openElements.pop(),e.insertionMode=Y.AFTER_HEAD,e._processToken(t)}function Ote(e,t){switch(t.tagID){case v.HTML:{br(e,t);break}case v.BASEFONT:case v.BGSOUND:case v.HEAD:case v.LINK:case v.META:case v.NOFRAMES:case v.STYLE:{ei(e,t);break}case v.NOSCRIPT:{e._err(t,ue.nestedNoscriptInHead);break}default:bd(e,t)}}function Rte(e,t){switch(t.tagID){case v.NOSCRIPT:{e.openElements.pop(),e.insertionMode=Y.IN_HEAD;break}case v.BR:{bd(e,t);break}default:e._err(t,ue.endTagWithoutMatchingOpenElement)}}function bd(e,t){const n=t.type===gt.EOF?ue.openElementsLeftAfterEof:ue.disallowedContentInNoscriptInHead;e._err(t,n),e.openElements.pop(),e.insertionMode=Y.IN_HEAD,e._processToken(t)}function Lte(e,t){switch(t.tagID){case v.HTML:{br(e,t);break}case v.BODY:{e._insertElement(t,we.HTML),e.framesetOk=!1,e.insertionMode=Y.IN_BODY;break}case v.FRAMESET:{e._insertElement(t,we.HTML),e.insertionMode=Y.IN_FRAMESET;break}case v.BASE:case v.BASEFONT:case v.BGSOUND:case v.LINK:case v.META:case v.NOFRAMES:case v.SCRIPT:case v.STYLE:case v.TEMPLATE:case v.TITLE:{e._err(t,ue.abandonedHeadElementChild),e.openElements.push(e.headElement,v.HEAD),ei(e,t),e.openElements.remove(e.headElement);break}case v.HEAD:{e._err(t,ue.misplacedStartTagForHeadElement);break}default:Ed(e,t)}}function Mte(e,t){switch(t.tagID){case v.BODY:case v.HTML:case v.BR:{Ed(e,t);break}case v.TEMPLATE:{Wo(e,t);break}default:e._err(t,ue.endTagWithoutMatchingOpenElement)}}function Ed(e,t){e._insertFakeElement(se.BODY,v.BODY),e.insertionMode=Y.IN_BODY,Yg(e,t)}function Yg(e,t){switch(t.type){case gt.CHARACTER:{qj(e,t);break}case gt.WHITESPACE_CHARACTER:{Wj(e,t);break}case gt.COMMENT:{xE(e,t);break}case gt.START_TAG:{br(e,t);break}case gt.END_TAG:{Gg(e,t);break}case gt.EOF:{Jj(e,t);break}}}function Wj(e,t){e._reconstructActiveFormattingElements(),e._insertCharacters(t)}function qj(e,t){e._reconstructActiveFormattingElements(),e._insertCharacters(t),e.framesetOk=!1}function jte(e,t){e.openElements.tmplCount===0&&e.treeAdapter.adoptAttributes(e.openElements.items[0],t.attrs)}function Dte(e,t){const n=e.openElements.tryPeekProperlyNestedBodyElement();n&&e.openElements.tmplCount===0&&(e.framesetOk=!1,e.treeAdapter.adoptAttributes(n,t.attrs))}function Pte(e,t){const n=e.openElements.tryPeekProperlyNestedBodyElement();e.framesetOk&&n&&(e.treeAdapter.detachNode(n),e.openElements.popAllUpToHtmlElement(),e._insertElement(t,we.HTML),e.insertionMode=Y.IN_FRAMESET)}function Bte(e,t){e.openElements.hasInButtonScope(v.P)&&e._closePElement(),e._insertElement(t,we.HTML)}function Fte(e,t){e.openElements.hasInButtonScope(v.P)&&e._closePElement(),e.openElements.currentTagId!==void 0&&EE.has(e.openElements.currentTagId)&&e.openElements.pop(),e._insertElement(t,we.HTML)}function Ute(e,t){e.openElements.hasInButtonScope(v.P)&&e._closePElement(),e._insertElement(t,we.HTML),e.skipNextNewLine=!0,e.framesetOk=!1}function $te(e,t){const n=e.openElements.tmplCount>0;(!e.formElement||n)&&(e.openElements.hasInButtonScope(v.P)&&e._closePElement(),e._insertElement(t,we.HTML),n||(e.formElement=e.openElements.current))}function Hte(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===v.LI&&s===v.LI||(n===v.DD||n===v.DT)&&(s===v.DD||s===v.DT)){e.openElements.generateImpliedEndTagsWithExclusion(s),e.openElements.popUntilTagNamePopped(s);break}if(s!==v.ADDRESS&&s!==v.DIV&&s!==v.P&&e._isSpecialElement(e.openElements.items[r],s))break}e.openElements.hasInButtonScope(v.P)&&e._closePElement(),e._insertElement(t,we.HTML)}function zte(e,t){e.openElements.hasInButtonScope(v.P)&&e._closePElement(),e._insertElement(t,we.HTML),e.tokenizer.state=Cn.PLAINTEXT}function Vte(e,t){e.openElements.hasInScope(v.BUTTON)&&(e.openElements.generateImpliedEndTags(),e.openElements.popUntilTagNamePopped(v.BUTTON)),e._reconstructActiveFormattingElements(),e._insertElement(t,we.HTML),e.framesetOk=!1}function Kte(e,t){const n=e.activeFormattingElements.getElementEntryInScopeWithTagName(se.A);n&&(bv(e,t),e.openElements.remove(n.element),e.activeFormattingElements.removeEntry(n)),e._reconstructActiveFormattingElements(),e._insertElement(t,we.HTML),e.activeFormattingElements.pushElement(e.openElements.current,t)}function Yte(e,t){e._reconstructActiveFormattingElements(),e._insertElement(t,we.HTML),e.activeFormattingElements.pushElement(e.openElements.current,t)}function Gte(e,t){e._reconstructActiveFormattingElements(),e.openElements.hasInScope(v.NOBR)&&(bv(e,t),e._reconstructActiveFormattingElements()),e._insertElement(t,we.HTML),e.activeFormattingElements.pushElement(e.openElements.current,t)}function Wte(e,t){e._reconstructActiveFormattingElements(),e._insertElement(t,we.HTML),e.activeFormattingElements.insertMarker(),e.framesetOk=!1}function qte(e,t){e.treeAdapter.getDocumentMode(e.document)!==gs.QUIRKS&&e.openElements.hasInButtonScope(v.P)&&e._closePElement(),e._insertElement(t,we.HTML),e.framesetOk=!1,e.insertionMode=Y.IN_TABLE}function Xj(e,t){e._reconstructActiveFormattingElements(),e._appendElement(t,we.HTML),e.framesetOk=!1,t.ackSelfClosing=!0}function Qj(e){const t=Fj(e,ko.TYPE);return t!=null&&t.toLowerCase()===hte}function Xte(e,t){e._reconstructActiveFormattingElements(),e._appendElement(t,we.HTML),Qj(t)||(e.framesetOk=!1),t.ackSelfClosing=!0}function Qte(e,t){e._appendElement(t,we.HTML),t.ackSelfClosing=!0}function Zte(e,t){e.openElements.hasInButtonScope(v.P)&&e._closePElement(),e._appendElement(t,we.HTML),e.framesetOk=!1,t.ackSelfClosing=!0}function Jte(e,t){t.tagName=se.IMG,t.tagID=v.IMG,Xj(e,t)}function ene(e,t){e._insertElement(t,we.HTML),e.skipNextNewLine=!0,e.tokenizer.state=Cn.RCDATA,e.originalInsertionMode=e.insertionMode,e.framesetOk=!1,e.insertionMode=Y.TEXT}function tne(e,t){e.openElements.hasInButtonScope(v.P)&&e._closePElement(),e._reconstructActiveFormattingElements(),e.framesetOk=!1,e._switchToTextParsing(t,Cn.RAWTEXT)}function nne(e,t){e.framesetOk=!1,e._switchToTextParsing(t,Cn.RAWTEXT)}function o2(e,t){e._switchToTextParsing(t,Cn.RAWTEXT)}function rne(e,t){e._reconstructActiveFormattingElements(),e._insertElement(t,we.HTML),e.framesetOk=!1,e.insertionMode=e.insertionMode===Y.IN_TABLE||e.insertionMode===Y.IN_CAPTION||e.insertionMode===Y.IN_TABLE_BODY||e.insertionMode===Y.IN_ROW||e.insertionMode===Y.IN_CELL?Y.IN_SELECT_IN_TABLE:Y.IN_SELECT}function sne(e,t){e.openElements.currentTagId===v.OPTION&&e.openElements.pop(),e._reconstructActiveFormattingElements(),e._insertElement(t,we.HTML)}function ine(e,t){e.openElements.hasInScope(v.RUBY)&&e.openElements.generateImpliedEndTags(),e._insertElement(t,we.HTML)}function ane(e,t){e.openElements.hasInScope(v.RUBY)&&e.openElements.generateImpliedEndTagsWithExclusion(v.RTC),e._insertElement(t,we.HTML)}function one(e,t){e._reconstructActiveFormattingElements(),Kj(t),yv(t),t.selfClosing?e._appendElement(t,we.MATHML):e._insertElement(t,we.MATHML),t.ackSelfClosing=!0}function lne(e,t){e._reconstructActiveFormattingElements(),Yj(t),yv(t),t.selfClosing?e._appendElement(t,we.SVG):e._insertElement(t,we.SVG),t.ackSelfClosing=!0}function l2(e,t){e._reconstructActiveFormattingElements(),e._insertElement(t,we.HTML)}function br(e,t){switch(t.tagID){case v.I:case v.S:case v.B:case v.U:case v.EM:case v.TT:case v.BIG:case v.CODE:case v.FONT:case v.SMALL:case v.STRIKE:case v.STRONG:{Yte(e,t);break}case v.A:{Kte(e,t);break}case v.H1:case v.H2:case v.H3:case v.H4:case v.H5:case v.H6:{Fte(e,t);break}case v.P:case v.DL:case v.OL:case v.UL:case v.DIV:case v.DIR:case v.NAV:case v.MAIN:case v.MENU:case v.ASIDE:case v.CENTER:case v.FIGURE:case v.FOOTER:case v.HEADER:case v.HGROUP:case v.DIALOG:case v.DETAILS:case v.ADDRESS:case v.ARTICLE:case v.SEARCH:case v.SECTION:case v.SUMMARY:case v.FIELDSET:case v.BLOCKQUOTE:case v.FIGCAPTION:{Bte(e,t);break}case v.LI:case v.DD:case v.DT:{Hte(e,t);break}case v.BR:case v.IMG:case v.WBR:case v.AREA:case v.EMBED:case v.KEYGEN:{Xj(e,t);break}case v.HR:{Zte(e,t);break}case v.RB:case v.RTC:{ine(e,t);break}case v.RT:case v.RP:{ane(e,t);break}case v.PRE:case v.LISTING:{Ute(e,t);break}case v.XMP:{tne(e,t);break}case v.SVG:{lne(e,t);break}case v.HTML:{jte(e,t);break}case v.BASE:case v.LINK:case v.META:case v.STYLE:case v.TITLE:case v.SCRIPT:case v.BGSOUND:case v.BASEFONT:case v.TEMPLATE:{ei(e,t);break}case v.BODY:{Dte(e,t);break}case v.FORM:{$te(e,t);break}case v.NOBR:{Gte(e,t);break}case v.MATH:{one(e,t);break}case v.TABLE:{qte(e,t);break}case v.INPUT:{Xte(e,t);break}case v.PARAM:case v.TRACK:case v.SOURCE:{Qte(e,t);break}case v.IMAGE:{Jte(e,t);break}case v.BUTTON:{Vte(e,t);break}case v.APPLET:case v.OBJECT:case v.MARQUEE:{Wte(e,t);break}case v.IFRAME:{nne(e,t);break}case v.SELECT:{rne(e,t);break}case v.OPTION:case v.OPTGROUP:{sne(e,t);break}case v.NOEMBED:case v.NOFRAMES:{o2(e,t);break}case v.FRAMESET:{Pte(e,t);break}case v.TEXTAREA:{ene(e,t);break}case v.NOSCRIPT:{e.options.scriptingEnabled?o2(e,t):l2(e,t);break}case v.PLAINTEXT:{zte(e,t);break}case v.COL:case v.TH:case v.TD:case v.TR:case v.HEAD:case v.FRAME:case v.TBODY:case v.TFOOT:case v.THEAD:case v.CAPTION:case v.COLGROUP:break;default:l2(e,t)}}function cne(e,t){if(e.openElements.hasInScope(v.BODY)&&(e.insertionMode=Y.AFTER_BODY,e.options.sourceCodeLocationInfo)){const n=e.openElements.tryPeekProperlyNestedBodyElement();n&&e._setEndLocation(n,t)}}function une(e,t){e.openElements.hasInScope(v.BODY)&&(e.insertionMode=Y.AFTER_BODY,oD(e,t))}function dne(e,t){const n=t.tagID;e.openElements.hasInScope(n)&&(e.openElements.generateImpliedEndTags(),e.openElements.popUntilTagNamePopped(n))}function fne(e){const t=e.openElements.tmplCount>0,{formElement:n}=e;t||(e.formElement=null),(n||t)&&e.openElements.hasInScope(v.FORM)&&(e.openElements.generateImpliedEndTags(),t?e.openElements.popUntilTagNamePopped(v.FORM):n&&e.openElements.remove(n))}function hne(e){e.openElements.hasInButtonScope(v.P)||e._insertFakeElement(se.P,v.P),e._closePElement()}function pne(e){e.openElements.hasInListItemScope(v.LI)&&(e.openElements.generateImpliedEndTagsWithExclusion(v.LI),e.openElements.popUntilTagNamePopped(v.LI))}function mne(e,t){const n=t.tagID;e.openElements.hasInScope(n)&&(e.openElements.generateImpliedEndTagsWithExclusion(n),e.openElements.popUntilTagNamePopped(n))}function gne(e){e.openElements.hasNumberedHeaderInScope()&&(e.openElements.generateImpliedEndTags(),e.openElements.popUntilNumberedHeaderPopped())}function yne(e,t){const n=t.tagID;e.openElements.hasInScope(n)&&(e.openElements.generateImpliedEndTags(),e.openElements.popUntilTagNamePopped(n),e.activeFormattingElements.clearToLastMarker())}function bne(e){e._reconstructActiveFormattingElements(),e._insertFakeElement(se.BR,v.BR),e.openElements.pop(),e.framesetOk=!1}function Zj(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!==v.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 Gg(e,t){switch(t.tagID){case v.A:case v.B:case v.I:case v.S:case v.U:case v.EM:case v.TT:case v.BIG:case v.CODE:case v.FONT:case v.NOBR:case v.SMALL:case v.STRIKE:case v.STRONG:{bv(e,t);break}case v.P:{hne(e);break}case v.DL:case v.UL:case v.OL:case v.DIR:case v.DIV:case v.NAV:case v.PRE:case v.MAIN:case v.MENU:case v.ASIDE:case v.BUTTON:case v.CENTER:case v.FIGURE:case v.FOOTER:case v.HEADER:case v.HGROUP:case v.DIALOG:case v.ADDRESS:case v.ARTICLE:case v.DETAILS:case v.SEARCH:case v.SECTION:case v.SUMMARY:case v.LISTING:case v.FIELDSET:case v.BLOCKQUOTE:case v.FIGCAPTION:{dne(e,t);break}case v.LI:{pne(e);break}case v.DD:case v.DT:{mne(e,t);break}case v.H1:case v.H2:case v.H3:case v.H4:case v.H5:case v.H6:{gne(e);break}case v.BR:{bne(e);break}case v.BODY:{cne(e,t);break}case v.HTML:{une(e,t);break}case v.FORM:{fne(e);break}case v.APPLET:case v.OBJECT:case v.MARQUEE:{yne(e,t);break}case v.TEMPLATE:{Wo(e,t);break}default:Zj(e,t)}}function Jj(e,t){e.tmplInsertionModeStack.length>0?aD(e,t):Ev(e,t)}function Ene(e,t){var n;t.tagID===v.SCRIPT&&((n=e.scriptHandler)===null||n===void 0||n.call(e,e.openElements.current)),e.openElements.pop(),e.insertionMode=e.originalInsertionMode}function xne(e,t){e._err(t,ue.eofInElementThatCanContainOnlyText),e.openElements.pop(),e.insertionMode=e.originalInsertionMode,e.onEof(t)}function Vy(e,t){if(e.openElements.currentTagId!==void 0&&Gj.has(e.openElements.currentTagId))switch(e.pendingCharacterTokens.length=0,e.hasNonWhitespacePendingCharacterToken=!1,e.originalInsertionMode=e.insertionMode,e.insertionMode=Y.IN_TABLE_TEXT,t.type){case gt.CHARACTER:{tD(e,t);break}case gt.WHITESPACE_CHARACTER:{eD(e,t);break}}else jf(e,t)}function wne(e,t){e.openElements.clearBackToTableContext(),e.activeFormattingElements.insertMarker(),e._insertElement(t,we.HTML),e.insertionMode=Y.IN_CAPTION}function vne(e,t){e.openElements.clearBackToTableContext(),e._insertElement(t,we.HTML),e.insertionMode=Y.IN_COLUMN_GROUP}function _ne(e,t){e.openElements.clearBackToTableContext(),e._insertFakeElement(se.COLGROUP,v.COLGROUP),e.insertionMode=Y.IN_COLUMN_GROUP,xv(e,t)}function kne(e,t){e.openElements.clearBackToTableContext(),e._insertElement(t,we.HTML),e.insertionMode=Y.IN_TABLE_BODY}function Nne(e,t){e.openElements.clearBackToTableContext(),e._insertFakeElement(se.TBODY,v.TBODY),e.insertionMode=Y.IN_TABLE_BODY,Wg(e,t)}function Sne(e,t){e.openElements.hasInTableScope(v.TABLE)&&(e.openElements.popUntilTagNamePopped(v.TABLE),e._resetInsertionMode(),e._processStartTag(t))}function Tne(e,t){Qj(t)?e._appendElement(t,we.HTML):jf(e,t),t.ackSelfClosing=!0}function Ane(e,t){!e.formElement&&e.openElements.tmplCount===0&&(e._insertElement(t,we.HTML),e.formElement=e.openElements.current,e.openElements.pop())}function Cc(e,t){switch(t.tagID){case v.TD:case v.TH:case v.TR:{Nne(e,t);break}case v.STYLE:case v.SCRIPT:case v.TEMPLATE:{ei(e,t);break}case v.COL:{_ne(e,t);break}case v.FORM:{Ane(e,t);break}case v.TABLE:{Sne(e,t);break}case v.TBODY:case v.TFOOT:case v.THEAD:{kne(e,t);break}case v.INPUT:{Tne(e,t);break}case v.CAPTION:{wne(e,t);break}case v.COLGROUP:{vne(e,t);break}default:jf(e,t)}}function rf(e,t){switch(t.tagID){case v.TABLE:{e.openElements.hasInTableScope(v.TABLE)&&(e.openElements.popUntilTagNamePopped(v.TABLE),e._resetInsertionMode());break}case v.TEMPLATE:{Wo(e,t);break}case v.BODY:case v.CAPTION:case v.COL:case v.COLGROUP:case v.HTML:case v.TBODY:case v.TD:case v.TFOOT:case v.TH:case v.THEAD:case v.TR:break;default:jf(e,t)}}function jf(e,t){const n=e.fosterParentingEnabled;e.fosterParentingEnabled=!0,Yg(e,t),e.fosterParentingEnabled=n}function eD(e,t){e.pendingCharacterTokens.push(t)}function tD(e,t){e.pendingCharacterTokens.push(t),e.hasNonWhitespacePendingCharacterToken=!0}function Su(e,t){let n=0;if(e.hasNonWhitespacePendingCharacterToken)for(;n0&&e.openElements.currentTagId===v.OPTION&&e.openElements.tagIDs[e.openElements.stackTop-1]===v.OPTGROUP&&e.openElements.pop(),e.openElements.currentTagId===v.OPTGROUP&&e.openElements.pop();break}case v.OPTION:{e.openElements.currentTagId===v.OPTION&&e.openElements.pop();break}case v.SELECT:{e.openElements.hasInSelectScope(v.SELECT)&&(e.openElements.popUntilTagNamePopped(v.SELECT),e._resetInsertionMode());break}case v.TEMPLATE:{Wo(e,t);break}}}function Mne(e,t){const n=t.tagID;n===v.CAPTION||n===v.TABLE||n===v.TBODY||n===v.TFOOT||n===v.THEAD||n===v.TR||n===v.TD||n===v.TH?(e.openElements.popUntilTagNamePopped(v.SELECT),e._resetInsertionMode(),e._processStartTag(t)):sD(e,t)}function jne(e,t){const n=t.tagID;n===v.CAPTION||n===v.TABLE||n===v.TBODY||n===v.TFOOT||n===v.THEAD||n===v.TR||n===v.TD||n===v.TH?e.openElements.hasInTableScope(n)&&(e.openElements.popUntilTagNamePopped(v.SELECT),e._resetInsertionMode(),e.onEndTag(t)):iD(e,t)}function Dne(e,t){switch(t.tagID){case v.BASE:case v.BASEFONT:case v.BGSOUND:case v.LINK:case v.META:case v.NOFRAMES:case v.SCRIPT:case v.STYLE:case v.TEMPLATE:case v.TITLE:{ei(e,t);break}case v.CAPTION:case v.COLGROUP:case v.TBODY:case v.TFOOT:case v.THEAD:{e.tmplInsertionModeStack[0]=Y.IN_TABLE,e.insertionMode=Y.IN_TABLE,Cc(e,t);break}case v.COL:{e.tmplInsertionModeStack[0]=Y.IN_COLUMN_GROUP,e.insertionMode=Y.IN_COLUMN_GROUP,xv(e,t);break}case v.TR:{e.tmplInsertionModeStack[0]=Y.IN_TABLE_BODY,e.insertionMode=Y.IN_TABLE_BODY,Wg(e,t);break}case v.TD:case v.TH:{e.tmplInsertionModeStack[0]=Y.IN_ROW,e.insertionMode=Y.IN_ROW,qg(e,t);break}default:e.tmplInsertionModeStack[0]=Y.IN_BODY,e.insertionMode=Y.IN_BODY,br(e,t)}}function Pne(e,t){t.tagID===v.TEMPLATE&&Wo(e,t)}function aD(e,t){e.openElements.tmplCount>0?(e.openElements.popUntilTagNamePopped(v.TEMPLATE),e.activeFormattingElements.clearToLastMarker(),e.tmplInsertionModeStack.shift(),e._resetInsertionMode(),e.onEof(t)):Ev(e,t)}function Bne(e,t){t.tagID===v.HTML?br(e,t):Fm(e,t)}function oD(e,t){var n;if(t.tagID===v.HTML){if(e.fragmentContext||(e.insertionMode=Y.AFTER_AFTER_BODY),e.options.sourceCodeLocationInfo&&e.openElements.tagIDs[0]===v.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 Fm(e,t)}function Fm(e,t){e.insertionMode=Y.IN_BODY,Yg(e,t)}function Fne(e,t){switch(t.tagID){case v.HTML:{br(e,t);break}case v.FRAMESET:{e._insertElement(t,we.HTML);break}case v.FRAME:{e._appendElement(t,we.HTML),t.ackSelfClosing=!0;break}case v.NOFRAMES:{ei(e,t);break}}}function Une(e,t){t.tagID===v.FRAMESET&&!e.openElements.isRootHtmlElementCurrent()&&(e.openElements.pop(),!e.fragmentContext&&e.openElements.currentTagId!==v.FRAMESET&&(e.insertionMode=Y.AFTER_FRAMESET))}function $ne(e,t){switch(t.tagID){case v.HTML:{br(e,t);break}case v.NOFRAMES:{ei(e,t);break}}}function Hne(e,t){t.tagID===v.HTML&&(e.insertionMode=Y.AFTER_AFTER_FRAMESET)}function zne(e,t){t.tagID===v.HTML?br(e,t):jp(e,t)}function jp(e,t){e.insertionMode=Y.IN_BODY,Yg(e,t)}function Vne(e,t){switch(t.tagID){case v.HTML:{br(e,t);break}case v.NOFRAMES:{ei(e,t);break}}}function Kne(e,t){t.chars=tn,e._insertCharacters(t)}function Yne(e,t){e._insertCharacters(t),e.framesetOk=!1}function lD(e){for(;e.treeAdapter.getNamespaceURI(e.openElements.current)!==we.HTML&&e.openElements.currentTagId!==void 0&&!e._isIntegrationPoint(e.openElements.currentTagId,e.openElements.current);)e.openElements.pop()}function Gne(e,t){if(lte(t))lD(e),e._startTagOutsideForeignContent(t);else{const n=e._getAdjustedCurrentElement(),r=e.treeAdapter.getNamespaceURI(n);r===we.MATHML?Kj(t):r===we.SVG&&(cte(t),Yj(t)),yv(t),t.selfClosing?e._appendElement(t,r):e._insertElement(t,r),t.ackSelfClosing=!0}}function Wne(e,t){if(t.tagID===v.P||t.tagID===v.BR){lD(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)===we.HTML){e._endTagOutsideForeignContent(t);break}const s=e.treeAdapter.getTagName(r);if(s.toLowerCase()===t.tagName){t.tagName=s,e.openElements.shortenToLength(n);break}}}se.AREA,se.BASE,se.BASEFONT,se.BGSOUND,se.BR,se.COL,se.EMBED,se.FRAME,se.HR,se.IMG,se.INPUT,se.KEYGEN,se.LINK,se.META,se.PARAM,se.SOURCE,se.TRACK,se.WBR;const qne=/<(\/?)(iframe|noembed|noframes|plaintext|script|style|textarea|title|xmp)(?=[\t\n\f\r />])/gi,Xne=new Set(["mdxFlowExpression","mdxJsxFlowElement","mdxJsxTextElement","mdxTextExpression","mdxjsEsm"]),c2={sourceCodeLocationInfo:!0,scriptingEnabled:!1};function cD(e,t){const n=are(e),r=k3("type",{handlers:{root:Qne,element:Zne,text:Jne,comment:dD,doctype:ere,raw:nre},unknown:rre}),s={parser:n?new a2(c2):a2.getFragmentParser(void 0,c2),handle(o){r(o,s)},stitches:!1,options:t||{}};r(e,s),Jc(s,_i());const i=n?s.parser.document:s.parser.getFragment(),a=oee(i,{file:s.options.file});return s.stitches&&Lf(a,"comment",function(o,c,u){const d=o;if(d.value.stitch&&u&&c!==void 0){const f=u.children;return f[c]=d.value.stitch,c}}),a.type==="root"&&a.children.length===1&&a.children[0].type===e.type?a.children[0]:a}function uD(e,t){let n=-1;if(e)for(;++n4&&(t.parser.tokenizer.state=0);const n={type:gt.CHARACTER,chars:e.value,location:Df(e)};Jc(t,_i(e)),t.parser.currentToken=n,t.parser._processToken(t.parser.currentToken)}function ere(e,t){const n={type:gt.DOCTYPE,name:"html",forceQuirks:!1,publicId:"",systemId:"",location:Df(e)};Jc(t,_i(e)),t.parser.currentToken=n,t.parser._processToken(t.parser.currentToken)}function tre(e,t){t.stitches=!0;const n=ore(e);if("children"in e&&"children"in n){const r=cD({type:"root",children:e.children},t.options);n.children=r.children}dD({type:"comment",value:{stitch:n}},t)}function dD(e,t){const n=e.value,r={type:gt.COMMENT,data:n,location:Df(e)};Jc(t,_i(e)),t.parser.currentToken=r,t.parser._processToken(t.parser.currentToken)}function nre(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,fD(t,_i(e)),t.parser.tokenizer.write(t.options.tagfilter?e.value.replace(qne,"<$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 rre(e,t){const n=e;if(t.options.passThrough&&t.options.passThrough.includes(n.type))tre(n,t);else{let r="";throw Xne.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 Jc(e,t){fD(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=Cn.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 fD(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 sre(e,t){const n=e.tagName.toLowerCase();if(t.parser.tokenizer.state===Cn.PLAINTEXT)return;Jc(t,_i(e));const r=t.parser.openElements.current;let s="namespaceURI"in r?r.namespaceURI:mo.html;s===mo.html&&n==="svg"&&(s=mo.svg);const i=fee({...e,children:[]},{space:s===mo.svg?"svg":"html"}),a={type:gt.START_TAG,tagName:n,tagID:Zc(n),selfClosing:!1,ackSelfClosing:!1,attrs:"attrs"in i?i.attrs:[],location:Df(e)};t.parser.currentToken=a,t.parser._processToken(t.parser.currentToken),t.parser.tokenizer.lastStartTagName=n}function ire(e,t){const n=e.tagName.toLowerCase();if(!t.parser.tokenizer.inForeignNode&&xee.includes(n)||t.parser.tokenizer.state===Cn.PLAINTEXT)return;Jc(t,Ug(e));const r={type:gt.END_TAG,tagName:n,tagID:Zc(n),selfClosing:!1,ackSelfClosing:!1,attrs:[],location:Df(e)};t.parser.currentToken=r,t.parser._processToken(t.parser.currentToken),n===t.parser.tokenizer.lastStartTagName&&(t.parser.tokenizer.state===Cn.RCDATA||t.parser.tokenizer.state===Cn.RAWTEXT||t.parser.tokenizer.state===Cn.SCRIPT_DATA)&&(t.parser.tokenizer.state=Cn.DATA)}function are(e){const t=e.type==="root"?e.children[0]:e;return!!(t&&(t.type==="doctype"||t.type==="element"&&t.tagName.toLowerCase()==="html"))}function Df(e){const t=_i(e)||{line:void 0,column:void 0,offset:void 0},n=Ug(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 ore(e){return"children"in e?Tc({...e,children:[]}):Tc(e)}function lre(e){return function(t,n){return cD(t,{...e,file:n})}}const hD=[".mp4",".webm",".mov",".m4v",".ogg",".avi"];function pD(e){if(!e)return!1;try{const t=e.toLowerCase();return hD.some(n=>t.includes(n))}catch{return!1}}function cre(e){var r;const t=(r=e==null?void 0:e.properties)==null?void 0:r.href;if(!t)return!1;if(pD(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 hD.some(i=>s.includes(i))}return!1}function ure({text:e,className:t,allowRawHtml:n=!0}){const[r,s]=w.useState(null),i=(c,u)=>{if(c.src)return c.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=c=>{try{const d=new URL(c).pathname.split("/");return d[d.length-1]||"video.mp4"}catch{return"video.mp4"}},o=c=>c?Array.isArray(c)?c.map(u=>(u==null?void 0:u.value)||"").join("")||"video":(c==null?void 0:c.value)||"video":"video";return l.jsxs("div",{className:t?`md ${t}`:"md",children:[l.jsx(hq,{remarkPlugins:[SQ],rehypePlugins:n?[lre,YT]:[YT],components:{a:({node:c,...u})=>{const d=u.href;if(d&&(pD(d)||cre(c))){const f=d,h=o(c==null?void 0:c.children);return l.jsxs("div",{className:"video-container",children:[l.jsxs("button",{type:"button",className:"video-preview-trigger","aria-label":`点击播放视频: ${h}`,onClick:()=>s({src:f,title:h}),children:[l.jsx("video",{src:f,playsInline:!0,className:"video-thumbnail",preload:"metadata"}),l.jsx("span",{className:"video-preview-hint","aria-hidden":"true",children:l.jsx(tc,{})})]}),l.jsx("div",{className:"video-caption",children:l.jsx("a",{href:f,target:"_blank",rel:"noopener noreferrer",className:"video-link-text",children:h})})]})}return l.jsx("a",{...u,target:"_blank",rel:"noopener noreferrer"})},img:({node:c,src:u,alt:d,...f})=>{const h=l.jsx("img",{...f,src:u,alt:d??"",loading:"lazy"});return u?l.jsx(bL,{src:u,children:l.jsxs("button",{type:"button",className:"image-preview-trigger","aria-label":`放大预览:${d||"图片"}`,children:[h,l.jsx("span",{className:"image-preview-hint","aria-hidden":"true",children:l.jsx(tc,{})})]})}):h},video:({node:c,src:u,children:d,...f})=>{const h=i({src:u},d);return h?l.jsx("div",{className:"video-container",children:l.jsxs("button",{type:"button",className:"video-preview-trigger","aria-label":"点击放大视频",onClick:()=>s({src:h}),children:[l.jsx("video",{src:h,...f,playsInline:!0,className:"video-thumbnail",children:d}),l.jsx("span",{className:"video-preview-hint","aria-hidden":"true",children:l.jsx(tc,{})})]})}):l.jsx("video",{src:u,controls:!0,playsInline:!0,className:"video-inline",...f,children:d})}},children:e}),r&&l.jsx("div",{className:"video-viewer-backdrop",role:"dialog","aria-modal":"true","aria-label":"视频预览",onClick:()=>s(null),children:l.jsxs("div",{className:"video-viewer",onClick:c=>c.stopPropagation(),children:[l.jsxs("div",{className:"video-viewer-header",children:[l.jsx("div",{className:"video-viewer-title",children:r.title||a(r.src)}),l.jsxs("nav",{className:"video-viewer-nav",children:[l.jsx("a",{href:r.src,download:r.title||a(r.src),"aria-label":"下载视频",title:"下载视频",className:"video-viewer-download",children:l.jsx(Rw,{})}),l.jsx("button",{type:"button",className:"video-viewer-close","aria-label":"关闭",onClick:()=>s(null),children:l.jsx(Hr,{})})]})]}),l.jsx("div",{className:"video-viewer-body",children:l.jsx("video",{src:r.src,controls:!0,autoPlay:!0,playsInline:!0,className:"video-fullscreen"})})]})})]})}const Pf=w.memo(ure),u2=6,d2=7,dre={active:"可用",available:"可用",creating:"创建中",disabled:"已停用",enabled:"已启用",failed:"异常",inactive:"未启用",pending:"等待中",published:"已发布",ready:"就绪",released:"已发布",running:"运行中",success:"正常",unavailable:"不可用",unreleased:"未发布",updating:"更新中"};function vE(e){return dre[(e||"").trim().toLowerCase()]||"未知"}function f2(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 fre(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 hre(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 pre({className:e="icon"}){return l.jsxs("svg",{className:e,viewBox:"0 0 24 24",fill:"none","aria-hidden":!0,children:[l.jsx("path",{d:"M6.25 4.75h8.6l2.9 2.9v11.6h-11.5z",stroke:"currentColor",strokeWidth:"1.6",strokeLinejoin:"round"}),l.jsx("path",{d:"M14.75 4.9v3h2.85M8.9 11.1h4.2M8.9 14h5.7",stroke:"currentColor",strokeWidth:"1.6",strokeLinecap:"round"}),l.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 mre(){return l.jsx("svg",{className:"icon",viewBox:"0 0 24 24",fill:"none","aria-hidden":!0,children:l.jsx("path",{d:"m7.5 7.5 9 9m0-9-9 9",stroke:"currentColor",strokeWidth:"1.7",strokeLinecap:"round"})})}function h2({direction:e}){return l.jsx("svg",{className:"icon",viewBox:"0 0 20 20",fill:"none","aria-hidden":!0,children:l.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 _E(){return l.jsx("span",{className:"skillcenter-loading-mark","aria-hidden":!0})}function p2({page:e,total:t,pageSize:n,onPage:r}){const s=Math.max(1,Math.ceil(t/n));return l.jsxs("footer",{className:"skillcenter-pager",children:[l.jsxs("span",{children:["共 ",t," 项"]}),l.jsxs("div",{className:"skillcenter-pager-actions",children:[l.jsx("button",{type:"button",onClick:()=>r(e-1),disabled:e<=1,"aria-label":"上一页",children:l.jsx(h2,{direction:"left"})}),l.jsxs("span",{children:[e," / ",s]}),l.jsx("button",{type:"button",onClick:()=>r(e+1),disabled:e>=s,"aria-label":"下一页",children:l.jsx(h2,{direction:"right"})})]})]})}function Dp({children:e}){return l.jsx("div",{className:"skillcenter-empty",children:e})}function gre({skill:e,space:t,region:n,detail:r,loading:s,error:i,onClose:a}){return w.useEffect(()=>{const o=c=>{c.key==="Escape"&&a()};return window.addEventListener("keydown",o),()=>window.removeEventListener("keydown",o)},[a]),l.jsx("div",{className:"skill-detail-backdrop",role:"presentation",onMouseDown:a,children:l.jsxs("section",{className:"skill-detail-dialog",role:"dialog","aria-modal":"true","aria-labelledby":"skill-detail-title",onMouseDown:o=>o.stopPropagation(),children:[l.jsxs("header",{className:"skill-detail-head",children:[l.jsxs("div",{className:"skill-detail-heading",children:[l.jsx("span",{className:"skillcenter-symbol skillcenter-symbol--skill",children:l.jsx(pre,{})}),l.jsxs("div",{children:[l.jsx("h2",{id:"skill-detail-title",children:(r==null?void 0:r.name)||e.skillName}),l.jsx("p",{children:(r==null?void 0:r.description)||e.skillDescription||"暂无描述"})]})]}),l.jsx("button",{type:"button",className:"skill-detail-close",onClick:a,"aria-label":"关闭技能详情",children:l.jsx(mre,{})})]}),l.jsxs("dl",{className:"skill-detail-meta",children:[l.jsxs("div",{children:[l.jsx("dt",{children:"技能 ID"}),l.jsx("dd",{title:e.skillId,children:e.skillId})]}),l.jsxs("div",{children:[l.jsx("dt",{children:"版本"}),l.jsx("dd",{children:(r==null?void 0:r.version)||e.version||"—"})]}),l.jsxs("div",{children:[l.jsx("dt",{children:"状态"}),l.jsx("dd",{children:vE(e.skillStatus)})]}),l.jsxs("div",{children:[l.jsx("dt",{children:"技能空间"}),l.jsx("dd",{title:t.name,children:t.name})]}),l.jsxs("div",{children:[l.jsx("dt",{children:"Project"}),l.jsx("dd",{title:t.projectName||"default",children:t.projectName||"default"})]}),l.jsxs("div",{children:[l.jsx("dt",{children:"地域"}),l.jsx("dd",{children:n==="cn-beijing"?"北京":"上海"})]})]}),l.jsxs("div",{className:"skill-detail-content",children:[l.jsx("div",{className:"skill-detail-content-title",children:"SKILL.md"}),s?l.jsxs("div",{className:"skillcenter-loading",children:[l.jsx(_E,{}),"正在读取技能内容…"]}):i?l.jsx("div",{className:"skillcenter-error",children:i}):r!=null&&r.skillMd?l.jsx(Pf,{text:hre(r.skillMd),className:"skill-detail-markdown",allowRawHtml:!1}):l.jsx(Dp,{children:"该技能暂无 SKILL.md 内容"})]})]})})}function yre(){const[e,t]=w.useState("cn-beijing"),[n,r]=w.useState([]),[s,i]=w.useState(1),[a,o]=w.useState(0),[c,u]=w.useState(!1),[d,f]=w.useState(""),[h,p]=w.useState(null),[m,y]=w.useState([]),[E,g]=w.useState(1),[x,b]=w.useState(0),[_,k]=w.useState(!1),[N,C]=w.useState(""),[S,A]=w.useState(null),[O,D]=w.useState(null),[F,X]=w.useState(!1),[L,j]=w.useState(""),T=w.useRef(0);w.useEffect(()=>{let V=!0;return u(!0),f(""),xV({region:e,page:s,pageSize:u2}).then(G=>{if(!V)return;const P=G.items||[];r(P),o(G.totalCount||0),p(ie=>P.find(q=>q.id===(ie==null?void 0:ie.id))||null)}).catch(G=>{V&&(r([]),o(0),p(null),f(G instanceof Error?G.message:"读取技能空间失败,请稍后重试"))}).finally(()=>{V&&u(!1)}),()=>{V=!1}},[e,s]),w.useEffect(()=>{if(!h){y([]),b(0);return}let V=!0;return k(!0),C(""),wV(h.id,{region:e,page:E,pageSize:d2,project:h.projectName}).then(G=>{V&&(y(G.items||[]),b(G.totalCount||0))}).catch(G=>{V&&(y([]),b(0),C(G instanceof Error?G.message:"读取技能失败,请稍后重试"))}).finally(()=>{V&&k(!1)}),()=>{V=!1}},[e,h,E]);const R=V=>{V!==e&&(B(),t(V),i(1),g(1),p(null),y([]))},M=V=>{B(),p(V),g(1)},B=()=>{T.current+=1,A(null),D(null),j(""),X(!1)},I=async V=>{if(!h)return;const G=T.current+1;T.current=G,A(V),D(null),j(""),X(!0);try{const P=await vV(h.id,V.skillId,V.version,e,h.projectName);T.current===G&&D(P)}catch(P){T.current===G&&j(P instanceof Error?P.message:"读取技能详情失败,请稍后重试")}finally{T.current===G&&X(!1)}};return l.jsxs("section",{className:"skillcenter",children:[l.jsxs("div",{className:"skillcenter-browser",children:[l.jsxs("section",{className:"skillcenter-panel","aria-label":"技能空间列表",children:[l.jsxs("header",{className:"skillcenter-panel-head",children:[l.jsxs("div",{children:[l.jsx("h2",{children:"技能空间"}),l.jsx("span",{className:"skillcenter-count-badge",children:a})]}),l.jsxs("div",{className:"skillcenter-regions","aria-label":"地域",children:[l.jsx("button",{type:"button",className:e==="cn-beijing"?"active":"",onClick:()=>R("cn-beijing"),children:"北京"}),l.jsx("button",{type:"button",className:e==="cn-shanghai"?"active":"",onClick:()=>R("cn-shanghai"),children:"上海"})]})]}),l.jsxs("div",{className:"skillcenter-listwrap",children:[c&&l.jsxs("div",{className:"skillcenter-loading skillcenter-loading--overlay",children:[l.jsx(_E,{}),"正在读取技能空间…"]}),d?l.jsx("div",{className:"skillcenter-error",children:d}):n.length===0&&!c?l.jsx(Dp,{children:"当前地域暂无可访问的技能空间"}):l.jsx("div",{className:"skillcenter-list",children:n.map(V=>l.jsx("button",{type:"button",className:`skillcenter-space-item ${(h==null?void 0:h.id)===V.id?"active":""}`,onClick:()=>M(V),children:l.jsxs("span",{className:"skillcenter-item-body",children:[l.jsx("span",{className:"skillcenter-item-title",title:V.name,children:V.name}),l.jsx("span",{className:"skillcenter-item-description",children:V.description||"暂无描述"}),l.jsxs("span",{className:"skillcenter-item-meta",children:[l.jsx("span",{className:`skillcenter-status ${f2(V.status)}`,children:vE(V.status)}),l.jsxs("span",{className:"skillcenter-meta-text",title:V.projectName||"default",children:["Project · ",V.projectName||"default"]}),l.jsxs("span",{className:"skillcenter-meta-text",children:[V.skillCount??0," 个技能"]}),V.updatedAt&&l.jsxs("span",{className:"skillcenter-meta-text",children:["更新于 ",fre(V.updatedAt)]})]})]})},`${V.projectName||"default"}:${V.id}`))})]}),l.jsx(p2,{page:s,total:a,pageSize:u2,onPage:i})]}),l.jsx("section",{className:"skillcenter-panel","aria-label":"技能列表",children:h?l.jsxs(l.Fragment,{children:[l.jsxs("header",{className:"skillcenter-panel-head",children:[l.jsx("div",{children:l.jsxs("h2",{title:h.name,children:[h.name," · 技能"]})}),l.jsx("span",{children:x})]}),l.jsxs("div",{className:"skillcenter-listwrap",children:[_&&l.jsxs("div",{className:"skillcenter-loading skillcenter-loading--overlay",children:[l.jsx(_E,{}),"正在读取技能…"]}),N?l.jsx("div",{className:"skillcenter-error",children:N}):m.length===0&&!_?l.jsx(Dp,{children:"这个空间中暂无技能"}):l.jsx("div",{className:"skillcenter-list skillcenter-list--skills",children:m.map(V=>l.jsx("button",{type:"button",className:"skillcenter-skill-item",onClick:()=>void I(V),children:l.jsxs("span",{className:"skillcenter-item-body",children:[l.jsx("span",{className:"skillcenter-item-title",title:V.skillName,children:V.skillName}),l.jsx("span",{className:"skillcenter-item-description",children:V.skillDescription||"暂无描述"}),l.jsxs("span",{className:"skillcenter-item-meta",children:[l.jsx("span",{className:`skillcenter-status ${f2(V.skillStatus)}`,children:vE(V.skillStatus)}),l.jsxs("span",{className:"skillcenter-meta-text",children:["版本 · ",V.version||"—"]})]})]})},`${V.skillId}:${V.version}`))})]}),l.jsx(p2,{page:E,total:x,pageSize:d2,onPage:g})]}):l.jsx(Dp,{children:"点击 Skill 空间以查看详情"})})]}),S&&h&&l.jsx(gre,{skill:S,space:h,region:e,detail:O,loading:F,error:L,onClose:B})]})}function bre({onAdded:e,onCancel:t}){const[n,r]=w.useState(""),[s,i]=w.useState(""),[a,o]=w.useState(""),[c,u]=w.useState(!1),[d,f]=w.useState(""),h=n.trim().length>0&&s.trim().length>0&&!c;async function p(){if(h){u(!0),f("");try{const m=await vM(a,n,s,a);if(m.apps.length===0){f("连接成功,但该地址未发现任何 Agent(/list-apps 为空)。"),u(!1);return}e(Mo(m.id,m.apps[0]))}catch(m){f(`连接失败:${String(m)}。请检查 URL、API Key,以及该网关是否允许跨域。`),u(!1)}}}return l.jsx("div",{className:"addagent",children:l.jsxs("div",{className:"addagent-card",children:[l.jsx("h2",{className:"addagent-title",children:"添加 AgentKit 智能体"}),l.jsx("p",{className:"addagent-sub",children:"填入 AgentKit 部署的访问地址与 API Key,将通过 ADK 协议连接,连接成功后其 Agent 会出现在左上角的下拉中。"}),l.jsxs("label",{className:"addagent-field",children:[l.jsx("span",{className:"addagent-label",children:"访问地址 URL"}),l.jsx("input",{className:"addagent-input",value:n,onChange:m=>r(m.target.value),placeholder:"https://xxxxx.apigateway-cn-beijing.volceapi.com",autoFocus:!0})]}),l.jsxs("label",{className:"addagent-field",children:[l.jsx("span",{className:"addagent-label",children:"API Key"}),l.jsx("input",{className:"addagent-input",type:"password",value:s,onChange:m=>i(m.target.value),placeholder:"以 Authorization: Bearer 方式连接"})]}),l.jsxs("label",{className:"addagent-field",children:[l.jsx("span",{className:"addagent-label",children:"显示名称(可选)"}),l.jsx("input",{className:"addagent-input",value:a,onChange:m=>o(m.target.value),placeholder:"默认取 URL 的主机名"})]}),d&&l.jsx("div",{className:"addagent-error",children:d}),l.jsxs("div",{className:"addagent-actions",children:[l.jsx("button",{className:"addagent-btn addagent-btn--ghost",onClick:t,disabled:c,children:"取消"}),l.jsxs("button",{className:"addagent-btn addagent-btn--primary",onClick:p,disabled:!h,children:[c?l.jsx(Mt,{className:"icon spin"}):null,c?"连接中…":"连接并添加"]})]})]})})}function jn(e){if(typeof e=="string"||typeof e=="number")return""+e;let t="";if(Array.isArray(e))for(let n=0,r;n{}};function Xg(){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}})}Pp.prototype=Xg.prototype={constructor:Pp,on:function(e,t){var n=this._,r=xre(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)),g2.hasOwnProperty(t)?{space:g2[t],local:e}:e}function vre(e){return function(){var t=this.ownerDocument,n=this.namespaceURI;return n===kE&&t.documentElement.namespaceURI===kE?t.createElement(e):t.createElementNS(n,e)}}function _re(e){return function(){return this.ownerDocument.createElementNS(e.space,e.local)}}function mD(e){var t=Qg(e);return(t.local?_re:vre)(t)}function kre(){}function wv(e){return e==null?kre:function(){return this.querySelector(e)}}function Nre(e){typeof e!="function"&&(e=wv(e));for(var t=this._groups,n=t.length,r=new Array(n),s=0;s=b&&(b=x+1);!(k=E[b])&&++b=0;)(a=r[s])&&(i&&a.compareDocumentPosition(i)^4&&i.parentNode.insertBefore(a,i),i=a);return this}function Xre(e){e||(e=Qre);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 Zre(){var e=arguments[0];return arguments[0]=this,e.apply(null,arguments),this}function Jre(){return Array.from(this)}function ese(){for(var e=this._groups,t=0,n=e.length;t1?this.each((t==null?dse:typeof t=="function"?hse:fse)(e,t,n??"")):Ic(this.node(),e)}function Ic(e,t){return e.style.getPropertyValue(t)||xD(e).getComputedStyle(e,null).getPropertyValue(t)}function mse(e){return function(){delete this[e]}}function gse(e,t){return function(){this[e]=t}}function yse(e,t){return function(){var n=t.apply(this,arguments);n==null?delete this[e]:this[e]=n}}function bse(e,t){return arguments.length>1?this.each((t==null?mse:typeof t=="function"?yse:gse)(e,t)):this.node()[e]}function wD(e){return e.trim().split(/^|\s+/)}function vv(e){return e.classList||new vD(e)}function vD(e){this._node=e,this._names=wD(e.getAttribute("class")||"")}vD.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 _D(e,t){for(var n=vv(e),r=-1,s=t.length;++r=0&&(n=t.slice(r+1),t=t.slice(0,r)),{type:t,name:n}})}function Yse(e){return function(){var t=this.__on;if(t){for(var n=0,r=-1,s=t.length,i;n()=>e;function NE(e,{sourceEvent:t,subject:n,target:r,identifier:s,active:i,x:a,y:o,dx:c,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:c,enumerable:!0,configurable:!0},dy:{value:u,enumerable:!0,configurable:!0},_:{value:d}})}NE.prototype.on=function(){var e=this._.on.apply(this._,arguments);return e===this._?this:e};function nie(e){return!e.ctrlKey&&!e.button}function rie(){return this.parentNode}function sie(e,t){return t??{x:e.x,y:e.y}}function iie(){return navigator.maxTouchPoints||"ontouchstart"in this}function CD(){var e=nie,t=rie,n=sie,r=iie,s={},i=Xg("start","drag","end"),a=0,o,c,u,d,f=0;function h(_){_.on("mousedown.drag",p).filter(r).on("touchstart.drag",E).on("touchmove.drag",g,tie).on("touchend.drag touchcancel.drag",x).style("touch-action","none").style("-webkit-tap-highlight-color","rgba(0,0,0,0)")}function p(_,k){if(!(d||!e.call(this,_,k))){var N=b(this,t.call(this,_,k),_,k,"mouse");N&&(Xr(_.view).on("mousemove.drag",m,sf).on("mouseup.drag",y,sf),TD(_.view),Ky(_),u=!1,o=_.clientX,c=_.clientY,N("start",_))}}function m(_){if(rc(_),!u){var k=_.clientX-o,N=_.clientY-c;u=k*k+N*N>f}s.mouse("drag",_)}function y(_){Xr(_.view).on("mousemove.drag mouseup.drag",null),AD(_.view,u),rc(_),s.mouse("end",_)}function E(_,k){if(e.call(this,_,k)){var N=_.changedTouches,C=t.call(this,_,k),S=N.length,A,O;for(A=0;A>8&15|t>>4&240,t>>4&15|t&240,(t&15)<<4|t&15,1):n===8?Xh(t>>24&255,t>>16&255,t>>8&255,(t&255)/255):n===4?Xh(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=oie.exec(e))?new Pr(t[1],t[2],t[3],1):(t=lie.exec(e))?new Pr(t[1]*255/100,t[2]*255/100,t[3]*255/100,1):(t=cie.exec(e))?Xh(t[1],t[2],t[3],t[4]):(t=uie.exec(e))?Xh(t[1]*255/100,t[2]*255/100,t[3]*255/100,t[4]):(t=die.exec(e))?_2(t[1],t[2]/100,t[3]/100,1):(t=fie.exec(e))?_2(t[1],t[2]/100,t[3]/100,t[4]):y2.hasOwnProperty(e)?x2(y2[e]):e==="transparent"?new Pr(NaN,NaN,NaN,0):null}function x2(e){return new Pr(e>>16&255,e>>8&255,e&255,1)}function Xh(e,t,n,r){return r<=0&&(e=t=n=NaN),new Pr(e,t,n,r)}function mie(e){return e instanceof Ff||(e=Do(e)),e?(e=e.rgb(),new Pr(e.r,e.g,e.b,e.opacity)):new Pr}function SE(e,t,n,r){return arguments.length===1?mie(e):new Pr(e,t,n,r??1)}function Pr(e,t,n,r){this.r=+e,this.g=+t,this.b=+n,this.opacity=+r}_v(Pr,SE,ID(Ff,{brighter(e){return e=e==null?$m:Math.pow($m,e),new Pr(this.r*e,this.g*e,this.b*e,this.opacity)},darker(e){return e=e==null?af:Math.pow(af,e),new Pr(this.r*e,this.g*e,this.b*e,this.opacity)},rgb(){return this},clamp(){return new Pr(No(this.r),No(this.g),No(this.b),Hm(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:w2,formatHex:w2,formatHex8:gie,formatRgb:v2,toString:v2}));function w2(){return`#${go(this.r)}${go(this.g)}${go(this.b)}`}function gie(){return`#${go(this.r)}${go(this.g)}${go(this.b)}${go((isNaN(this.opacity)?1:this.opacity)*255)}`}function v2(){const e=Hm(this.opacity);return`${e===1?"rgb(":"rgba("}${No(this.r)}, ${No(this.g)}, ${No(this.b)}${e===1?")":`, ${e})`}`}function Hm(e){return isNaN(e)?1:Math.max(0,Math.min(1,e))}function No(e){return Math.max(0,Math.min(255,Math.round(e)||0))}function go(e){return e=No(e),(e<16?"0":"")+e.toString(16)}function _2(e,t,n,r){return r<=0?e=t=n=NaN:n<=0||n>=1?e=t=NaN:t<=0&&(e=NaN),new Hs(e,t,n,r)}function OD(e){if(e instanceof Hs)return new Hs(e.h,e.s,e.l,e.opacity);if(e instanceof Ff||(e=Do(e)),!e)return new Hs;if(e instanceof Hs)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,c=(i+s)/2;return o?(t===i?a=(n-r)/o+(n0&&c<1?0:a,new Hs(a,o,c,e.opacity)}function yie(e,t,n,r){return arguments.length===1?OD(e):new Hs(e,t,n,r??1)}function Hs(e,t,n,r){this.h=+e,this.s=+t,this.l=+n,this.opacity=+r}_v(Hs,yie,ID(Ff,{brighter(e){return e=e==null?$m:Math.pow($m,e),new Hs(this.h,this.s,this.l*e,this.opacity)},darker(e){return e=e==null?af:Math.pow(af,e),new Hs(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 Pr(Yy(e>=240?e-240:e+120,s,r),Yy(e,s,r),Yy(e<120?e+240:e-120,s,r),this.opacity)},clamp(){return new Hs(k2(this.h),Qh(this.s),Qh(this.l),Hm(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=Hm(this.opacity);return`${e===1?"hsl(":"hsla("}${k2(this.h)}, ${Qh(this.s)*100}%, ${Qh(this.l)*100}%${e===1?")":`, ${e})`}`}}));function k2(e){return e=(e||0)%360,e<0?e+360:e}function Qh(e){return Math.max(0,Math.min(1,e||0))}function Yy(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 kv=e=>()=>e;function bie(e,t){return function(n){return e+n*t}}function Eie(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 xie(e){return(e=+e)==1?RD:function(t,n){return n-t?Eie(t,n,e):kv(isNaN(t)?n:t)}}function RD(e,t){var n=t-e;return n?bie(e,n):kv(isNaN(e)?t:e)}const zm=function e(t){var n=xie(t);function r(s,i){var a=n((s=SE(s)).r,(i=SE(i)).r),o=n(s.g,i.g),c=n(s.b,i.b),u=RD(s.opacity,i.opacity);return function(d){return s.r=a(d),s.g=o(d),s.b=c(d),s.opacity=u(d),s+""}}return r.gamma=e,r}(1);function wie(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,c.push({i:a,x:hi(r,s)})),n=Gy.lastIndex;return n180?d+=360:d-u>180&&(u+=360),h.push({i:f.push(s(f)+"rotate(",null,r)-2,x:hi(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:hi(u,d)}):d&&f.push(s(f)+"skewX("+d+r)}function c(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:hi(u,f)},{i:y-2,x:hi(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),c(u.scaleX,u.scaleY,d.scaleX,d.scaleY,f,h),u=d=null,function(p){for(var m=-1,y=h.length,E;++m=0&&e._call.call(void 0,t),e=e._next;--Oc}function T2(){Po=(Km=lf.now())+Zg,Oc=Vu=0;try{Die()}finally{Oc=0,Bie(),Po=0}}function Pie(){var e=lf.now(),t=e-Km;t>DD&&(Zg-=t,Km=e)}function Bie(){for(var e,t=Vm,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:Vm=n);Ku=e,CE(r)}function CE(e){if(!Oc){Vu&&(Vu=clearTimeout(Vu));var t=e-Po;t>24?(e<1/0&&(Vu=setTimeout(T2,e-lf.now()-Zg)),Tu&&(Tu=clearInterval(Tu))):(Tu||(Km=lf.now(),Tu=setInterval(Pie,DD)),Oc=1,PD(T2))}}function A2(e,t,n){var r=new Ym;return t=t==null?0:+t,r.restart(s=>{r.stop(),e(s+t)},t,n),r}var Fie=Xg("start","end","cancel","interrupt"),Uie=[],FD=0,C2=1,IE=2,Fp=3,I2=4,OE=5,Up=6;function Jg(e,t,n,r,s,i){var a=e.__transition;if(!a)e.__transition={};else if(n in a)return;$ie(e,n,{name:t,index:r,group:s,on:Fie,tween:Uie,time:i.time,delay:i.delay,duration:i.duration,ease:i.ease,timer:null,state:FD})}function Sv(e,t){var n=ti(e,t);if(n.state>FD)throw new Error("too late; already scheduled");return n}function Ni(e,t){var n=ti(e,t);if(n.state>Fp)throw new Error("too late; already running");return n}function ti(e,t){var n=e.__transition;if(!n||!(n=n[t]))throw new Error("transition not found");return n}function $ie(e,t,n){var r=e.__transition,s;r[t]=n,n.timer=BD(i,0,n.time);function i(u){n.state=C2,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!==C2)return c();for(d in r)if(p=r[d],p.name===n.name){if(p.state===Fp)return A2(a);p.state===I2?(p.state=Up,p.timer.stop(),p.on.call("interrupt",e,e.__data__,p.index,p.group),delete r[d]):+dIE&&r.state=0&&(t=t.slice(0,n)),!t||t==="start"})}function yae(e,t,n){var r,s,i=gae(t)?Sv:Ni;return function(){var a=i(this,e),o=a.on;o!==r&&(s=(r=o).copy()).on(t,n),a.on=s}}function bae(e,t){var n=this._id;return arguments.length<2?ti(this.node(),n).on.on(e):this.each(yae(n,e,t))}function Eae(e){return function(){var t=this.parentNode;for(var n in this.__transition)if(+n!==e)return;t&&t.removeChild(this)}}function xae(){return this.on("end.remove",Eae(this._id))}function wae(e){var t=this._name,n=this._id;typeof e!="function"&&(e=wv(e));for(var r=this._groups,s=r.length,i=new Array(s),a=0;a()=>e;function Yae(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 Vi(e,t,n){this.k=e,this.x=t,this.y=n}Vi.prototype={constructor:Vi,scale:function(e){return e===1?this:new Vi(this.k*e,this.x,this.y)},translate:function(e,t){return e===0&t===0?this:new Vi(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 e0=new Vi(1,0,0);zD.prototype=Vi.prototype;function zD(e){for(;!e.__zoom;)if(!(e=e.parentNode))return e0;return e.__zoom}function Wy(e){e.stopImmediatePropagation()}function Au(e){e.preventDefault(),e.stopImmediatePropagation()}function Gae(e){return(!e.ctrlKey||e.type==="wheel")&&!e.button}function Wae(){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 O2(){return this.__zoom||e0}function qae(e){return-e.deltaY*(e.deltaMode===1?.05:e.deltaMode?1:.002)*(e.ctrlKey?10:1)}function Xae(){return navigator.maxTouchPoints||"ontouchstart"in this}function Qae(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 VD(){var e=Gae,t=Wae,n=Qae,r=qae,s=Xae,i=[0,1/0],a=[[-1/0,-1/0],[1/0,1/0]],o=250,c=Bp,u=Xg("start","zoom","end"),d,f,h,p=500,m=150,y=0,E=10;function g(L){L.property("__zoom",O2).on("wheel.zoom",S,{passive:!1}).on("mousedown.zoom",A).on("dblclick.zoom",O).filter(s).on("touchstart.zoom",D).on("touchmove.zoom",F).on("touchend.zoom touchcancel.zoom",X).style("-webkit-tap-highlight-color","rgba(0,0,0,0)")}g.transform=function(L,j,T,R){var M=L.selection?L.selection():L;M.property("__zoom",O2),L!==M?k(L,j,T,R):M.interrupt().each(function(){N(this,arguments).event(R).start().zoom(null,typeof j=="function"?j.apply(this,arguments):j).end()})},g.scaleBy=function(L,j,T,R){g.scaleTo(L,function(){var M=this.__zoom.k,B=typeof j=="function"?j.apply(this,arguments):j;return M*B},T,R)},g.scaleTo=function(L,j,T,R){g.transform(L,function(){var M=t.apply(this,arguments),B=this.__zoom,I=T==null?_(M):typeof T=="function"?T.apply(this,arguments):T,V=B.invert(I),G=typeof j=="function"?j.apply(this,arguments):j;return n(b(x(B,G),I,V),M,a)},T,R)},g.translateBy=function(L,j,T,R){g.transform(L,function(){return n(this.__zoom.translate(typeof j=="function"?j.apply(this,arguments):j,typeof T=="function"?T.apply(this,arguments):T),t.apply(this,arguments),a)},null,R)},g.translateTo=function(L,j,T,R,M){g.transform(L,function(){var B=t.apply(this,arguments),I=this.__zoom,V=R==null?_(B):typeof R=="function"?R.apply(this,arguments):R;return n(e0.translate(V[0],V[1]).scale(I.k).translate(typeof j=="function"?-j.apply(this,arguments):-j,typeof T=="function"?-T.apply(this,arguments):-T),B,a)},R,M)};function x(L,j){return j=Math.max(i[0],Math.min(i[1],j)),j===L.k?L:new Vi(j,L.x,L.y)}function b(L,j,T){var R=j[0]-T[0]*L.k,M=j[1]-T[1]*L.k;return R===L.x&&M===L.y?L:new Vi(L.k,R,M)}function _(L){return[(+L[0][0]+ +L[1][0])/2,(+L[0][1]+ +L[1][1])/2]}function k(L,j,T,R){L.on("start.zoom",function(){N(this,arguments).event(R).start()}).on("interrupt.zoom end.zoom",function(){N(this,arguments).event(R).end()}).tween("zoom",function(){var M=this,B=arguments,I=N(M,B).event(R),V=t.apply(M,B),G=T==null?_(V):typeof T=="function"?T.apply(M,B):T,P=Math.max(V[1][0]-V[0][0],V[1][1]-V[0][1]),ie=M.__zoom,q=typeof j=="function"?j.apply(M,B):j,ne=c(ie.invert(G).concat(P/ie.k),q.invert(G).concat(P/q.k));return function(oe){if(oe===1)oe=q;else{var ee=ne(oe),ce=P/ee[2];oe=new Vi(ce,G[0]-ee[0]*ce,G[1]-ee[1]*ce)}I.zoom(null,oe)}})}function N(L,j,T){return!T&&L.__zooming||new C(L,j)}function C(L,j){this.that=L,this.args=j,this.active=0,this.sourceEvent=null,this.extent=t.apply(L,j),this.taps=0}C.prototype={event:function(L){return L&&(this.sourceEvent=L),this},start:function(){return++this.active===1&&(this.that.__zooming=this,this.emit("start")),this},zoom:function(L,j){return this.mouse&&L!=="mouse"&&(this.mouse[1]=j.invert(this.mouse[0])),this.touch0&&L!=="touch"&&(this.touch0[1]=j.invert(this.touch0[0])),this.touch1&&L!=="touch"&&(this.touch1[1]=j.invert(this.touch1[0])),this.that.__zoom=j,this.emit("zoom"),this},end:function(){return--this.active===0&&(delete this.that.__zooming,this.emit("end")),this},emit:function(L){var j=Xr(this.that).datum();u.call(L,this.that,new Yae(L,{sourceEvent:this.sourceEvent,target:g,transform:this.that.__zoom,dispatch:u}),j)}};function S(L,...j){if(!e.apply(this,arguments))return;var T=N(this,j).event(L),R=this.__zoom,M=Math.max(i[0],Math.min(i[1],R.k*Math.pow(2,r.apply(this,arguments)))),B=Fs(L);if(T.wheel)(T.mouse[0][0]!==B[0]||T.mouse[0][1]!==B[1])&&(T.mouse[1]=R.invert(T.mouse[0]=B)),clearTimeout(T.wheel);else{if(R.k===M)return;T.mouse=[B,R.invert(B)],$p(this),T.start()}Au(L),T.wheel=setTimeout(I,m),T.zoom("mouse",n(b(x(R,M),T.mouse[0],T.mouse[1]),T.extent,a));function I(){T.wheel=null,T.end()}}function A(L,...j){if(h||!e.apply(this,arguments))return;var T=L.currentTarget,R=N(this,j,!0).event(L),M=Xr(L.view).on("mousemove.zoom",G,!0).on("mouseup.zoom",P,!0),B=Fs(L,T),I=L.clientX,V=L.clientY;TD(L.view),Wy(L),R.mouse=[B,this.__zoom.invert(B)],$p(this),R.start();function G(ie){if(Au(ie),!R.moved){var q=ie.clientX-I,ne=ie.clientY-V;R.moved=q*q+ne*ne>y}R.event(ie).zoom("mouse",n(b(R.that.__zoom,R.mouse[0]=Fs(ie,T),R.mouse[1]),R.extent,a))}function P(ie){M.on("mousemove.zoom mouseup.zoom",null),AD(ie.view,R.moved),Au(ie),R.event(ie).end()}}function O(L,...j){if(e.apply(this,arguments)){var T=this.__zoom,R=Fs(L.changedTouches?L.changedTouches[0]:L,this),M=T.invert(R),B=T.k*(L.shiftKey?.5:2),I=n(b(x(T,B),R,M),t.apply(this,j),a);Au(L),o>0?Xr(this).transition().duration(o).call(k,I,R,L):Xr(this).call(g.transform,I,R,L)}}function D(L,...j){if(e.apply(this,arguments)){var T=L.touches,R=T.length,M=N(this,j,L.changedTouches.length===R).event(L),B,I,V,G;for(Wy(L),I=0;I`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.`},cf=[[Number.NEGATIVE_INFINITY,Number.NEGATIVE_INFINITY],[Number.POSITIVE_INFINITY,Number.POSITIVE_INFINITY]],KD=["Enter"," ","Escape"],YD={"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 Rc;(function(e){e.Strict="strict",e.Loose="loose"})(Rc||(Rc={}));var So;(function(e){e.Free="free",e.Vertical="vertical",e.Horizontal="horizontal"})(So||(So={}));var uf;(function(e){e.Partial="partial",e.Full="full"})(uf||(uf={}));const GD={inProgress:!1,isValid:null,from:null,fromHandle:null,fromPosition:null,fromNode:null,to:null,toHandle:null,toPosition:null,toNode:null,pointer:null};var _a;(function(e){e.Bezier="default",e.Straight="straight",e.Step="step",e.SmoothStep="smoothstep",e.SimpleBezier="simplebezier"})(_a||(_a={}));var Lc;(function(e){e.Arrow="arrow",e.ArrowClosed="arrowclosed"})(Lc||(Lc={}));var Fe;(function(e){e.Left="left",e.Top="top",e.Right="right",e.Bottom="bottom"})(Fe||(Fe={}));const R2={[Fe.Left]:Fe.Right,[Fe.Right]:Fe.Left,[Fe.Top]:Fe.Bottom,[Fe.Bottom]:Fe.Top};function WD(e){return e===null?null:e?"valid":"invalid"}const qD=e=>"id"in e&&"source"in e&&"target"in e,Zae=e=>"id"in e&&"position"in e&&!("source"in e)&&!("target"in e),Av=e=>"id"in e&&"internals"in e&&!("source"in e)&&!("target"in e),Uf=(e,t=[0,0])=>{const{width:n,height:r}=aa(e),s=e.origin??t,i=n*s[0],a=r*s[1];return{x:e.position.x-i,y:e.position.y-a}},Jae=(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):Av(s)?s:t.nodeLookup.get(s.id));const o=a?Gm(a,t.nodeOrigin):{x:0,y:0,x2:0,y2:0};return t0(r,o)},{x:1/0,y:1/0,x2:-1/0,y2:-1/0});return n0(n)},$f=(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=t0(n,Gm(s)),r=!0)}),r?n0(n):{x:0,y:0,width:0,height:0}},Cv=(e,t,[n,r,s]=[0,0,1],i=!1,a=!1)=>{const o={...eu(t,[n,r,s]),width:t.width/s,height:t.height/s},c=[];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=df(o,jc(u)),E=(p??0)*(m??0),g=i&&y>0;(!u.internals.handleBounds||g||y>=E||u.dragging)&&c.push(u)}return c},eoe=(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 toe(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 noe({nodes:e,width:t,height:n,panZoom:r,minZoom:s,maxZoom:i},a){if(e.size===0)return!0;const o=toe(e,a),c=$f(o),u=Ov(c,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 XD({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:c,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",Zs.error005());else{const p=o.measured.width,m=o.measured.height;p&&m&&(f=[[c,u],[c+p,u+m]])}else o&&Fo(a.extent)&&(f=[[a.extent[0][0]+c,a.extent[0][1]+u],[a.extent[1][0]+c,a.extent[1][1]+u]]);const h=Fo(f)?Bo(t,f,a.measured):t;return(a.measured.width===void 0||a.measured.height===void 0)&&(i==null||i("015",Zs.error015())),{position:{x:h.x-c+(a.measured.width??0)*d[0],y:h.y-u+(a.measured.height??0)*d[1]},positionAbsolute:h}}async function roe({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)),c=r.filter(h=>h.deletable!==!1),d=eoe(a,c);for(const h of c)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 Mc=(e,t=0,n=1)=>Math.min(Math.max(e,t),n),Bo=(e={x:0,y:0},t,n)=>({x:Mc(e.x,t[0][0],t[1][0]-((n==null?void 0:n.width)??0)),y:Mc(e.y,t[0][1],t[1][1]-((n==null?void 0:n.height)??0))});function QD(e,t,n){const{width:r,height:s}=aa(n),{x:i,y:a}=n.internals.positionAbsolute;return Bo(e,[[i,a],[i+r,a+s]],t)}const L2=(e,t,n)=>en?-Mc(Math.abs(e-n),1,t)/t:0,Iv=(e,t,n=15,r=40)=>{const s=L2(e.x,r,t.width-r)*n,i=L2(e.y,r,t.height-r)*n;return[s,i]},t0=(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)}),RE=({x:e,y:t,width:n,height:r})=>({x:e,y:t,x2:e+n,y2:t+r}),n0=({x:e,y:t,x2:n,y2:r})=>({x:e,y:t,width:n-e,height:r-t}),jc=(e,t=[0,0])=>{var s,i;const{x:n,y:r}=Av(e)?e.internals.positionAbsolute:Uf(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}},Gm=(e,t=[0,0])=>{var s,i;const{x:n,y:r}=Av(e)?e.internals.positionAbsolute:Uf(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)}},ZD=(e,t)=>n0(t0(RE(e),RE(t))),df=(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)},M2=e=>Vs(e.width)&&Vs(e.height)&&Vs(e.x)&&Vs(e.y),Vs=e=>!isNaN(e)&&isFinite(e),JD=(e,t)=>(n,r)=>{},Hf=(e,t=[1,1])=>({x:t[0]*Math.round(e.x/t[0]),y:t[1]*Math.round(e.y/t[1])}),eu=({x:e,y:t},[n,r,s],i=!1,a=[1,1])=>{const o={x:(e-n)/s,y:(t-r)/s};return i?Hf(o,a):o},Dc=({x:e,y:t},[n,r,s])=>({x:e*s+n,y:t*s+r});function hl(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 soe(e,t,n){if(typeof e=="string"||typeof e=="number"){const r=hl(e,n),s=hl(e,t);return{top:r,right:s,bottom:r,left:s,x:s*2,y:r*2}}if(typeof e=="object"){const r=hl(e.top??e.y??0,n),s=hl(e.bottom??e.y??0,n),i=hl(e.left??e.x??0,t),a=hl(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 ioe(e,t,n,r,s,i){const{x:a,y:o}=Dc(e,[t,n,r]),{x:c,y:u}=Dc({x:e.x+e.width,y:e.y+e.height},[t,n,r]),d=s-c,f=i-u;return{left:Math.floor(a),top:Math.floor(o),right:Math.floor(d),bottom:Math.floor(f)}}const Ov=(e,t,n,r,s,i)=>{const a=soe(i,t,n),o=(t-a.x)/e.width,c=(n-a.y)/e.height,u=Math.min(o,c),d=Mc(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=ioe(e,p,m,d,t,n),E={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-E.left+E.right,y:m-E.top+E.bottom,zoom:d}},ff=()=>{var e;return typeof navigator<"u"&&((e=navigator==null?void 0:navigator.userAgent)==null?void 0:e.indexOf("Mac"))>=0};function Fo(e){return e!=null&&e!=="parent"}function aa(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 Rv(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 eP(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 j2(e,t){if(e.size!==t.size)return!1;for(const n of e)if(!t.has(n))return!1;return!0}function aoe(){let e,t;return{promise:new Promise((r,s)=>{e=r,t=s}),resolve:e,reject:t}}function ooe(e){return{...YD,...e||{}}}function wd(e,{snapGrid:t=[0,0],snapToGrid:n=!1,transform:r,containerBounds:s}){const{x:i,y:a}=Ks(e),o=eu({x:i-((s==null?void 0:s.left)??0),y:a-((s==null?void 0:s.top)??0)},r),{x:c,y:u}=n?Hf(o,t):o;return{xSnapped:c,ySnapped:u,...o}}const Lv=e=>({width:e.offsetWidth,height:e.offsetHeight}),tP=e=>{var t;return((t=e==null?void 0:e.getRootNode)==null?void 0:t.call(e))||(window==null?void 0:window.document)},loe=["INPUT","SELECT","TEXTAREA"];function nP(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:loe.includes(t.nodeName)||t.hasAttribute("contenteditable")||!!t.closest(".nokey")}const rP=e=>"clientX"in e,Ks=(e,t)=>{var i,a;const n=rP(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)}},D2=(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,...Lv(a)}})};function sP({sourceX:e,sourceY:t,targetX:n,targetY:r,sourceControlX:s,sourceControlY:i,targetControlX:a,targetControlY:o}){const c=e*.125+s*.375+a*.375+n*.125,u=t*.125+i*.375+o*.375+r*.125,d=Math.abs(c-e),f=Math.abs(u-t);return[c,u,d,f]}function ep(e,t){return e>=0?.5*e:t*25*Math.sqrt(-e)}function P2({pos:e,x1:t,y1:n,x2:r,y2:s,c:i}){switch(e){case Fe.Left:return[t-ep(t-r,i),n];case Fe.Right:return[t+ep(r-t,i),n];case Fe.Top:return[t,n-ep(n-s,i)];case Fe.Bottom:return[t,n+ep(s-n,i)]}}function iP({sourceX:e,sourceY:t,sourcePosition:n=Fe.Bottom,targetX:r,targetY:s,targetPosition:i=Fe.Top,curvature:a=.25}){const[o,c]=P2({pos:n,x1:e,y1:t,x2:r,y2:s,c:a}),[u,d]=P2({pos:i,x1:r,y1:s,x2:e,y2:t,c:a}),[f,h,p,m]=sP({sourceX:e,sourceY:t,targetX:r,targetY:s,sourceControlX:o,sourceControlY:c,targetControlX:u,targetControlY:d});return[`M${e},${t} C${o},${c} ${u},${d} ${r},${s}`,f,h,p,m]}function aP({sourceX:e,sourceY:t,targetX:n,targetY:r}){const s=Math.abs(n-e)/2,i=n0}const doe=({source:e,sourceHandle:t,target:n,targetHandle:r})=>`xy-edge__${e}${t||""}-${n}${r||""}`,foe=(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)),hoe=(e,t,n={})=>{var i;if(!e.source||!e.target)return(i=n.onError)==null||i.call(n,"006",Zs.error006()),t;const r=n.getEdgeId||doe;let s;return qD(e)?s={...e}:s={...e,id:r(e)},foe(s,t)?t:(s.sourceHandle===null&&delete s.sourceHandle,s.targetHandle===null&&delete s.targetHandle,t.concat(s))};function oP({sourceX:e,sourceY:t,targetX:n,targetY:r}){const[s,i,a,o]=aP({sourceX:e,sourceY:t,targetX:n,targetY:r});return[`M ${e},${t}L ${n},${r}`,s,i,a,o]}const B2={[Fe.Left]:{x:-1,y:0},[Fe.Right]:{x:1,y:0},[Fe.Top]:{x:0,y:-1},[Fe.Bottom]:{x:0,y:1}},poe=({source:e,sourcePosition:t=Fe.Bottom,target:n})=>t===Fe.Left||t===Fe.Right?e.xMath.sqrt(Math.pow(t.x-e.x,2)+Math.pow(t.y-e.y,2));function moe({source:e,sourcePosition:t=Fe.Bottom,target:n,targetPosition:r=Fe.Top,center:s,offset:i,stepPosition:a}){const o=B2[t],c=B2[r],u={x:e.x+o.x*i,y:e.y+o.y*i},d={x:n.x+c.x*i,y:n.y+c.y*i},f=poe({source:u,sourcePosition:t,target:d}),h=f.x!==0?"x":"y",p=f[h];let m=[],y,E;const g={x:0,y:0},x={x:0,y:0},[,,b,_]=aP({sourceX:e.x,sourceY:e.y,targetX:n.x,targetY:n.y});if(o[h]*c[h]===-1){h==="x"?(y=s.x??u.x+(d.x-u.x)*a,E=s.y??(u.y+d.y)/2):(y=s.x??(u.x+d.x)/2,E=s.y??u.y+(d.y-u.y)*a);const S=[{x:y,y:u.y},{x:y,y:d.y}],A=[{x:u.x,y:E},{x:d.x,y:E}];o[h]===p?m=h==="x"?S:A:m=h==="x"?A:S}else{const S=[{x:u.x,y:d.y}],A=[{x:d.x,y:u.y}];if(h==="x"?m=o.x===p?A:S:m=o.y===p?S:A,t===r){const L=Math.abs(e[h]-n[h]);if(L<=i){const j=Math.min(i-1,i-L);o[h]===p?g[h]=(u[h]>e[h]?-1:1)*j:x[h]=(d[h]>n[h]?-1:1)*j}}if(t!==r){const L=h==="x"?"y":"x",j=o[h]===c[L],T=u[L]>d[L],R=u[L]=X?(y=(O.x+D.x)/2,E=m[0].y):(y=m[0].x,E=(O.y+D.y)/2)}const k={x:u.x+g.x,y:u.y+g.y},N={x:d.x+x.x,y:d.y+x.y};return[[e,...k.x!==m[0].x||k.y!==m[0].y?[k]:[],...m,...N.x!==m[m.length-1].x||N.y!==m[m.length-1].y?[N]:[],n],y,E,b,_]}function goe(e,t,n,r){const s=Math.min(F2(e,t)/2,F2(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 LE(e,t){return e?typeof e=="string"?e:`${t?`${t}__`:""}${Object.keys(e).sort().map(r=>`${r}=${e[r]}`).join("&")}`:""}function boe(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(c=>{if(c&&typeof c=="object"){const u=LE(c,t);i.has(u)||(a.push({id:u,color:c.color||n,...c}),i.add(u))}}),a),[]).sort((a,o)=>a.id.localeCompare(o.id))}const lP=1e3,Eoe=10,Mv={nodeOrigin:[0,0],nodeExtent:cf,elevateNodesOnSelect:!0,zIndexMode:"basic",defaults:{}},xoe={...Mv,checkEquality:!0};function jv(e,t){const n={...e};for(const r in t)t[r]!==void 0&&(n[r]=t[r]);return n}function woe(e,t,n){const r=jv(Mv,n);for(const s of e.values())if(s.parentId)Pv(s,e,t,r);else{const i=Uf(s,r.nodeOrigin),a=Fo(s.extent)?s.extent:r.nodeExtent,o=Bo(i,a,aa(s));s.internals.positionAbsolute=o}}function voe(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 Dv(e){return e==="manual"}function ME(e,t,n,r={}){var d,f;const s=jv(xoe,r),i={i:0},a=new Map(t),o=s!=null&&s.elevateNodesOnSelect&&!Dv(s.zIndexMode)?lP:0;let c=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=Uf(h,s.nodeOrigin),y=Fo(h.extent)?h.extent:s.nodeExtent,E=Bo(m,y,aa(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:E,handleBounds:voe(h,p),z:cP(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&&(c=!1),h.parentId&&Pv(p,t,n,r,i),u||(u=h.selected??!1)}return{nodesInitialized:c,hasSelectedNodes:u}}function _oe(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 Pv(e,t,n,r,s){const{elevateNodesOnSelect:i,nodeOrigin:a,nodeExtent:o,zIndexMode:c}=jv(Mv,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}_oe(e,n),s&&!d.parentId&&d.internals.rootParentIndex===void 0&&c==="auto"&&(d.internals.rootParentIndex=++s.i,d.internals.z=d.internals.z+s.i*Eoe),s&&d.internals.rootParentIndex!==void 0&&(s.i=d.internals.rootParentIndex);const f=i&&!Dv(c)?lP:0,{x:h,y:p,z:m}=koe(e,d,a,o,f,c),{positionAbsolute:y}=e.internals,E=h!==y.x||p!==y.y;(E||m!==e.internals.z)&&t.set(e.id,{...e,internals:{...e.internals,positionAbsolute:E?{x:h,y:p}:y,z:m}})}function cP(e,t,n){const r=Vs(e.zIndex)?e.zIndex:0;return Dv(n)?r:r+(e.selected?t:0)}function koe(e,t,n,r,s,i){const{x:a,y:o}=t.internals.positionAbsolute,c=aa(e),u=Uf(e,n),d=Fo(e.extent)?Bo(u,e.extent,c):u;let f=Bo({x:a+d.x,y:o+d.y},r,c);e.extent==="parent"&&(f=QD(f,c,t));const h=cP(e,s,i),p=t.internals.z??0;return{x:f.x,y:f.y,z:p>=h?p+1:h}}function Bv(e,t,n,r=[0,0]){var a;const s=[],i=new Map;for(const o of e){const c=t.get(o.parentId);if(!c)continue;const u=((a=i.get(o.parentId))==null?void 0:a.expandedRect)??jc(c),d=ZD(u,o.rect);i.set(o.parentId,{expandedRect:d,parent:c})}return i.size>0&&i.forEach(({expandedRect:o,parent:c},u)=>{var b;const d=c.internals.positionAbsolute,f=aa(c),h=c.origin??r,p=o.x0||m>0||g||x)&&(s.push({id:u,type:"position",position:{x:c.position.x-p+g,y:c.position.y-m+x}}),(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=Bv(h,t,n,s);u.push(...p)}return{changes:u,updatedInternals:c}}async function Soe({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 z2(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 c=r.get(a)||new Map;if(r.set(a,c.set(n,t)),i){a=`${s}-${e}-${i}`;const u=r.get(a)||new Map;r.set(a,u.set(n,t))}}function uP(e,t,n){e.clear(),t.clear();for(const r of n){const{source:s,target:i,sourceHandle:a=null,targetHandle:o=null}=r,c={edgeId:r.id,source:s,target:i,sourceHandle:a,targetHandle:o},u=`${s}-${a}--${i}-${o}`,d=`${i}-${o}--${s}-${a}`;z2("source",c,d,e,s,a),z2("target",c,u,e,i,o),t.set(r.id,r)}}function dP(e,t){if(!e.parentId)return!1;const n=t.get(e.parentId);return n?n.selected?!0:dP(n,t):!1}function V2(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 Toe(e,t,n,r){const s=new Map;for(const[i,a]of e)if((a.selected||a.id===r)&&(!a.parentId||!dP(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 qy({nodeId:e,dragItems:t,nodeLookup:n,dragging:r=!0}){var a,o,c;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:((c=t.get(e))==null?void 0:c.position)||i.position,dragging:r}:s[0],s]}function Aoe({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=Hf(i,t);return{x:a.x-i.x,y:a.y-i.y}}function Coe({onNodeMouseDown:e,getStoreItems:t,onDragStart:n,onDrag:r,onDragStop:s}){let i={x:null,y:null},a=0,o=new Map,c=!1,u={x:0,y:0},d=null,f=!1,h=null,p=!1,m=!1,y=null;function E({noDragClassName:x,handleSelector:b,domNode:_,isSelectable:k,nodeId:N,nodeClickDistance:C=0}){h=Xr(_);function S({x:F,y:X}){const{nodeLookup:L,nodeExtent:j,snapGrid:T,snapToGrid:R,nodeOrigin:M,onNodeDrag:B,onSelectionDrag:I,onError:V,updateNodePositions:G}=t();i={x:F,y:X};let P=!1;const ie=o.size>1,q=ie&&j?RE($f(o)):null,ne=ie&&R?Aoe({dragItems:o,snapGrid:T,x:F,y:X}):null;for(const[oe,ee]of o){if(!L.has(oe))continue;let ce={x:F-ee.distance.x,y:X-ee.distance.y};R&&(ce=ne?{x:Math.round(ce.x+ne.x),y:Math.round(ce.y+ne.y)}:Hf(ce,T));let re=null;if(ie&&j&&!ee.extent&&q){const{positionAbsolute:J}=ee.internals,fe=J.x-q.x+j[0][0],Ee=J.x+ee.measured.width-q.x2+j[1][0],Te=J.y-q.y+j[0][1],Ge=J.y+ee.measured.height-q.y2+j[1][1];re=[[fe,Te],[Ee,Ge]]}const{position:pe,positionAbsolute:ye}=XD({nodeId:oe,nextPosition:ce,nodeLookup:L,nodeExtent:re||j,nodeOrigin:M,onError:V});P=P||ee.position.x!==pe.x||ee.position.y!==pe.y,ee.position=pe,ee.internals.positionAbsolute=ye}if(m=m||P,!!P&&(G(o,!0),y&&(r||B||!N&&I))){const[oe,ee]=qy({nodeId:N,dragItems:o,nodeLookup:L});r==null||r(y,o,oe,ee),B==null||B(y,oe,ee),N||I==null||I(y,ee)}}async function A(){if(!d)return;const{transform:F,panBy:X,autoPanSpeed:L,autoPanOnNodeDrag:j}=t();if(!j){c=!1,cancelAnimationFrame(a);return}const[T,R]=Iv(u,d,L);(T!==0||R!==0)&&(i.x=(i.x??0)-T/F[2],i.y=(i.y??0)-R/F[2],await X({x:T,y:R})&&S(i)),a=requestAnimationFrame(A)}function O(F){var ie;const{nodeLookup:X,multiSelectionActive:L,nodesDraggable:j,transform:T,snapGrid:R,snapToGrid:M,selectNodesOnDrag:B,onNodeDragStart:I,onSelectionDragStart:V,unselectNodesAndEdges:G}=t();f=!0,(!B||!k)&&!L&&N&&((ie=X.get(N))!=null&&ie.selected||G()),k&&B&&N&&(e==null||e(N));const P=wd(F.sourceEvent,{transform:T,snapGrid:R,snapToGrid:M,containerBounds:d});if(i=P,o=Toe(X,j,P,N),o.size>0&&(n||I||!N&&V)){const[q,ne]=qy({nodeId:N,dragItems:o,nodeLookup:X});n==null||n(F.sourceEvent,o,q,ne),I==null||I(F.sourceEvent,q,ne),N||V==null||V(F.sourceEvent,ne)}}const D=CD().clickDistance(C).on("start",F=>{const{domNode:X,nodeDragThreshold:L,transform:j,snapGrid:T,snapToGrid:R}=t();d=(X==null?void 0:X.getBoundingClientRect())||null,p=!1,m=!1,y=F.sourceEvent,L===0&&O(F),i=wd(F.sourceEvent,{transform:j,snapGrid:T,snapToGrid:R,containerBounds:d}),u=Ks(F.sourceEvent,d)}).on("drag",F=>{const{autoPanOnNodeDrag:X,transform:L,snapGrid:j,snapToGrid:T,nodeDragThreshold:R,nodeLookup:M}=t(),B=wd(F.sourceEvent,{transform:L,snapGrid:j,snapToGrid:T,containerBounds:d});if(y=F.sourceEvent,(F.sourceEvent.type==="touchmove"&&F.sourceEvent.touches.length>1||N&&!M.has(N))&&(p=!0),!p){if(!c&&X&&f&&(c=!0,A()),!f){const I=Ks(F.sourceEvent,d),V=I.x-u.x,G=I.y-u.y;Math.sqrt(V*V+G*G)>R&&O(F)}(i.x!==B.xSnapped||i.y!==B.ySnapped)&&o&&f&&(u=Ks(F.sourceEvent,d),S(B))}}).on("end",F=>{if(!f||p){p&&o.size>0&&t().updateNodePositions(o,!1);return}if(c=!1,f=!1,cancelAnimationFrame(a),o.size>0){const{nodeLookup:X,updateNodePositions:L,onNodeDragStop:j,onSelectionDragStop:T}=t();if(m&&(L(o,!1),m=!1),s||j||!N&&T){const[R,M]=qy({nodeId:N,dragItems:o,nodeLookup:X,dragging:!1});s==null||s(F.sourceEvent,o,R,M),j==null||j(F.sourceEvent,R,M),N||T==null||T(F.sourceEvent,M)}}}).filter(F=>{const X=F.target;return!F.button&&(!x||!V2(X,`.${x}`,_))&&(!b||V2(X,b,_))});h.call(D)}function g(){h==null||h.on(".drag",null)}return{update:E,destroy:g}}function Ioe(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())df(s,jc(i))>0&&r.push(i);return r}const Ooe=250;function Roe(e,t,n,r){var o,c;let s=[],i=1/0;const a=Ioe(e,n,t+Ooe);for(const u of a){const d=[...((o=u.internals.handleBounds)==null?void 0:o.source)??[],...((c=u.internals.handleBounds)==null?void 0:c.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}=Uo(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 fP(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)??[]],c=(n?o==null?void 0:o.find(h=>h.id===n):o==null?void 0:o[0])??null;return c&&i?{...c,...Uo(a,c,c.position,!0)}:c}function hP(e,t){return e||(t!=null&&t.classList.contains("target")?"target":t!=null&&t.classList.contains("source")?"source":null)}function Loe(e,t){let n=null;return t?n=!0:e&&!t&&(n=!1),n}const pP=()=>!0;function Moe(e,{connectionMode:t,connectionRadius:n,handleId:r,nodeId:s,edgeUpdaterType:i,isTarget:a,domNode:o,nodeLookup:c,lib:u,autoPanOnConnect:d,flowId:f,panBy:h,cancelConnection:p,onConnectStart:m,onConnect:y,onConnectEnd:E,isValidConnection:g=pP,onReconnectEnd:x,updateConnection:b,getTransform:_,getFromHandle:k,autoPanSpeed:N,dragThreshold:C=1,handleDomNode:S}){const A=tP(e.target);let O=0,D;const{x:F,y:X}=Ks(e),L=hP(i,S),j=o==null?void 0:o.getBoundingClientRect();let T=!1;if(!j||!L)return;const R=fP(s,L,r,c,t);if(!R)return;let M=Ks(e,j),B=!1,I=null,V=!1,G=null;function P(){if(!d||!j)return;const[pe,ye]=Iv(M,j,N);h({x:pe,y:ye}),O=requestAnimationFrame(P)}const ie={...R,nodeId:s,type:L,position:R.position},q=c.get(s);let oe={inProgress:!0,isValid:null,from:Uo(q,ie,Fe.Left,!0),fromHandle:ie,fromPosition:ie.position,fromNode:q,to:M,toHandle:null,toPosition:R2[ie.position],toNode:null,pointer:M};function ee(){T=!0,b(oe),m==null||m(e,{nodeId:s,handleId:r,handleType:L})}C===0&&ee();function ce(pe){if(!T){const{x:Ge,y:ke}=Ks(pe),rt=Ge-F,ze=ke-X;if(!(rt*rt+ze*ze>C*C))return;ee()}if(!k()||!ie){re(pe);return}const ye=_();M=Ks(pe,j),D=Roe(eu(M,ye,!1,[1,1]),n,c,ie),B||(P(),B=!0);const J=mP(pe,{handle:D,connectionMode:t,fromNodeId:s,fromHandleId:r,fromType:a?"target":"source",isValidConnection:g,doc:A,lib:u,flowId:f,nodeLookup:c});G=J.handleDomNode,I=J.connection,V=Loe(!!D,J.isValid);const fe=c.get(s),Ee=fe?Uo(fe,ie,Fe.Left,!0):oe.from,Te={...oe,from:Ee,isValid:V,to:J.toHandle&&V?Dc({x:J.toHandle.x,y:J.toHandle.y},ye):M,toHandle:J.toHandle,toPosition:V&&J.toHandle?J.toHandle.position:R2[ie.position],toNode:J.toHandle?c.get(J.toHandle.nodeId):null,pointer:M};b(Te),oe=Te}function re(pe){if(!("touches"in pe&&pe.touches.length>0)){if(T){(D||G)&&I&&V&&(y==null||y(I));const{inProgress:ye,...J}=oe,fe={...J,toPosition:oe.toHandle?oe.toPosition:null};E==null||E(pe,fe),i&&(x==null||x(pe,fe))}p(),cancelAnimationFrame(O),B=!1,V=!1,I=null,G=null,A.removeEventListener("mousemove",ce),A.removeEventListener("mouseup",re),A.removeEventListener("touchmove",ce),A.removeEventListener("touchend",re)}}A.addEventListener("mousemove",ce),A.addEventListener("mouseup",re),A.addEventListener("touchmove",ce),A.addEventListener("touchend",re)}function mP(e,{handle:t,connectionMode:n,fromNodeId:r,fromHandleId:s,fromType:i,doc:a,lib:o,flowId:c,isValidConnection:u=pP,nodeLookup:d}){const f=i==="target",h=t?a.querySelector(`.${o}-flow__handle[data-id="${c}-${t==null?void 0:t.nodeId}-${t==null?void 0:t.id}-${t==null?void 0:t.type}"]`):null,{x:p,y:m}=Ks(e),y=a.elementFromPoint(p,m),E=y!=null&&y.classList.contains(`${o}-flow__handle`)?y:h,g={handleDomNode:E,isValid:!1,connection:null,toHandle:null};if(E){const x=hP(void 0,E),b=E.getAttribute("data-nodeid"),_=E.getAttribute("data-handleid"),k=E.classList.contains("connectable"),N=E.classList.contains("connectableend");if(!b||!x)return g;const C={source:f?b:r,sourceHandle:f?_:s,target:f?r:b,targetHandle:f?s:_};g.connection=C;const A=k&&N&&(n===Rc.Strict?f&&x==="source"||!f&&x==="target":b!==r||_!==s);g.isValid=A&&u(C),g.toHandle=fP(b,x,_,d,n,!0)}return g}const jE={onPointerDown:Moe,isValid:mP};function joe({domNode:e,panZoom:t,getTransform:n,getViewScale:r}){const s=Xr(e);function i({translateExtent:o,width:c,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&&ff()?10:1,N=-b.sourceEvent.deltaY*(b.sourceEvent.deltaMode===1?.05:b.sourceEvent.deltaMode?1:.002)*d,C=_[2]*Math.pow(2,N*k);t.scaleTo(C)};let y=[0,0];const E=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],N=[k[0]-y[0],k[1]-y[1]];y=k;const C=r()*Math.max(_[2],Math.log(_[2]))*(p?-1:1),S={x:_[0]-N[0]*C,y:_[1]-N[1]*C},A=[[0,0],[c,u]];t.setViewportConstrained({x:S.x,y:S.y,zoom:_[2]},A,o)},x=VD().on("start",E).on("zoom",f?g:null).on("zoom.wheel",h?m:null);s.call(x,{})}function a(){s.on("zoom",null)}return{update:i,destroy:a,pointer:Fs}}const r0=e=>({x:e.x,y:e.y,zoom:e.k}),Xy=({x:e,y:t,zoom:n})=>e0.translate(e,t).scale(n),$l=(e,t)=>e.target.closest(`.${t}`),gP=(e,t)=>t===2&&Array.isArray(e)&&e.includes(2),Doe=e=>((e*=2)<=1?e*e*e:(e-=2)*e*e+2)/2,Qy=(e,t=0,n=Doe,r=()=>{})=>{const s=typeof t=="number"&&t>0;return s||r(),s?e.transition().duration(t).ease(n).on("end",r):e},yP=e=>{const t=e.ctrlKey&&ff()?10:1;return-e.deltaY*(e.deltaMode===1?.05:e.deltaMode?1:.002)*t};function Poe({zoomPanValues:e,noWheelClassName:t,d3Selection:n,d3Zoom:r,panOnScrollMode:s,panOnScrollSpeed:i,zoomOnPinch:a,onPanZoomStart:o,onPanZoom:c,onPanZoomEnd:u}){return d=>{if($l(d,t))return d.ctrlKey&&d.preventDefault(),!1;d.preventDefault(),d.stopImmediatePropagation();const f=n.property("__zoom").k||1;if(d.ctrlKey&&a){const E=Fs(d),g=yP(d),x=f*Math.pow(2,g);r.scaleTo(n,x,E,d);return}const h=d.deltaMode===1?20:1;let p=s===So.Vertical?0:d.deltaX*h,m=s===So.Horizontal?0:d.deltaY*h;!ff()&&d.shiftKey&&s!==So.Vertical&&(p=d.deltaY*h,m=0),r.translateBy(n,-(p/f)*i,-(m/f)*i,{internal:!0});const y=r0(n.property("__zoom"));clearTimeout(e.panScrollTimeout),e.isPanScrolling?(c==null||c(d,y),e.panScrollTimeout=setTimeout(()=>{u==null||u(d,y),e.isPanScrolling=!1},150)):(e.isPanScrolling=!0,o==null||o(d,y))}}function Boe({noWheelClassName:e,preventScrolling:t,d3ZoomHandler:n}){return function(r,s){const i=r.type==="wheel",a=!t&&i&&!r.ctrlKey,o=$l(r,e);if(r.ctrlKey&&i&&o&&r.preventDefault(),a||o)return null;r.preventDefault(),n.call(this,r,s)}}function Foe({zoomPanValues:e,onDraggingChange:t,onPanZoomStart:n}){return r=>{var i,a,o;if((i=r.sourceEvent)!=null&&i.internal)return;const s=r0(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 Uoe({zoomPanValues:e,panOnDrag:t,onPaneContextMenu:n,onTransformChange:r,onPanZoom:s}){return i=>{var a,o;e.usedRightMouseButton=!!(n&&gP(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,r0(i.transform)))}}function $oe({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&&gP(t,e.mouseButton??0)&&!e.usedRightMouseButton&&a.sourceEvent&&i(a.sourceEvent),e.usedRightMouseButton=!1,r(!1),s)){const c=r0(a.transform);e.prevViewport=c,clearTimeout(e.timerId),e.timerId=setTimeout(()=>{s==null||s(a.sourceEvent,c)},n?150:0)}}}function Hoe({zoomActivationKeyPressed:e,zoomOnScroll:t,zoomOnPinch:n,panOnDrag:r,panOnScroll:s,zoomOnDoubleClick:i,userSelectionActive:a,noWheelClassName:o,noPanClassName:c,lib:u,connectionInProgress:d}){return f=>{var E;const h=e||t,p=n&&f.ctrlKey,m=f.type==="wheel";if(f.button===1&&f.type==="mousedown"&&($l(f,`${u}-flow__node`)||$l(f,`${u}-flow__edge`)))return!0;if(!r&&!h&&!s&&!i&&!n||a||d&&!m||$l(f,o)&&m||$l(f,c)&&(!m||s&&m&&!e)||!n&&f.ctrlKey&&m)return!1;if(!n&&f.type==="touchstart"&&((E=f.touches)==null?void 0:E.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 zoe({domNode:e,minZoom:t,maxZoom:n,translateExtent:r,viewport:s,onPanZoom:i,onPanZoomStart:a,onPanZoomEnd:o,onDraggingChange:c}){const u={isZoomingOrPanning:!1,usedRightMouseButton:!1,prevViewport:{},mouseButton:0,timerId:void 0,panScrollTimeout:void 0,isPanScrolling:!1},d=e.getBoundingClientRect(),f=VD().scaleExtent([t,n]).translateExtent(r),h=Xr(e).call(f);x({x:s.x,y:s.y,zoom:Mc(s.zoom,t,n)},[[0,0],[d.width,d.height]],r);const p=h.on("wheel.zoom"),m=h.on("dblclick.zoom");f.wheelDelta(yP);async function y(D,F){return h?new Promise(X=>{f==null||f.interpolate((F==null?void 0:F.interpolate)==="linear"?xd:Bp).transform(Qy(h,F==null?void 0:F.duration,F==null?void 0:F.ease,()=>X(!0)),D)}):!1}function E({noWheelClassName:D,noPanClassName:F,onPaneContextMenu:X,userSelectionActive:L,panOnScroll:j,panOnDrag:T,panOnScrollMode:R,panOnScrollSpeed:M,preventScrolling:B,zoomOnPinch:I,zoomOnScroll:V,zoomOnDoubleClick:G,zoomActivationKeyPressed:P,lib:ie,onTransformChange:q,connectionInProgress:ne,paneClickDistance:oe,selectionOnDrag:ee}){L&&!u.isZoomingOrPanning&&g();const ce=j&&!P&&!L;f.clickDistance(ee?1/0:!Vs(oe)||oe<0?0:oe);const re=ce?Poe({zoomPanValues:u,noWheelClassName:D,d3Selection:h,d3Zoom:f,panOnScrollMode:R,panOnScrollSpeed:M,zoomOnPinch:I,onPanZoomStart:a,onPanZoom:i,onPanZoomEnd:o}):Boe({noWheelClassName:D,preventScrolling:B,d3ZoomHandler:p});h.on("wheel.zoom",re,{passive:!1});const pe=Foe({zoomPanValues:u,onDraggingChange:c,onPanZoomStart:a});f.on("start",pe);const ye=Uoe({zoomPanValues:u,panOnDrag:T,onPaneContextMenu:!!X,onPanZoom:i,onTransformChange:q});f.on("zoom",ye);const J=$oe({zoomPanValues:u,panOnDrag:T,panOnScroll:j,onPaneContextMenu:X,onPanZoomEnd:o,onDraggingChange:c});f.on("end",J);const fe=Hoe({zoomActivationKeyPressed:P,panOnDrag:T,zoomOnScroll:V,panOnScroll:j,zoomOnDoubleClick:G,zoomOnPinch:I,userSelectionActive:L,noPanClassName:F,noWheelClassName:D,lib:ie,connectionInProgress:ne});f.filter(fe),G?h.on("dblclick.zoom",m):h.on("dblclick.zoom",null)}function g(){f.on("zoom",null)}async function x(D,F,X){const L=Xy(D),j=f==null?void 0:f.constrain()(L,F,X);return j&&await y(j),j}async function b(D,F){const X=Xy(D);return await y(X,F),X}function _(D){if(h){const F=Xy(D),X=h.property("__zoom");(X.k!==D.zoom||X.x!==D.x||X.y!==D.y)&&(f==null||f.transform(h,F,null,{sync:!0}))}}function k(){const D=h?zD(h.node()):{x:0,y:0,k:1};return{x:D.x,y:D.y,zoom:D.k}}async function N(D,F){return h?new Promise(X=>{f==null||f.interpolate((F==null?void 0:F.interpolate)==="linear"?xd:Bp).scaleTo(Qy(h,F==null?void 0:F.duration,F==null?void 0:F.ease,()=>X(!0)),D)}):!1}async function C(D,F){return h?new Promise(X=>{f==null||f.interpolate((F==null?void 0:F.interpolate)==="linear"?xd:Bp).scaleBy(Qy(h,F==null?void 0:F.duration,F==null?void 0:F.ease,()=>X(!0)),D)}):!1}function S(D){f==null||f.scaleExtent(D)}function A(D){f==null||f.translateExtent(D)}function O(D){const F=!Vs(D)||D<0?0:D;f==null||f.clickDistance(F)}return{update:E,destroy:g,setViewport:b,setViewportConstrained:x,getViewport:k,scaleTo:N,scaleBy:C,setScaleExtent:S,setTranslateExtent:A,syncViewport:_,setClickDistance:O}}var Pc;(function(e){e.Line="line",e.Handle="handle"})(Pc||(Pc={}));function Voe({width:e,prevWidth:t,height:n,prevHeight:r,affectsX:s,affectsY:i}){const a=e-t,o=n-r,c=[a>0?1:a<0?-1:0,o>0?1:o<0?-1:0];return a&&s&&(c[0]=c[0]*-1),o&&i&&(c[1]=c[1]*-1),c}function K2(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 da(e,t){return Math.max(0,t-e)}function fa(e,t){return Math.max(0,e-t)}function tp(e,t,n){return Math.max(0,t-e,e-n)}function Y2(e,t){return e?!t:t}function Koe(e,t,n,r,s,i,a,o){let{affectsX:c,affectsY:u}=t;const{isHorizontal:d,isVertical:f}=t,h=d&&f,{xSnapped:p,ySnapped:m}=n,{minWidth:y,maxWidth:E,minHeight:g,maxHeight:x}=r,{x:b,y:_,width:k,height:N,aspectRatio:C}=e;let S=Math.floor(d?p-e.pointerX:0),A=Math.floor(f?m-e.pointerY:0);const O=k+(c?-S:S),D=N+(u?-A:A),F=-i[0]*k,X=-i[1]*N;let L=tp(O,y,E),j=tp(D,g,x);if(a){let M=0,B=0;c&&S<0?M=da(b+S+F,a[0][0]):!c&&S>0&&(M=fa(b+O+F,a[1][0])),u&&A<0?B=da(_+A+X,a[0][1]):!u&&A>0&&(B=fa(_+D+X,a[1][1])),L=Math.max(L,M),j=Math.max(j,B)}if(o){let M=0,B=0;c&&S>0?M=fa(b+S,o[0][0]):!c&&S<0&&(M=da(b+O,o[1][0])),u&&A>0?B=fa(_+A,o[0][1]):!u&&A<0&&(B=da(_+D,o[1][1])),L=Math.max(L,M),j=Math.max(j,B)}if(s){if(d){const M=tp(O/C,g,x)*C;if(L=Math.max(L,M),a){let B=0;!c&&!u||c&&!u&&h?B=fa(_+X+O/C,a[1][1])*C:B=da(_+X+(c?S:-S)/C,a[0][1])*C,L=Math.max(L,B)}if(o){let B=0;!c&&!u||c&&!u&&h?B=da(_+O/C,o[1][1])*C:B=fa(_+(c?S:-S)/C,o[0][1])*C,L=Math.max(L,B)}}if(f){const M=tp(D*C,y,E)/C;if(j=Math.max(j,M),a){let B=0;!c&&!u||u&&!c&&h?B=fa(b+D*C+F,a[1][0])/C:B=da(b+(u?A:-A)*C+F,a[0][0])/C,j=Math.max(j,B)}if(o){let B=0;!c&&!u||u&&!c&&h?B=da(b+D*C,o[1][0])/C:B=fa(b+(u?A:-A)*C,o[0][0])/C,j=Math.max(j,B)}}}A=A+(A<0?j:-j),S=S+(S<0?L:-L),s&&(h?O>D*C?A=(Y2(c,u)?-S:S)/C:S=(Y2(c,u)?-A:A)*C:d?(A=S/C,u=c):(S=A*C,c=u));const T=c?b+S:b,R=u?_+A:_;return{width:k+(c?-S:S),height:N+(u?-A:A),x:i[0]*S*(c?-1:1)+T,y:i[1]*A*(u?-1:1)+R}}const bP={width:0,height:0,x:0,y:0},Yoe={...bP,pointerX:0,pointerY:0,aspectRatio:1};function Goe(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,c=n[1]*a;return[[r-o,s-c],[r+i-o,s+a-c]]}function Woe({domNode:e,nodeId:t,getStoreItems:n,onChange:r,onEnd:s}){const i=Xr(e);let a={controlDirection:K2("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:E}){let g={...bP},x={...Yoe};a={boundaries:d,resizeDirection:h,keepAspectRatio:f,controlDirection:K2(u)};let b,_=null,k=[],N,C,S,A=!1;const O=CD().on("start",D=>{const{nodeLookup:F,transform:X,snapGrid:L,snapToGrid:j,nodeOrigin:T,paneDomNode:R}=n();if(b=F.get(t),!b)return;_=(R==null?void 0:R.getBoundingClientRect())??null;const{xSnapped:M,ySnapped:B}=wd(D.sourceEvent,{transform:X,snapGrid:L,snapToGrid:j,containerBounds:_});g={width:b.measured.width??0,height:b.measured.height??0,x:b.position.x??0,y:b.position.y??0},x={...g,pointerX:M,pointerY:B,aspectRatio:g.width/g.height},N=void 0,C=Fo(b.extent)?b.extent:void 0,b.parentId&&(b.extent==="parent"||b.expandParent)&&(N=F.get(b.parentId)),N&&b.extent==="parent"&&(C=[[0,0],[N.measured.width,N.measured.height]]),k=[],S=void 0;for(const[I,V]of F)if(V.parentId===t&&(k.push({id:I,position:{...V.position},extent:V.extent}),V.extent==="parent"||V.expandParent)){const G=Goe(V,b,V.origin??T);S?S=[[Math.min(G[0][0],S[0][0]),Math.min(G[0][1],S[0][1])],[Math.max(G[1][0],S[1][0]),Math.max(G[1][1],S[1][1])]]:S=G}p==null||p(D,{...g})}).on("drag",D=>{const{transform:F,snapGrid:X,snapToGrid:L,nodeOrigin:j}=n(),T=wd(D.sourceEvent,{transform:F,snapGrid:X,snapToGrid:L,containerBounds:_}),R=[];if(!b)return;const{x:M,y:B,width:I,height:V}=g,G={},P=b.origin??j,{width:ie,height:q,x:ne,y:oe}=Koe(x,a.controlDirection,T,a.boundaries,a.keepAspectRatio,P,C,S),ee=ie!==I,ce=q!==V,re=ne!==M&&ee,pe=oe!==B&&ce;if(!re&&!pe&&!ee&&!ce)return;if((re||pe||P[0]===1||P[1]===1)&&(G.x=re?ne:g.x,G.y=pe?oe:g.y,g.x=G.x,g.y=G.y,k.length>0)){const Ee=ne-M,Te=oe-B;for(const Ge of k)Ge.position={x:Ge.position.x-Ee+P[0]*(ie-I),y:Ge.position.y-Te+P[1]*(q-V)},R.push(Ge)}if((ee||ce)&&(G.width=ee&&(!a.resizeDirection||a.resizeDirection==="horizontal")?ie:g.width,G.height=ce&&(!a.resizeDirection||a.resizeDirection==="vertical")?q:g.height,g.width=G.width,g.height=G.height),N&&b.expandParent){const Ee=P[0]*(G.width??0);G.x&&G.x{A&&(y==null||y(D,{...g}),s==null||s({...g}),A=!1)});i.call(O)}function c(){i.on(".drag",null)}return{update:o,destroy:c}}var EP={exports:{}},xP={},wP={exports:{}},vP={};/** + * @license React + * use-sync-external-store-shim.production.js + * + * Copyright (c) Meta Platforms, Inc. and affiliates. + * + * This source code is licensed under the MIT license found in the + * LICENSE file in the root directory of this source tree. + */var Bc=w;function qoe(e,t){return e===t&&(e!==0||1/e===1/t)||e!==e&&t!==t}var Xoe=typeof Object.is=="function"?Object.is:qoe,Qoe=Bc.useState,Zoe=Bc.useEffect,Joe=Bc.useLayoutEffect,ele=Bc.useDebugValue;function tle(e,t){var n=t(),r=Qoe({inst:{value:n,getSnapshot:t}}),s=r[0].inst,i=r[1];return Joe(function(){s.value=n,s.getSnapshot=t,Zy(s)&&i({inst:s})},[e,n,t]),Zoe(function(){return Zy(s)&&i({inst:s}),e(function(){Zy(s)&&i({inst:s})})},[e]),ele(n),n}function Zy(e){var t=e.getSnapshot;e=e.value;try{var n=t();return!Xoe(e,n)}catch{return!0}}function nle(e,t){return t()}var rle=typeof window>"u"||typeof window.document>"u"||typeof window.document.createElement>"u"?nle:tle;vP.useSyncExternalStore=Bc.useSyncExternalStore!==void 0?Bc.useSyncExternalStore:rle;wP.exports=vP;var sle=wP.exports;/** + * @license React + * use-sync-external-store-shim/with-selector.production.js + * + * Copyright (c) Meta Platforms, Inc. and affiliates. + * + * This source code is licensed under the MIT license found in the + * LICENSE file in the root directory of this source tree. + */var s0=w,ile=sle;function ale(e,t){return e===t&&(e!==0||1/e===1/t)||e!==e&&t!==t}var ole=typeof Object.is=="function"?Object.is:ale,lle=ile.useSyncExternalStore,cle=s0.useRef,ule=s0.useEffect,dle=s0.useMemo,fle=s0.useDebugValue;xP.useSyncExternalStoreWithSelector=function(e,t,n,r,s){var i=cle(null);if(i.current===null){var a={hasValue:!1,value:null};i.current=a}else a=i.current;i=dle(function(){function c(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,ole(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 c(t())},h===null?void 0:function(){return c(h())}]},[t,n,r,s]);var o=lle(e,i[0],i[1]);return ule(function(){a.hasValue=!0,a.value=o},[o]),fle(o),o};EP.exports=xP;var hle=EP.exports;const ple=yf(hle),mle={},G2=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,c={setState:r,getState:s,getInitialState:()=>u,subscribe:d=>(n.add(d),()=>n.delete(d)),destroy:()=>{(mle?"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,c);return c},gle=e=>e?G2(e):G2,{useDebugValue:yle}=ft,{useSyncExternalStoreWithSelector:ble}=ple,Ele=e=>e;function _P(e,t=Ele,n){const r=ble(e.subscribe,e.getState,e.getServerState||e.getInitialState,t,n);return yle(r),r}const W2=(e,t)=>{const n=gle(e),r=(s,i=t)=>_P(n,s,i);return Object.assign(r,n),r},xle=(e,t)=>e?W2(e,t):W2;function sn(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 i0=w.createContext(null),wle=i0.Provider,kP=Zs.error001("react");function xt(e,t){const n=w.useContext(i0);if(n===null)throw new Error(kP);return _P(n,e,t)}function an(){const e=w.useContext(i0);if(e===null)throw new Error(kP);return w.useMemo(()=>({getState:e.getState,setState:e.setState,subscribe:e.subscribe}),[e])}const q2={display:"none"},vle={position:"absolute",width:1,height:1,margin:-1,border:0,padding:0,overflow:"hidden",clip:"rect(0px, 0px, 0px, 0px)",clipPath:"inset(100%)"},NP="react-flow__node-desc",SP="react-flow__edge-desc",_le="react-flow__aria-live",kle=e=>e.ariaLiveMessage,Nle=e=>e.ariaLabelConfig;function Sle({rfId:e}){const t=xt(kle);return l.jsx("div",{id:`${_le}-${e}`,"aria-live":"assertive","aria-atomic":"true",style:vle,children:t})}function Tle({rfId:e,disableKeyboardA11y:t}){const n=xt(Nle);return l.jsxs(l.Fragment,{children:[l.jsx("div",{id:`${NP}-${e}`,style:q2,children:t?n["node.a11yDescription.default"]:n["node.a11yDescription.keyboardDisabled"]}),l.jsx("div",{id:`${SP}-${e}`,style:q2,children:n["edge.a11yDescription.default"]}),!t&&l.jsx(Sle,{rfId:e})]})}const a0=w.forwardRef(({position:e="top-left",children:t,className:n,style:r,...s},i)=>{const a=`${e}`.split("-");return l.jsx("div",{className:jn(["react-flow__panel",n,...a]),style:r,ref:i,...s,children:t})});a0.displayName="Panel";function Ale({proOptions:e,position:t="bottom-right"}){return e!=null&&e.hideAttribution?null:l.jsx(a0,{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:l.jsx("a",{href:"https://reactflow.dev",target:"_blank",rel:"noopener noreferrer","aria-label":"React Flow attribution",children:"React Flow"})})}const Cle=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}},np=e=>e.id;function Ile(e,t){return sn(e.selectedNodes.map(np),t.selectedNodes.map(np))&&sn(e.selectedEdges.map(np),t.selectedEdges.map(np))}function Ole({onSelectionChange:e}){const t=an(),{selectedNodes:n,selectedEdges:r}=xt(Cle,Ile);return w.useEffect(()=>{const s={nodes:n,edges:r};e==null||e(s),t.getState().onSelectionChangeHandlers.forEach(i=>i(s))},[n,r,e]),null}const Rle=e=>!!e.onSelectionChangeHandlers;function Lle({onSelectionChange:e}){const t=xt(Rle);return e||t?l.jsx(Ole,{onSelectionChange:e}):null}const TP=[0,0],Mle={x:0,y:0,zoom:1},jle=["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"],X2=[...jle,"rfId"],Dle=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}),Q2={translateExtent:cf,nodeOrigin:TP,minZoom:.5,maxZoom:2,elementsSelectable:!0,noPanClassName:"nopan",rfId:"1"};function Ple(e){const{setNodes:t,setEdges:n,setMinZoom:r,setMaxZoom:s,setTranslateExtent:i,setNodeExtent:a,reset:o,setDefaultNodesAndEdges:c}=xt(Dle,sn),u=an();w.useEffect(()=>(c(e.defaultNodes,e.defaultEdges),()=>{d.current=Q2,o()}),[]);const d=w.useRef(Q2);return w.useEffect(()=>{for(const f of X2){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:ooe(h)}):f==="fitView"?u.setState({fitViewQueued:h}):f==="fitViewOptions"?u.setState({fitViewOptions:h}):u.setState({[f]:h})))}d.current=e},X2.map(f=>e[f])),null}function Z2(){return typeof window>"u"||!window.matchMedia?null:window.matchMedia("(prefers-color-scheme: dark)")}function Ble(e){var r;const[t,n]=w.useState(e==="system"?null:e);return w.useEffect(()=>{if(e!=="system"){n(e);return}const s=Z2(),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=Z2())!=null&&r.matches?"dark":"light"}const J2=typeof document<"u"?document:null;function hf(e=null,t={target:J2,actInsideInputWithModifier:!0}){const[n,r]=w.useState(!1),s=w.useRef(!1),i=w.useRef(new Set([])),[a,o]=w.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 w.useEffect(()=>{const c=(t==null?void 0:t.target)??J2,u=(t==null?void 0:t.actInsideInputWithModifier)??!0;if(e!==null){const d=p=>{var E,g;if(s.current=p.ctrlKey||p.metaKey||p.shiftKey||p.altKey,(!s.current||s.current&&!u)&&nP(p))return!1;const y=tA(p.code,o);if(i.current.add(p[y]),eA(a,i.current,!1)){const x=((g=(E=p.composedPath)==null?void 0:E.call(p))==null?void 0:g[0])||p.target,b=(x==null?void 0:x.nodeName)==="BUTTON"||(x==null?void 0:x.nodeName)==="A";t.preventDefault!==!1&&(s.current||!b)&&p.preventDefault(),r(!0)}},f=p=>{const m=tA(p.code,o);eA(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 c==null||c.addEventListener("keydown",d),c==null||c.addEventListener("keyup",f),window.addEventListener("blur",h),window.addEventListener("contextmenu",h),()=>{c==null||c.removeEventListener("keydown",d),c==null||c.removeEventListener("keyup",f),window.removeEventListener("blur",h),window.removeEventListener("contextmenu",h)}}},[e,r]),n}function eA(e,t,n){return e.filter(r=>n||r.length===t.size).some(r=>r.every(s=>t.has(s)))}function tA(e,t){return t.includes(e)?"code":"key"}const Fle=()=>{const e=an();return w.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(),c=Ov(t,r,s,i,a,(n==null?void 0:n.padding)??.1);return o?(await o.setViewport(c,{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:c}=a.getBoundingClientRect(),u={x:t.x-o,y:t.y-c},d=n.snapGrid??s,f=n.snapToGrid??i;return eu(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=Dc(t,n);return{x:a.x+s,y:a.y+i}}}),[])};function AP(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 c of a)Ule(c,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 Ule(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 CP(e,t){return AP(e,t)}function IP(e,t){return AP(e,t)}function io(e,t){return{id:e,type:"select",selected:t}}function Hl(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(io(i.id,a)))}return r}function nA({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),c=((s=o==null?void 0:o.internals)==null?void 0:s.userNode)??o;c!==void 0&&c!==a&&n.push({id:a.id,item:a,type:"replace"}),c===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 rA(e){return{id:e.id,type:"remove"}}const $le=JD();function OP(e,t,n={}){return hoe(e,t,{...n,onError:n.onError??$le})}const sA=e=>Zae(e),Hle=e=>qD(e);function RP(e){return w.forwardRef(e)}const zle=typeof window<"u"?w.useLayoutEffect:w.useEffect;function iA(e){const[t,n]=w.useState(BigInt(0)),[r]=w.useState(()=>Vle(()=>n(s=>s+BigInt(1))));return zle(()=>{const s=r.get();s.length&&(e(s),r.reset())},[t]),r}function Vle(e){let t=[];return{get:()=>t,reset:()=>{t=[]},push:n=>{t.push(n),e()}}}const LP=w.createContext(null);function Kle({children:e}){const t=an(),n=w.useCallback(o=>{const{nodes:c=[],setNodes:u,hasDefaultNodes:d,onNodesChange:f,nodeLookup:h,fitViewQueued:p,onNodesChangeMiddlewareMap:m}=t.getState();let y=c;for(const g of o)y=typeof g=="function"?g(y):g;let E=nA({items:y,lookup:h});for(const g of m.values())E=g(E);d&&u(y),E.length>0?f==null||f(E):p&&window.requestAnimationFrame(()=>{const{fitViewQueued:g,nodes:x,setNodes:b}=t.getState();g&&b(x)})},[]),r=iA(n),s=w.useCallback(o=>{const{edges:c=[],setEdges:u,hasDefaultEdges:d,onEdgesChange:f,edgeLookup:h}=t.getState();let p=c;for(const m of o)p=typeof m=="function"?m(p):m;d?u(p):f&&f(nA({items:p,lookup:h}))},[]),i=iA(s),a=w.useMemo(()=>({nodeQueue:r,edgeQueue:i}),[]);return l.jsx(LP.Provider,{value:a,children:e})}function Yle(){const e=w.useContext(LP);if(!e)throw new Error("useBatchContext must be used within a BatchProvider");return e}const Gle=e=>!!e.panZoom;function o0(){const e=Fle(),t=an(),n=Yle(),r=xt(Gle),s=w.useMemo(()=>{const i=f=>t.getState().nodeLookup.get(f),a=f=>{n.nodeQueue.push(f)},o=f=>{n.edgeQueue.push(f)},c=f=>{var g,x;const{nodeLookup:h,nodeOrigin:p}=t.getState(),m=sA(f)?f:h.get(f.id),y=m.parentId?eP(m.position,m.measured,m.parentId,h,p):m.position,E={...m,position:y,width:((g=m.measured)==null?void 0:g.width)??m.width,height:((x=m.measured)==null?void 0:x.height)??m.height};return jc(E)},u=(f,h,p={replace:!1})=>{a(m=>m.map(y=>{if(y.id===f){const E=typeof h=="function"?h(y):h;return p.replace&&sA(E)?E:{...y,...E}}return y}))},d=(f,h,p={replace:!1})=>{o(m=>m.map(y=>{if(y.id===f){const E=typeof h=="function"?h(y):h;return p.replace&&Hle(E)?E:{...y,...E}}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,E]=p;return{nodes:f.map(g=>({...g})),edges:h.map(g=>({...g})),viewport:{x:m,y,zoom:E}}},deleteElements:async({nodes:f=[],edges:h=[]})=>{const{nodes:p,edges:m,onNodesDelete:y,onEdgesDelete:E,triggerNodeChanges:g,triggerEdgeChanges:x,onDelete:b,onBeforeDelete:_}=t.getState(),{nodes:k,edges:N}=await roe({nodesToRemove:f,edgesToRemove:h,nodes:p,edges:m,onBeforeDelete:_}),C=N.length>0,S=k.length>0;if(C){const A=N.map(rA);E==null||E(N),x(A)}if(S){const A=k.map(rA);y==null||y(k),g(A)}return(S||C)&&(b==null||b({nodes:k,edges:N})),{deletedNodes:k,deletedEdges:N}},getIntersectingNodes:(f,h=!0,p)=>{const m=M2(f),y=m?f:c(f),E=p!==void 0;return y?(p||t.getState().nodes).filter(g=>{const x=t.getState().nodeLookup.get(g.id);if(x&&!m&&(g.id===f.id||!x.internals.positionAbsolute))return!1;const b=jc(E?g:x),_=df(b,y);return h&&_>0||_>=b.width*b.height||_>=y.width*y.height}):[]},isNodeIntersecting:(f,h,p=!0)=>{const y=M2(f)?f:c(f);if(!y)return!1;const E=df(y,h);return p&&E>0||E>=h.width*h.height||E>=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 Jae(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??aoe();return t.setState({fitViewQueued:!0,fitViewOptions:f,fitViewResolver:h}),n.nodeQueue.push(p=>[...p]),h.promise}}},[]);return w.useMemo(()=>({...s,...e,viewportInitialized:r}),[r])}const aA=e=>e.selected,Wle=typeof window<"u"?window:void 0;function qle({deleteKeyCode:e,multiSelectionKeyCode:t}){const n=an(),{deleteElements:r}=o0(),s=hf(e,{actInsideInputWithModifier:!1}),i=hf(t,{target:Wle});w.useEffect(()=>{if(s){const{edges:a,nodes:o}=n.getState();r({nodes:o.filter(aA),edges:a.filter(aA)}),n.setState({nodesSelectionActive:!1})}},[s]),w.useEffect(()=>{n.setState({multiSelectionActive:i})},[i])}function Xle(e){const t=an();w.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=Lv(e.current);(r.height===0||r.width===0)&&((o=(a=t.getState()).onError)==null||o.call(a,"004",Zs.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 l0={position:"absolute",width:"100%",height:"100%",top:0,left:0},Qle=e=>({userSelectionActive:e.userSelectionActive,lib:e.lib,connectionInProgress:e.connection.inProgress});function Zle({onPaneContextMenu:e,zoomOnScroll:t=!0,zoomOnPinch:n=!0,panOnScroll:r=!1,panOnScrollSpeed:s=.5,panOnScrollMode:i=So.Free,zoomOnDoubleClick:a=!0,panOnDrag:o=!0,defaultViewport:c,translateExtent:u,minZoom:d,maxZoom:f,zoomActivationKeyCode:h,preventScrolling:p=!0,children:m,noWheelClassName:y,noPanClassName:E,onViewportChange:g,isControlledViewport:x,paneClickDistance:b,selectionOnDrag:_}){const k=an(),N=w.useRef(null),{userSelectionActive:C,lib:S,connectionInProgress:A}=xt(Qle,sn),O=hf(h),D=w.useRef();Xle(N);const F=w.useCallback(X=>{g==null||g({x:X[0],y:X[1],zoom:X[2]}),x||k.setState({transform:X})},[g,x]);return w.useEffect(()=>{if(N.current){D.current=zoe({domNode:N.current,minZoom:d,maxZoom:f,translateExtent:u,viewport:c,onDraggingChange:T=>k.setState(R=>R.paneDragging===T?R:{paneDragging:T}),onPanZoomStart:(T,R)=>{const{onViewportChangeStart:M,onMoveStart:B}=k.getState();B==null||B(T,R),M==null||M(R)},onPanZoom:(T,R)=>{const{onViewportChange:M,onMove:B}=k.getState();B==null||B(T,R),M==null||M(R)},onPanZoomEnd:(T,R)=>{const{onViewportChangeEnd:M,onMoveEnd:B}=k.getState();B==null||B(T,R),M==null||M(R)}});const{x:X,y:L,zoom:j}=D.current.getViewport();return k.setState({panZoom:D.current,transform:[X,L,j],domNode:N.current.closest(".react-flow")}),()=>{var T;(T=D.current)==null||T.destroy()}}},[]),w.useEffect(()=>{var X;(X=D.current)==null||X.update({onPaneContextMenu:e,zoomOnScroll:t,zoomOnPinch:n,panOnScroll:r,panOnScrollSpeed:s,panOnScrollMode:i,zoomOnDoubleClick:a,panOnDrag:o,zoomActivationKeyPressed:O,preventScrolling:p,noPanClassName:E,userSelectionActive:C,noWheelClassName:y,lib:S,onTransformChange:F,connectionInProgress:A,selectionOnDrag:_,paneClickDistance:b})},[e,t,n,r,s,i,a,o,O,p,E,C,y,S,F,A,_,b]),l.jsx("div",{className:"react-flow__renderer",ref:N,style:l0,children:m})}const Jle=e=>({userSelectionActive:e.userSelectionActive,userSelectionRect:e.userSelectionRect});function ece(){const{userSelectionActive:e,userSelectionRect:t}=xt(Jle,sn);return e&&t?l.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 Jy=(e,t)=>n=>{n.target===t.current&&(e==null||e(n))},tce=e=>({userSelectionActive:e.userSelectionActive,elementsSelectable:e.elementsSelectable,connectionInProgress:e.connection.inProgress,dragging:e.paneDragging,panBy:e.panBy,autoPanSpeed:e.autoPanSpeed});function nce({isSelecting:e,selectionKeyPressed:t,selectionMode:n=uf.Full,panOnDrag:r,autoPanOnSelection:s,paneClickDistance:i,selectionOnDrag:a,onSelectionStart:o,onSelectionEnd:c,onPaneClick:u,onPaneContextMenu:d,onPaneScroll:f,onPaneMouseEnter:h,onPaneMouseMove:p,onPaneMouseLeave:m,children:y}){const E=w.useRef(0),g=an(),{userSelectionActive:x,elementsSelectable:b,dragging:_,connectionInProgress:k,panBy:N,autoPanSpeed:C}=xt(tce,sn),S=b&&(e||x),A=w.useRef(null),O=w.useRef(),D=w.useRef(new Set),F=w.useRef(new Set),X=w.useRef(!1),L=w.useRef({x:0,y:0}),j=w.useRef(!1),T=ee=>{if(X.current||k){X.current=!1;return}u==null||u(ee),g.getState().resetSelectedElements(),g.setState({nodesSelectionActive:!1})},R=ee=>{if(Array.isArray(r)&&(r!=null&&r.includes(2))){ee.preventDefault();return}d==null||d(ee)},M=f?ee=>f(ee):void 0,B=ee=>{X.current&&(ee.stopPropagation(),X.current=!1)},I=ee=>{var Ge,ke;const{domNode:ce,transform:re}=g.getState();if(O.current=ce==null?void 0:ce.getBoundingClientRect(),!O.current)return;const pe=ee.target===A.current;if(!pe&&!!ee.target.closest(".nokey")||!e||!(a&&pe||t)||ee.button!==0||!ee.isPrimary)return;(ke=(Ge=ee.target)==null?void 0:Ge.setPointerCapture)==null||ke.call(Ge,ee.pointerId),X.current=!1;const{x:fe,y:Ee}=Ks(ee.nativeEvent,O.current),Te=eu({x:fe,y:Ee},re);g.setState({userSelectionRect:{width:0,height:0,startX:Te.x,startY:Te.y,x:fe,y:Ee}}),pe||(ee.stopPropagation(),ee.preventDefault())};function V(ee,ce){const{userSelectionRect:re}=g.getState();if(!re)return;const{transform:pe,nodeLookup:ye,edgeLookup:J,connectionLookup:fe,triggerNodeChanges:Ee,triggerEdgeChanges:Te,defaultEdgeOptions:Ge}=g.getState(),ke={x:re.startX,y:re.startY},{x:rt,y:ze}=Dc(ke,pe),We={startX:ke.x,startY:ke.y,x:eeTt.id)),F.current=new Set;const St=(Ge==null?void 0:Ge.selectable)??!0;for(const Tt of D.current){const H=fe.get(Tt);if(H)for(const{edgeId:Z}of H.values()){const le=J.get(Z);le&&(le.selectable??St)&&F.current.add(Z)}}if(!j2(yt,D.current)){const Tt=Hl(ye,D.current,!0);Ee(Tt)}if(!j2(at,F.current)){const Tt=Hl(J,F.current);Te(Tt)}g.setState({userSelectionRect:We,userSelectionActive:!0,nodesSelectionActive:!1})}function G(){if(!s||!O.current)return;const[ee,ce]=Iv(L.current,O.current,C);N({x:ee,y:ce}).then(re=>{if(!X.current||!re){E.current=requestAnimationFrame(G);return}const{x:pe,y:ye}=L.current;V(pe,ye),E.current=requestAnimationFrame(G)})}const P=()=>{cancelAnimationFrame(E.current),E.current=0,j.current=!1};w.useEffect(()=>()=>P(),[]);const ie=ee=>{const{userSelectionRect:ce,transform:re,resetSelectedElements:pe}=g.getState();if(!O.current||!ce)return;const{x:ye,y:J}=Ks(ee.nativeEvent,O.current);L.current={x:ye,y:J};const fe=Dc({x:ce.startX,y:ce.startY},re);if(!X.current){const Ee=t?0:i;if(Math.hypot(ye-fe.x,J-fe.y)<=Ee)return;pe(),o==null||o(ee)}X.current=!0,j.current||(G(),j.current=!0),V(ye,J)},q=ee=>{var ce,re;ee.button===0&&((re=(ce=ee.target)==null?void 0:ce.releasePointerCapture)==null||re.call(ce,ee.pointerId),!x&&ee.target===A.current&&g.getState().userSelectionRect&&(T==null||T(ee)),g.setState({userSelectionActive:!1,userSelectionRect:null}),X.current&&(c==null||c(ee),g.setState({nodesSelectionActive:D.current.size>0})),P())},ne=ee=>{var ce,re;(re=(ce=ee.target)==null?void 0:ce.releasePointerCapture)==null||re.call(ce,ee.pointerId),P()},oe=r===!0||Array.isArray(r)&&r.includes(0);return l.jsxs("div",{className:jn(["react-flow__pane",{draggable:oe,dragging:_,selection:e}]),onClick:S?void 0:Jy(T,A),onContextMenu:Jy(R,A),onWheel:Jy(M,A),onPointerEnter:S?void 0:h,onPointerMove:S?ie:p,onPointerUp:S?q:void 0,onPointerCancel:S?ne:void 0,onPointerDownCapture:S?I:void 0,onClickCapture:S?B:void 0,onPointerLeave:m,ref:A,style:l0,children:[y,l.jsx(ece,{})]})}function DE({id:e,store:t,unselect:n=!1,nodeRef:r}){const{addSelectedNodes:s,unselectNodesAndEdges:i,multiSelectionActive:a,nodeLookup:o,onError:c}=t.getState(),u=o.get(e);if(!u){c==null||c("012",Zs.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 MP({nodeRef:e,disabled:t=!1,noDragClassName:n,handleSelector:r,nodeId:s,isSelectable:i,nodeClickDistance:a}){const o=an(),[c,u]=w.useState(!1),d=w.useRef();return w.useEffect(()=>{d.current=Coe({getStoreItems:()=>o.getState(),onNodeMouseDown:f=>{DE({id:f,store:o,nodeRef:e})},onDragStart:()=>{u(!0)},onDragStop:()=>{u(!1)}})},[]),w.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]),c}const rce=e=>t=>t.selected&&(t.draggable||e&&typeof t.draggable>"u");function jP(){const e=an();return w.useCallback(n=>{const{nodeExtent:r,snapToGrid:s,snapGrid:i,nodesDraggable:a,onError:o,updateNodePositions:c,nodeLookup:u,nodeOrigin:d}=e.getState(),f=new Map,h=rce(a),p=s?i[0]:5,m=s?i[1]:5,y=n.direction.x*p*n.factor,E=n.direction.y*m*n.factor;for(const[,g]of u){if(!h(g))continue;let x={x:g.internals.positionAbsolute.x+y,y:g.internals.positionAbsolute.y+E};s&&(x=Hf(x,i));const{position:b,positionAbsolute:_}=XD({nodeId:g.id,nextPosition:x,nodeLookup:u,nodeExtent:r,nodeOrigin:d,onError:o});g.position=b,g.internals.positionAbsolute=_,f.set(g.id,g)}c(f)},[])}const Fv=w.createContext(null),sce=Fv.Provider;Fv.Consumer;const DP=()=>w.useContext(Fv),ice=e=>({connectOnClick:e.connectOnClick,noPanClassName:e.noPanClassName,rfId:e.rfId}),ace=(e,t,n)=>r=>{const{connectionClickStartHandle:s,connectionMode:i,connection:a}=r,{fromHandle:o,toHandle:c,isValid:u}=a,d=(c==null?void 0:c.nodeId)===e&&(c==null?void 0:c.id)===t&&(c==null?void 0:c.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===Rc.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 oce({type:e="source",position:t=Fe.Top,isValidConnection:n,isConnectable:r=!0,isConnectableStart:s=!0,isConnectableEnd:i=!0,id:a,onConnect:o,children:c,className:u,onMouseDown:d,onTouchStart:f,...h},p){var j,T;const m=a||null,y=e==="target",E=an(),g=DP(),{connectOnClick:x,noPanClassName:b,rfId:_}=xt(ice,sn),{connectingFrom:k,connectingTo:N,clickConnecting:C,isPossibleEndHandle:S,connectionInProcess:A,clickConnectionInProcess:O,valid:D}=xt(ace(g,m,e),sn);g||(T=(j=E.getState()).onError)==null||T.call(j,"010",Zs.error010());const F=R=>{const{defaultEdgeOptions:M,onConnect:B,hasDefaultEdges:I}=E.getState(),V={...M,...R};if(I){const{edges:G,setEdges:P,onError:ie}=E.getState();P(OP(V,G,{onError:ie}))}B==null||B(V),o==null||o(V)},X=R=>{if(!g)return;const M=rP(R.nativeEvent);if(s&&(M&&R.button===0||!M)){const B=E.getState();jE.onPointerDown(R.nativeEvent,{handleDomNode:R.currentTarget,autoPanOnConnect:B.autoPanOnConnect,connectionMode:B.connectionMode,connectionRadius:B.connectionRadius,domNode:B.domNode,nodeLookup:B.nodeLookup,lib:B.lib,isTarget:y,handleId:m,nodeId:g,flowId:B.rfId,panBy:B.panBy,cancelConnection:B.cancelConnection,onConnectStart:B.onConnectStart,onConnectEnd:(...I)=>{var V,G;return(G=(V=E.getState()).onConnectEnd)==null?void 0:G.call(V,...I)},updateConnection:B.updateConnection,onConnect:F,isValidConnection:n||((...I)=>{var V,G;return((G=(V=E.getState()).isValidConnection)==null?void 0:G.call(V,...I))??!0}),getTransform:()=>E.getState().transform,getFromHandle:()=>E.getState().connection.fromHandle,autoPanSpeed:B.autoPanSpeed,dragThreshold:B.connectionDragThreshold})}M?d==null||d(R):f==null||f(R)},L=R=>{const{onClickConnectStart:M,onClickConnectEnd:B,connectionClickStartHandle:I,connectionMode:V,isValidConnection:G,lib:P,rfId:ie,nodeLookup:q,connection:ne}=E.getState();if(!g||!I&&!s)return;if(!I){M==null||M(R.nativeEvent,{nodeId:g,handleId:m,handleType:e}),E.setState({connectionClickStartHandle:{nodeId:g,type:e,id:m}});return}const oe=tP(R.target),ee=n||G,{connection:ce,isValid:re}=jE.isValid(R.nativeEvent,{handle:{nodeId:g,id:m,type:e},connectionMode:V,fromNodeId:I.nodeId,fromHandleId:I.id||null,fromType:I.type,isValidConnection:ee,flowId:ie,doc:oe,lib:P,nodeLookup:q});re&&ce&&F(ce);const pe=structuredClone(ne);delete pe.inProgress,pe.toPosition=pe.toHandle?pe.toHandle.position:null,B==null||B(R,pe),E.setState({connectionClickStartHandle:null})};return l.jsx("div",{"data-handleid":m,"data-nodeid":g,"data-handlepos":t,"data-id":`${_}-${g}-${m}-${e}`,className:jn(["react-flow__handle",`react-flow__handle-${t}`,"nodrag",b,u,{source:!y,target:y,connectable:r,connectablestart:s,connectableend:i,clickconnecting:C,connectingfrom:k,connectingto:N,valid:D,connectionindicator:r&&(!A||S)&&(A||O?i:s)}]),onMouseDown:X,onTouchStart:X,onClick:x?L:void 0,ref:p,...h,children:c})}const mr=w.memo(RP(oce));function lce({data:e,isConnectable:t,sourcePosition:n=Fe.Bottom}){return l.jsxs(l.Fragment,{children:[e==null?void 0:e.label,l.jsx(mr,{type:"source",position:n,isConnectable:t})]})}function cce({data:e,isConnectable:t,targetPosition:n=Fe.Top,sourcePosition:r=Fe.Bottom}){return l.jsxs(l.Fragment,{children:[l.jsx(mr,{type:"target",position:n,isConnectable:t}),e==null?void 0:e.label,l.jsx(mr,{type:"source",position:r,isConnectable:t})]})}function uce(){return null}function dce({data:e,isConnectable:t,targetPosition:n=Fe.Top}){return l.jsxs(l.Fragment,{children:[l.jsx(mr,{type:"target",position:n,isConnectable:t}),e==null?void 0:e.label]})}const qm={ArrowUp:{x:0,y:-1},ArrowDown:{x:0,y:1},ArrowLeft:{x:-1,y:0},ArrowRight:{x:1,y:0}},oA={input:lce,default:cce,output:dce,group:uce};function fce(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 hce=e=>{const{width:t,height:n,x:r,y:s}=$f(e.nodeLookup,{filter:i=>!!i.selected});return{width:Vs(t)?t:null,height:Vs(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 pce({onSelectionContextMenu:e,noPanClassName:t,disableKeyboardA11y:n}){const r=an(),{width:s,height:i,transformString:a,userSelectionActive:o}=xt(hce,sn),c=jP(),u=w.useRef(null);w.useEffect(()=>{var p;n||(p=u.current)==null||p.focus({preventScroll:!0})},[n]);const d=!o&&s!==null&&i!==null;if(MP({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(qm,p.key)&&(p.preventDefault(),c({direction:qm[p.key],factor:p.shiftKey?4:1}))};return l.jsx("div",{className:jn(["react-flow__nodesselection","react-flow__container",t]),style:{transform:a},children:l.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 lA=typeof window<"u"?window:void 0,mce=e=>({nodesSelectionActive:e.nodesSelectionActive,userSelectionActive:e.userSelectionActive});function PP({children:e,onPaneClick:t,onPaneMouseEnter:n,onPaneMouseMove:r,onPaneMouseLeave:s,onPaneContextMenu:i,onPaneScroll:a,paneClickDistance:o,deleteKeyCode:c,selectionKeyCode:u,selectionOnDrag:d,selectionMode:f,onSelectionStart:h,onSelectionEnd:p,multiSelectionKeyCode:m,panActivationKeyCode:y,zoomActivationKeyCode:E,elementsSelectable:g,zoomOnScroll:x,zoomOnPinch:b,panOnScroll:_,panOnScrollSpeed:k,panOnScrollMode:N,zoomOnDoubleClick:C,panOnDrag:S,autoPanOnSelection:A,defaultViewport:O,translateExtent:D,minZoom:F,maxZoom:X,preventScrolling:L,onSelectionContextMenu:j,noWheelClassName:T,noPanClassName:R,disableKeyboardA11y:M,onViewportChange:B,isControlledViewport:I}){const{nodesSelectionActive:V,userSelectionActive:G}=xt(mce,sn),P=hf(u,{target:lA}),ie=hf(y,{target:lA}),q=ie||S,ne=ie||_,oe=d&&q!==!0,ee=P||G||oe;return qle({deleteKeyCode:c,multiSelectionKeyCode:m}),l.jsx(Zle,{onPaneContextMenu:i,elementsSelectable:g,zoomOnScroll:x,zoomOnPinch:b,panOnScroll:ne,panOnScrollSpeed:k,panOnScrollMode:N,zoomOnDoubleClick:C,panOnDrag:!P&&q,defaultViewport:O,translateExtent:D,minZoom:F,maxZoom:X,zoomActivationKeyCode:E,preventScrolling:L,noWheelClassName:T,noPanClassName:R,onViewportChange:B,isControlledViewport:I,paneClickDistance:o,selectionOnDrag:oe,children:l.jsxs(nce,{onSelectionStart:h,onSelectionEnd:p,onPaneClick:t,onPaneMouseEnter:n,onPaneMouseMove:r,onPaneMouseLeave:s,onPaneContextMenu:i,onPaneScroll:a,panOnDrag:q,autoPanOnSelection:A,isSelecting:!!ee,selectionMode:f,selectionKeyPressed:P,paneClickDistance:o,selectionOnDrag:oe,children:[e,V&&l.jsx(pce,{onSelectionContextMenu:j,noPanClassName:R,disableKeyboardA11y:M})]})})}PP.displayName="FlowRenderer";const gce=w.memo(PP),yce=e=>t=>e?Cv(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 bce(e){return xt(w.useCallback(yce(e),[e]),sn)}const Ece=e=>e.updateNodeInternals;function xce(){const e=xt(Ece),[t]=w.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 w.useEffect(()=>()=>{t==null||t.disconnect()},[t]),t}function wce({node:e,nodeType:t,hasDimensions:n,resizeObserver:r}){const s=an(),i=w.useRef(null),a=w.useRef(null),o=w.useRef(e.sourcePosition),c=w.useRef(e.targetPosition),u=w.useRef(t),d=n&&!!e.internals.handleBounds;return w.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]),w.useEffect(()=>()=>{a.current&&(r==null||r.unobserve(a.current),a.current=null)},[]),w.useEffect(()=>{if(i.current){const f=u.current!==t,h=o.current!==e.sourcePosition,p=c.current!==e.targetPosition;(f||h||p)&&(u.current=t,o.current=e.sourcePosition,c.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 vce({id:e,onClick:t,onMouseEnter:n,onMouseMove:r,onMouseLeave:s,onContextMenu:i,onDoubleClick:a,nodesDraggable:o,elementsSelectable:c,nodesConnectable:u,nodesFocusable:d,resizeObserver:f,noDragClassName:h,noPanClassName:p,disableKeyboardA11y:m,rfId:y,nodeTypes:E,nodeClickDistance:g,onError:x}){const{node:b,internals:_,isParent:k}=xt(ee=>{const ce=ee.nodeLookup.get(e),re=ee.parentLookup.has(e);return{node:ce,internals:ce.internals,isParent:re}},sn);let N=b.type||"default",C=(E==null?void 0:E[N])||oA[N];C===void 0&&(x==null||x("003",Zs.error003(N)),N="default",C=(E==null?void 0:E.default)||oA.default);const S=!!(b.draggable||o&&typeof b.draggable>"u"),A=!!(b.selectable||c&&typeof b.selectable>"u"),O=!!(b.connectable||u&&typeof b.connectable>"u"),D=!!(b.focusable||d&&typeof b.focusable>"u"),F=an(),X=Rv(b),L=wce({node:b,nodeType:N,hasDimensions:X,resizeObserver:f}),j=MP({nodeRef:L,disabled:b.hidden||!S,noDragClassName:h,handleSelector:b.dragHandle,nodeId:e,isSelectable:A,nodeClickDistance:g}),T=jP();if(b.hidden)return null;const R=aa(b),M=fce(b),B=A||S||t||n||r||s,I=n?ee=>n(ee,{..._.userNode}):void 0,V=r?ee=>r(ee,{..._.userNode}):void 0,G=s?ee=>s(ee,{..._.userNode}):void 0,P=i?ee=>i(ee,{..._.userNode}):void 0,ie=a?ee=>a(ee,{..._.userNode}):void 0,q=ee=>{const{selectNodesOnDrag:ce,nodeDragThreshold:re}=F.getState();A&&(!ce||!S||re>0)&&DE({id:e,store:F,nodeRef:L}),t&&t(ee,{..._.userNode})},ne=ee=>{if(!(nP(ee.nativeEvent)||m)){if(KD.includes(ee.key)&&A){const ce=ee.key==="Escape";DE({id:e,store:F,unselect:ce,nodeRef:L})}else if(S&&b.selected&&Object.prototype.hasOwnProperty.call(qm,ee.key)){ee.preventDefault();const{ariaLabelConfig:ce}=F.getState();F.setState({ariaLiveMessage:ce["node.a11yDescription.ariaLiveMessage"]({direction:ee.key.replace("Arrow","").toLowerCase(),x:~~_.positionAbsolute.x,y:~~_.positionAbsolute.y})}),T({direction:qm[ee.key],factor:ee.shiftKey?4:1})}}},oe=()=>{var fe;if(m||!((fe=L.current)!=null&&fe.matches(":focus-visible")))return;const{transform:ee,width:ce,height:re,autoPanOnNodeFocus:pe,setCenter:ye}=F.getState();if(!pe)return;Cv(new Map([[e,b]]),{x:0,y:0,width:ce,height:re},ee,!0).length>0||ye(b.position.x+R.width/2,b.position.y+R.height/2,{zoom:ee[2]})};return l.jsx("div",{className:jn(["react-flow__node",`react-flow__node-${N}`,{[p]:S},b.className,{selected:b.selected,selectable:A,parent:k,draggable:S,dragging:j}]),ref:L,style:{zIndex:_.z,transform:`translate(${_.positionAbsolute.x}px,${_.positionAbsolute.y}px)`,pointerEvents:B?"all":"none",visibility:X?"visible":"hidden",...b.style,...M},"data-id":e,"data-testid":`rf__node-${e}`,onMouseEnter:I,onMouseMove:V,onMouseLeave:G,onContextMenu:P,onClick:q,onDoubleClick:ie,onKeyDown:D?ne:void 0,tabIndex:D?0:void 0,onFocus:D?oe:void 0,role:b.ariaRole??(D?"group":void 0),"aria-roledescription":"node","aria-describedby":m?void 0:`${NP}-${y}`,"aria-label":b.ariaLabel,...b.domAttributes,children:l.jsx(sce,{value:e,children:l.jsx(C,{id:e,data:b.data,type:N,positionAbsoluteX:_.positionAbsolute.x,positionAbsoluteY:_.positionAbsolute.y,selected:b.selected??!1,selectable:A,draggable:S,deletable:b.deletable??!0,isConnectable:O,sourcePosition:b.sourcePosition,targetPosition:b.targetPosition,dragging:j,dragHandle:b.dragHandle,zIndex:_.z,parentId:b.parentId,...R})})})}var _ce=w.memo(vce);const kce=e=>({nodesDraggable:e.nodesDraggable,nodesConnectable:e.nodesConnectable,nodesFocusable:e.nodesFocusable,elementsSelectable:e.elementsSelectable,onError:e.onError});function BP(e){const{nodesDraggable:t,nodesConnectable:n,nodesFocusable:r,elementsSelectable:s,onError:i}=xt(kce,sn),a=bce(e.onlyRenderVisibleElements),o=xce();return l.jsx("div",{className:"react-flow__nodes",style:l0,children:a.map(c=>l.jsx(_ce,{id:c,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},c))})}BP.displayName="NodeRenderer";const Nce=w.memo(BP);function Sce(e){return xt(w.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&&uoe({sourceNode:i,targetNode:a,width:n.width,height:n.height,transform:n.transform})&&r.push(s.id)}return r},[e]),sn)}const Tce=({color:e="none",strokeWidth:t=1})=>{const n={strokeWidth:t,...e&&{stroke:e}};return l.jsx("polyline",{className:"arrow",style:n,strokeLinecap:"round",fill:"none",strokeLinejoin:"round",points:"-5,-4 0,0 -5,4"})},Ace=({color:e="none",strokeWidth:t=1})=>{const n={strokeWidth:t,...e&&{stroke:e,fill:e}};return l.jsx("polyline",{className:"arrowclosed",style:n,strokeLinecap:"round",strokeLinejoin:"round",points:"-5,-4 0,0 -5,4 -5,-4"})},cA={[Lc.Arrow]:Tce,[Lc.ArrowClosed]:Ace};function Cce(e){const t=an();return w.useMemo(()=>{var s,i;return Object.prototype.hasOwnProperty.call(cA,e)?cA[e]:((i=(s=t.getState()).onError)==null||i.call(s,"009",Zs.error009(e)),null)},[e])}const Ice=({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 c=Cce(t);return c?l.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:l.jsx(c,{color:n,strokeWidth:a})}):null},FP=({defaultColor:e,rfId:t})=>{const n=xt(i=>i.edges),r=xt(i=>i.defaultEdgeOptions),s=w.useMemo(()=>boe(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?l.jsx("svg",{className:"react-flow__marker","aria-hidden":"true",children:l.jsx("defs",{children:s.map(i=>l.jsx(Ice,{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};FP.displayName="MarkerDefinitions";var Oce=w.memo(FP);function UP({x:e,y:t,label:n,labelStyle:r,labelShowBg:s=!0,labelBgStyle:i,labelBgPadding:a=[2,4],labelBgBorderRadius:o=2,children:c,className:u,...d}){const[f,h]=w.useState({x:1,y:0,width:0,height:0}),p=jn(["react-flow__edge-textwrapper",u]),m=w.useRef(null);return w.useEffect(()=>{if(m.current){const y=m.current.getBBox();h({x:y.x,y:y.y,width:y.width,height:y.height})}},[n]),n?l.jsxs("g",{transform:`translate(${e-f.width/2} ${t-f.height/2})`,className:p,visibility:f.width?"visible":"hidden",...d,children:[s&&l.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}),l.jsx("text",{className:"react-flow__edge-text",y:f.height/2,dy:"0.3em",ref:m,style:r,children:n}),c]}):null}UP.displayName="EdgeText";const Rce=w.memo(UP);function zf({path:e,labelX:t,labelY:n,label:r,labelStyle:s,labelShowBg:i,labelBgStyle:a,labelBgPadding:o,labelBgBorderRadius:c,interactionWidth:u=20,...d}){return l.jsxs(l.Fragment,{children:[l.jsx("path",{...d,d:e,fill:"none",className:jn(["react-flow__edge-path",d.className])}),u?l.jsx("path",{d:e,fill:"none",strokeOpacity:0,strokeWidth:u,className:"react-flow__edge-interaction"}):null,r&&Vs(t)&&Vs(n)?l.jsx(Rce,{x:t,y:n,label:r,labelStyle:s,labelShowBg:i,labelBgStyle:a,labelBgPadding:o,labelBgBorderRadius:c}):null]})}function uA({pos:e,x1:t,y1:n,x2:r,y2:s}){return e===Fe.Left||e===Fe.Right?[.5*(t+r),n]:[t,.5*(n+s)]}function $P({sourceX:e,sourceY:t,sourcePosition:n=Fe.Bottom,targetX:r,targetY:s,targetPosition:i=Fe.Top}){const[a,o]=uA({pos:n,x1:e,y1:t,x2:r,y2:s}),[c,u]=uA({pos:i,x1:r,y1:s,x2:e,y2:t}),[d,f,h,p]=sP({sourceX:e,sourceY:t,targetX:r,targetY:s,sourceControlX:a,sourceControlY:o,targetControlX:c,targetControlY:u});return[`M${e},${t} C${a},${o} ${c},${u} ${r},${s}`,d,f,h,p]}function HP(e){return w.memo(({id:t,sourceX:n,sourceY:r,targetX:s,targetY:i,sourcePosition:a,targetPosition:o,label:c,labelStyle:u,labelShowBg:d,labelBgStyle:f,labelBgPadding:h,labelBgBorderRadius:p,style:m,markerEnd:y,markerStart:E,interactionWidth:g})=>{const[x,b,_]=$P({sourceX:n,sourceY:r,sourcePosition:a,targetX:s,targetY:i,targetPosition:o}),k=e.isInternal?void 0:t;return l.jsx(zf,{id:k,path:x,labelX:b,labelY:_,label:c,labelStyle:u,labelShowBg:d,labelBgStyle:f,labelBgPadding:h,labelBgBorderRadius:p,style:m,markerEnd:y,markerStart:E,interactionWidth:g})})}const Lce=HP({isInternal:!1}),zP=HP({isInternal:!0});Lce.displayName="SimpleBezierEdge";zP.displayName="SimpleBezierEdgeInternal";function VP(e){return w.memo(({id:t,sourceX:n,sourceY:r,targetX:s,targetY:i,label:a,labelStyle:o,labelShowBg:c,labelBgStyle:u,labelBgPadding:d,labelBgBorderRadius:f,style:h,sourcePosition:p=Fe.Bottom,targetPosition:m=Fe.Top,markerEnd:y,markerStart:E,pathOptions:g,interactionWidth:x})=>{const[b,_,k]=Wm({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}),N=e.isInternal?void 0:t;return l.jsx(zf,{id:N,path:b,labelX:_,labelY:k,label:a,labelStyle:o,labelShowBg:c,labelBgStyle:u,labelBgPadding:d,labelBgBorderRadius:f,style:h,markerEnd:y,markerStart:E,interactionWidth:x})})}const KP=VP({isInternal:!1}),YP=VP({isInternal:!0});KP.displayName="SmoothStepEdge";YP.displayName="SmoothStepEdgeInternal";function GP(e){return w.memo(({id:t,...n})=>{var s;const r=e.isInternal?void 0:t;return l.jsx(KP,{...n,id:r,pathOptions:w.useMemo(()=>{var i;return{borderRadius:0,offset:(i=n.pathOptions)==null?void 0:i.offset}},[(s=n.pathOptions)==null?void 0:s.offset])})})}const Mce=GP({isInternal:!1}),WP=GP({isInternal:!0});Mce.displayName="StepEdge";WP.displayName="StepEdgeInternal";function qP(e){return w.memo(({id:t,sourceX:n,sourceY:r,targetX:s,targetY:i,label:a,labelStyle:o,labelShowBg:c,labelBgStyle:u,labelBgPadding:d,labelBgBorderRadius:f,style:h,markerEnd:p,markerStart:m,interactionWidth:y})=>{const[E,g,x]=oP({sourceX:n,sourceY:r,targetX:s,targetY:i}),b=e.isInternal?void 0:t;return l.jsx(zf,{id:b,path:E,labelX:g,labelY:x,label:a,labelStyle:o,labelShowBg:c,labelBgStyle:u,labelBgPadding:d,labelBgBorderRadius:f,style:h,markerEnd:p,markerStart:m,interactionWidth:y})})}const jce=qP({isInternal:!1}),XP=qP({isInternal:!0});jce.displayName="StraightEdge";XP.displayName="StraightEdgeInternal";function QP(e){return w.memo(({id:t,sourceX:n,sourceY:r,targetX:s,targetY:i,sourcePosition:a=Fe.Bottom,targetPosition:o=Fe.Top,label:c,labelStyle:u,labelShowBg:d,labelBgStyle:f,labelBgPadding:h,labelBgBorderRadius:p,style:m,markerEnd:y,markerStart:E,pathOptions:g,interactionWidth:x})=>{const[b,_,k]=iP({sourceX:n,sourceY:r,sourcePosition:a,targetX:s,targetY:i,targetPosition:o,curvature:g==null?void 0:g.curvature}),N=e.isInternal?void 0:t;return l.jsx(zf,{id:N,path:b,labelX:_,labelY:k,label:c,labelStyle:u,labelShowBg:d,labelBgStyle:f,labelBgPadding:h,labelBgBorderRadius:p,style:m,markerEnd:y,markerStart:E,interactionWidth:x})})}const Dce=QP({isInternal:!1}),ZP=QP({isInternal:!0});Dce.displayName="BezierEdge";ZP.displayName="BezierEdgeInternal";const dA={default:ZP,straight:XP,step:WP,smoothstep:YP,simplebezier:zP},fA={sourceX:null,sourceY:null,targetX:null,targetY:null,sourcePosition:null,targetPosition:null},Pce=(e,t,n)=>n===Fe.Left?e-t:n===Fe.Right?e+t:e,Bce=(e,t,n)=>n===Fe.Top?e-t:n===Fe.Bottom?e+t:e,hA="react-flow__edgeupdater";function pA({position:e,centerX:t,centerY:n,radius:r=10,onMouseDown:s,onMouseEnter:i,onMouseOut:a,type:o}){return l.jsx("circle",{onMouseDown:s,onMouseEnter:i,onMouseOut:a,className:jn([hA,`${hA}-${o}`]),cx:Pce(t,r,e),cy:Bce(n,r,e),r,stroke:"transparent",fill:"transparent"})}function Fce({isReconnectable:e,reconnectRadius:t,edge:n,sourceX:r,sourceY:s,targetX:i,targetY:a,sourcePosition:o,targetPosition:c,onReconnect:u,onReconnectStart:d,onReconnectEnd:f,setReconnecting:h,setUpdateHover:p}){const m=an(),y=(_,k)=>{if(_.button!==0)return;const{autoPanOnConnect:N,domNode:C,connectionMode:S,connectionRadius:A,lib:O,onConnectStart:D,cancelConnection:F,nodeLookup:X,rfId:L,panBy:j,updateConnection:T}=m.getState(),R=k.type==="target",M=(V,G)=>{h(!1),f==null||f(V,n,k.type,G)},B=V=>u==null?void 0:u(n,V),I=(V,G)=>{h(!0),d==null||d(_,n,k.type),D==null||D(V,G)};jE.onPointerDown(_.nativeEvent,{autoPanOnConnect:N,connectionMode:S,connectionRadius:A,domNode:C,handleId:k.id,nodeId:k.nodeId,nodeLookup:X,isTarget:R,edgeUpdaterType:k.type,lib:O,flowId:L,cancelConnection:F,panBy:j,isValidConnection:(...V)=>{var G,P;return((P=(G=m.getState()).isValidConnection)==null?void 0:P.call(G,...V))??!0},onConnect:B,onConnectStart:I,onConnectEnd:(...V)=>{var G,P;return(P=(G=m.getState()).onConnectEnd)==null?void 0:P.call(G,...V)},onReconnectEnd:M,updateConnection:T,getTransform:()=>m.getState().transform,getFromHandle:()=>m.getState().connection.fromHandle,dragThreshold:m.getState().connectionDragThreshold,handleDomNode:_.currentTarget})},E=_=>y(_,{nodeId:n.target,id:n.targetHandle??null,type:"target"}),g=_=>y(_,{nodeId:n.source,id:n.sourceHandle??null,type:"source"}),x=()=>p(!0),b=()=>p(!1);return l.jsxs(l.Fragment,{children:[(e===!0||e==="source")&&l.jsx(pA,{position:o,centerX:r,centerY:s,radius:t,onMouseDown:E,onMouseEnter:x,onMouseOut:b,type:"source"}),(e===!0||e==="target")&&l.jsx(pA,{position:c,centerX:i,centerY:a,radius:t,onMouseDown:g,onMouseEnter:x,onMouseOut:b,type:"target"})]})}function Uce({id:e,edgesFocusable:t,edgesReconnectable:n,elementsSelectable:r,onClick:s,onDoubleClick:i,onContextMenu:a,onMouseEnter:o,onMouseMove:c,onMouseLeave:u,reconnectRadius:d,onReconnect:f,onReconnectStart:h,onReconnectEnd:p,rfId:m,edgeTypes:y,noPanClassName:E,onError:g,disableKeyboardA11y:x}){let b=xt(ye=>ye.edgeLookup.get(e));const _=xt(ye=>ye.defaultEdgeOptions);b=_?{..._,...b}:b;let k=b.type||"default",N=(y==null?void 0:y[k])||dA[k];N===void 0&&(g==null||g("011",Zs.error011(k)),k="default",N=(y==null?void 0:y.default)||dA.default);const C=!!(b.focusable||t&&typeof b.focusable>"u"),S=typeof f<"u"&&(b.reconnectable||n&&typeof b.reconnectable>"u"),A=!!(b.selectable||r&&typeof b.selectable>"u"),O=w.useRef(null),[D,F]=w.useState(!1),[X,L]=w.useState(!1),j=an(),{zIndex:T,sourceX:R,sourceY:M,targetX:B,targetY:I,sourcePosition:V,targetPosition:G}=xt(w.useCallback(ye=>{const J=ye.nodeLookup.get(b.source),fe=ye.nodeLookup.get(b.target);if(!J||!fe)return{zIndex:b.zIndex,...fA};const Ee=yoe({id:e,sourceNode:J,targetNode:fe,sourceHandle:b.sourceHandle||null,targetHandle:b.targetHandle||null,connectionMode:ye.connectionMode,onError:g});return{zIndex:coe({selected:b.selected,zIndex:b.zIndex,sourceNode:J,targetNode:fe,elevateOnSelect:ye.elevateEdgesOnSelect,zIndexMode:ye.zIndexMode}),...Ee||fA}},[b.source,b.target,b.sourceHandle,b.targetHandle,b.selected,b.zIndex]),sn),P=w.useMemo(()=>b.markerStart?`url('#${LE(b.markerStart,m)}')`:void 0,[b.markerStart,m]),ie=w.useMemo(()=>b.markerEnd?`url('#${LE(b.markerEnd,m)}')`:void 0,[b.markerEnd,m]);if(b.hidden||R===null||M===null||B===null||I===null)return null;const q=ye=>{var Te;const{addSelectedEdges:J,unselectNodesAndEdges:fe,multiSelectionActive:Ee}=j.getState();A&&(j.setState({nodesSelectionActive:!1}),b.selected&&Ee?(fe({nodes:[],edges:[b]}),(Te=O.current)==null||Te.blur()):J([e])),s&&s(ye,b)},ne=i?ye=>{i(ye,{...b})}:void 0,oe=a?ye=>{a(ye,{...b})}:void 0,ee=o?ye=>{o(ye,{...b})}:void 0,ce=c?ye=>{c(ye,{...b})}:void 0,re=u?ye=>{u(ye,{...b})}:void 0,pe=ye=>{var J;if(!x&&KD.includes(ye.key)&&A){const{unselectNodesAndEdges:fe,addSelectedEdges:Ee}=j.getState();ye.key==="Escape"?((J=O.current)==null||J.blur(),fe({edges:[b]})):Ee([e])}};return l.jsx("svg",{style:{zIndex:T},children:l.jsxs("g",{className:jn(["react-flow__edge",`react-flow__edge-${k}`,b.className,E,{selected:b.selected,animated:b.animated,inactive:!A&&!s,updating:D,selectable:A}]),onClick:q,onDoubleClick:ne,onContextMenu:oe,onMouseEnter:ee,onMouseMove:ce,onMouseLeave:re,onKeyDown:C?pe:void 0,tabIndex:C?0:void 0,role:b.ariaRole??(C?"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":C?`${SP}-${m}`:void 0,ref:O,...b.domAttributes,children:[!X&&l.jsx(N,{id:e,source:b.source,target:b.target,type:b.type,selected:b.selected,animated:b.animated,selectable:A,deletable:b.deletable??!0,label:b.label,labelStyle:b.labelStyle,labelShowBg:b.labelShowBg,labelBgStyle:b.labelBgStyle,labelBgPadding:b.labelBgPadding,labelBgBorderRadius:b.labelBgBorderRadius,sourceX:R,sourceY:M,targetX:B,targetY:I,sourcePosition:V,targetPosition:G,data:b.data,style:b.style,sourceHandleId:b.sourceHandle,targetHandleId:b.targetHandle,markerStart:P,markerEnd:ie,pathOptions:"pathOptions"in b?b.pathOptions:void 0,interactionWidth:b.interactionWidth}),S&&l.jsx(Fce,{edge:b,isReconnectable:S,reconnectRadius:d,onReconnect:f,onReconnectStart:h,onReconnectEnd:p,sourceX:R,sourceY:M,targetX:B,targetY:I,sourcePosition:V,targetPosition:G,setUpdateHover:F,setReconnecting:L})]})})}var $ce=w.memo(Uce);const Hce=e=>({edgesFocusable:e.edgesFocusable,edgesReconnectable:e.edgesReconnectable,elementsSelectable:e.elementsSelectable,connectionMode:e.connectionMode,onError:e.onError});function JP({defaultMarkerColor:e,onlyRenderVisibleElements:t,rfId:n,edgeTypes:r,noPanClassName:s,onReconnect:i,onEdgeContextMenu:a,onEdgeMouseEnter:o,onEdgeMouseMove:c,onEdgeMouseLeave:u,onEdgeClick:d,reconnectRadius:f,onEdgeDoubleClick:h,onReconnectStart:p,onReconnectEnd:m,disableKeyboardA11y:y}){const{edgesFocusable:E,edgesReconnectable:g,elementsSelectable:x,onError:b}=xt(Hce,sn),_=Sce(t);return l.jsxs("div",{className:"react-flow__edges",children:[l.jsx(Oce,{defaultColor:e,rfId:n}),_.map(k=>l.jsx($ce,{id:k,edgesFocusable:E,edgesReconnectable:g,elementsSelectable:x,noPanClassName:s,onReconnect:i,onContextMenu:a,onMouseEnter:o,onMouseMove:c,onMouseLeave:u,onClick:d,reconnectRadius:f,onDoubleClick:h,onReconnectStart:p,onReconnectEnd:m,rfId:n,onError:b,edgeTypes:r,disableKeyboardA11y:y},k))]})}JP.displayName="EdgeRenderer";const zce=w.memo(JP),Vce=e=>`translate(${e.transform[0]}px,${e.transform[1]}px) scale(${e.transform[2]})`;function Kce({children:e}){const t=xt(Vce);return l.jsx("div",{className:"react-flow__viewport xyflow__viewport react-flow__container",style:{transform:t},children:e})}function Yce(e){const t=o0(),n=w.useRef(!1);w.useEffect(()=>{!n.current&&t.viewportInitialized&&e&&(setTimeout(()=>e(t),1),n.current=!0)},[e,t.viewportInitialized])}const Gce=e=>{var t;return(t=e.panZoom)==null?void 0:t.syncViewport};function Wce(e){const t=xt(Gce),n=an();return w.useEffect(()=>{e&&(t==null||t(e),n.setState({transform:[e.x,e.y,e.zoom]}))},[e,t]),null}function qce(e){return e.connection.inProgress?{...e.connection,to:eu(e.connection.to,e.transform)}:{...e.connection}}function Xce(e){return qce}function Qce(e){const t=Xce();return xt(t,sn)}const Zce=e=>({nodesConnectable:e.nodesConnectable,isValid:e.connection.isValid,inProgress:e.connection.inProgress,width:e.width,height:e.height});function Jce({containerStyle:e,style:t,type:n,component:r}){const{nodesConnectable:s,width:i,height:a,isValid:o,inProgress:c}=xt(Zce,sn);return!(i&&s&&c)?null:l.jsx("svg",{style:e,width:i,height:a,className:"react-flow__connectionline react-flow__container",children:l.jsx("g",{className:jn(["react-flow__connection",WD(o)]),children:l.jsx(e4,{style:t,type:n,CustomComponent:r,isValid:o})})})}const e4=({style:e,type:t=_a.Bezier,CustomComponent:n,isValid:r})=>{const{inProgress:s,from:i,fromNode:a,fromHandle:o,fromPosition:c,to:u,toNode:d,toHandle:f,toPosition:h,pointer:p}=Qce();if(!s)return;if(n)return l.jsx(n,{connectionLineType:t,connectionLineStyle:e,fromNode:a,fromHandle:o,fromX:i.x,fromY:i.y,toX:u.x,toY:u.y,fromPosition:c,toPosition:h,connectionStatus:WD(r),toNode:d,toHandle:f,pointer:p});let m="";const y={sourceX:i.x,sourceY:i.y,sourcePosition:c,targetX:u.x,targetY:u.y,targetPosition:h};switch(t){case _a.Bezier:[m]=iP(y);break;case _a.SimpleBezier:[m]=$P(y);break;case _a.Step:[m]=Wm({...y,borderRadius:0});break;case _a.SmoothStep:[m]=Wm(y);break;default:[m]=oP(y)}return l.jsx("path",{d:m,fill:"none",className:"react-flow__connection-path",style:e})};e4.displayName="ConnectionLine";const eue={};function mA(e=eue){w.useRef(e),an(),w.useEffect(()=>{},[e])}function tue(){an(),w.useRef(!1),w.useEffect(()=>{},[])}function t4({nodeTypes:e,edgeTypes:t,onInit:n,onNodeClick:r,onEdgeClick:s,onNodeDoubleClick:i,onEdgeDoubleClick:a,onNodeMouseEnter:o,onNodeMouseMove:c,onNodeMouseLeave:u,onNodeContextMenu:d,onSelectionContextMenu:f,onSelectionStart:h,onSelectionEnd:p,connectionLineType:m,connectionLineStyle:y,connectionLineComponent:E,connectionLineContainerStyle:g,selectionKeyCode:x,selectionOnDrag:b,selectionMode:_,multiSelectionKeyCode:k,panActivationKeyCode:N,zoomActivationKeyCode:C,deleteKeyCode:S,onlyRenderVisibleElements:A,elementsSelectable:O,defaultViewport:D,translateExtent:F,minZoom:X,maxZoom:L,preventScrolling:j,defaultMarkerColor:T,zoomOnScroll:R,zoomOnPinch:M,panOnScroll:B,panOnScrollSpeed:I,panOnScrollMode:V,zoomOnDoubleClick:G,panOnDrag:P,autoPanOnSelection:ie,onPaneClick:q,onPaneMouseEnter:ne,onPaneMouseMove:oe,onPaneMouseLeave:ee,onPaneScroll:ce,onPaneContextMenu:re,paneClickDistance:pe,nodeClickDistance:ye,onEdgeContextMenu:J,onEdgeMouseEnter:fe,onEdgeMouseMove:Ee,onEdgeMouseLeave:Te,reconnectRadius:Ge,onReconnect:ke,onReconnectStart:rt,onReconnectEnd:ze,noDragClassName:We,noWheelClassName:yt,noPanClassName:at,disableKeyboardA11y:St,nodeExtent:Tt,rfId:H,viewport:Z,onViewportChange:le}){return mA(e),mA(t),tue(),Yce(n),Wce(Z),l.jsx(gce,{onPaneClick:q,onPaneMouseEnter:ne,onPaneMouseMove:oe,onPaneMouseLeave:ee,onPaneContextMenu:re,onPaneScroll:ce,paneClickDistance:pe,deleteKeyCode:S,selectionKeyCode:x,selectionOnDrag:b,selectionMode:_,onSelectionStart:h,onSelectionEnd:p,multiSelectionKeyCode:k,panActivationKeyCode:N,zoomActivationKeyCode:C,elementsSelectable:O,zoomOnScroll:R,zoomOnPinch:M,zoomOnDoubleClick:G,panOnScroll:B,panOnScrollSpeed:I,panOnScrollMode:V,panOnDrag:P,autoPanOnSelection:ie,defaultViewport:D,translateExtent:F,minZoom:X,maxZoom:L,onSelectionContextMenu:f,preventScrolling:j,noDragClassName:We,noWheelClassName:yt,noPanClassName:at,disableKeyboardA11y:St,onViewportChange:le,isControlledViewport:!!Z,children:l.jsxs(Kce,{children:[l.jsx(zce,{edgeTypes:t,onEdgeClick:s,onEdgeDoubleClick:a,onReconnect:ke,onReconnectStart:rt,onReconnectEnd:ze,onlyRenderVisibleElements:A,onEdgeContextMenu:J,onEdgeMouseEnter:fe,onEdgeMouseMove:Ee,onEdgeMouseLeave:Te,reconnectRadius:Ge,defaultMarkerColor:T,noPanClassName:at,disableKeyboardA11y:St,rfId:H}),l.jsx(Jce,{style:y,type:m,component:E,containerStyle:g}),l.jsx("div",{className:"react-flow__edgelabel-renderer"}),l.jsx(Nce,{nodeTypes:e,onNodeClick:r,onNodeDoubleClick:i,onNodeMouseEnter:o,onNodeMouseMove:c,onNodeMouseLeave:u,onNodeContextMenu:d,nodeClickDistance:ye,onlyRenderVisibleElements:A,noPanClassName:at,noDragClassName:We,disableKeyboardA11y:St,nodeExtent:Tt,rfId:H}),l.jsx("div",{className:"react-flow__viewport-portal"})]})})}t4.displayName="GraphView";const nue=w.memo(t4),rue=JD(),gA=({nodes:e,edges:t,defaultNodes:n,defaultEdges:r,width:s,height:i,fitView:a,fitViewOptions:o,minZoom:c=.5,maxZoom:u=2,nodeOrigin:d,nodeExtent:f,zIndexMode:h="basic"}={})=>{const p=new Map,m=new Map,y=new Map,E=new Map,g=r??t??[],x=n??e??[],b=d??[0,0],_=f??cf;uP(y,E,g);const{nodesInitialized:k}=ME(x,p,m,{nodeOrigin:b,nodeExtent:_,zIndexMode:h});let N=[0,0,1];if(a&&s&&i){const C=$f(p,{filter:D=>!!((D.width||D.initialWidth)&&(D.height||D.initialHeight))}),{x:S,y:A,zoom:O}=Ov(C,s,i,c,u,(o==null?void 0:o.padding)??.1);N=[S,A,O]}return{rfId:"1",width:s??0,height:i??0,transform:N,nodes:x,nodesInitialized:k,nodeLookup:p,parentLookup:m,edges:g,edgeLookup:E,connectionLookup:y,onNodesChange:null,onEdgesChange:null,hasDefaultNodes:n!==void 0,hasDefaultEdges:r!==void 0,panZoom:null,minZoom:c,maxZoom:u,translateExtent:cf,nodeExtent:_,nodesSelectionActive:!1,userSelectionActive:!1,userSelectionRect:null,connectionMode:Rc.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:{...GD},connectionClickStartHandle:null,connectOnClick:!0,ariaLiveMessage:"",autoPanOnConnect:!0,autoPanOnNodeDrag:!0,autoPanOnNodeFocus:!0,autoPanSpeed:15,connectionRadius:20,onError:rue,isValidConnection:void 0,onSelectionChangeHandlers:[],lib:"react",debug:!1,ariaLabelConfig:YD,zIndexMode:h,onNodesChangeMiddlewareMap:new Map,onEdgesChangeMiddlewareMap:new Map}},sue=({nodes:e,edges:t,defaultNodes:n,defaultEdges:r,width:s,height:i,fitView:a,fitViewOptions:o,minZoom:c,maxZoom:u,nodeOrigin:d,nodeExtent:f,zIndexMode:h})=>xle((p,m)=>{async function y(){const{nodeLookup:E,panZoom:g,fitViewOptions:x,fitViewResolver:b,width:_,height:k,minZoom:N,maxZoom:C}=m();g&&(await noe({nodes:E,width:_,height:k,panZoom:g,minZoom:N,maxZoom:C},x),b==null||b.resolve(!0),p({fitViewResolver:null}))}return{...gA({nodes:e,edges:t,width:s,height:i,fitView:a,fitViewOptions:o,minZoom:c,maxZoom:u,nodeOrigin:d,nodeExtent:f,defaultNodes:n,defaultEdges:r,zIndexMode:h}),setNodes:E=>{const{nodeLookup:g,parentLookup:x,nodeOrigin:b,elevateNodesOnSelect:_,fitViewQueued:k,zIndexMode:N,nodesSelectionActive:C}=m(),{nodesInitialized:S,hasSelectedNodes:A}=ME(E,g,x,{nodeOrigin:b,nodeExtent:f,elevateNodesOnSelect:_,checkEquality:!0,zIndexMode:N}),O=C&&A;k&&S?(y(),p({nodes:E,nodesInitialized:S,fitViewQueued:!1,fitViewOptions:void 0,nodesSelectionActive:O})):p({nodes:E,nodesInitialized:S,nodesSelectionActive:O})},setEdges:E=>{const{connectionLookup:g,edgeLookup:x}=m();uP(g,x,E),p({edges:E})},setDefaultNodesAndEdges:(E,g)=>{if(E){const{setNodes:x}=m();x(E),p({hasDefaultNodes:!0})}if(g){const{setEdges:x}=m();x(g),p({hasDefaultEdges:!0})}},updateNodeInternals:E=>{const{triggerNodeChanges:g,nodeLookup:x,parentLookup:b,domNode:_,nodeOrigin:k,nodeExtent:N,debug:C,fitViewQueued:S,zIndexMode:A}=m(),{changes:O,updatedInternals:D}=Noe(E,x,b,_,k,N,A);D&&(woe(x,b,{nodeOrigin:k,nodeExtent:N,zIndexMode:A}),S?(y(),p({fitViewQueued:!1,fitViewOptions:void 0})):p({}),(O==null?void 0:O.length)>0&&(C&&console.log("React Flow: trigger node changes",O),g==null||g(O)))},updateNodePositions:(E,g=!1)=>{const x=[];let b=[];const{nodeLookup:_,triggerNodeChanges:k,connection:N,updateConnection:C,onNodesChangeMiddlewareMap:S}=m();for(const[A,O]of E){const D=_.get(A),F=!!(D!=null&&D.expandParent&&(D!=null&&D.parentId)&&(O!=null&&O.position)),X={id:A,type:"position",position:F?{x:Math.max(0,O.position.x),y:Math.max(0,O.position.y)}:O.position,dragging:g};if(D&&N.inProgress&&N.fromNode.id===D.id){const L=Uo(D,N.fromHandle,Fe.Left,!0);C({...N,from:L})}F&&D.parentId&&x.push({id:A,parentId:D.parentId,rect:{...O.internals.positionAbsolute,width:O.measured.width??0,height:O.measured.height??0}}),b.push(X)}if(x.length>0){const{parentLookup:A,nodeOrigin:O}=m(),D=Bv(x,_,A,O);b.push(...D)}for(const A of S.values())b=A(b);k(b)},triggerNodeChanges:E=>{const{onNodesChange:g,setNodes:x,nodes:b,hasDefaultNodes:_,debug:k}=m();if(E!=null&&E.length){if(_){const N=CP(E,b);x(N)}k&&console.log("React Flow: trigger node changes",E),g==null||g(E)}},triggerEdgeChanges:E=>{const{onEdgesChange:g,setEdges:x,edges:b,hasDefaultEdges:_,debug:k}=m();if(E!=null&&E.length){if(_){const N=IP(E,b);x(N)}k&&console.log("React Flow: trigger edge changes",E),g==null||g(E)}},addSelectedNodes:E=>{const{multiSelectionActive:g,edgeLookup:x,nodeLookup:b,triggerNodeChanges:_,triggerEdgeChanges:k}=m();if(g){const N=E.map(C=>io(C,!0));_(N);return}_(Hl(b,new Set([...E]),!0)),k(Hl(x))},addSelectedEdges:E=>{const{multiSelectionActive:g,edgeLookup:x,nodeLookup:b,triggerNodeChanges:_,triggerEdgeChanges:k}=m();if(g){const N=E.map(C=>io(C,!0));k(N);return}k(Hl(x,new Set([...E]))),_(Hl(b,new Set,!0))},unselectNodesAndEdges:({nodes:E,edges:g}={})=>{const{edges:x,nodes:b,nodeLookup:_,triggerNodeChanges:k,triggerEdgeChanges:N}=m(),C=E||b,S=g||x,A=[];for(const D of C){if(!D.selected)continue;const F=_.get(D.id);F&&(F.selected=!1),A.push(io(D.id,!1))}const O=[];for(const D of S)D.selected&&O.push(io(D.id,!1));k(A),N(O)},setMinZoom:E=>{const{panZoom:g,maxZoom:x}=m();g==null||g.setScaleExtent([E,x]),p({minZoom:E})},setMaxZoom:E=>{const{panZoom:g,minZoom:x}=m();g==null||g.setScaleExtent([x,E]),p({maxZoom:E})},setTranslateExtent:E=>{var g;(g=m().panZoom)==null||g.setTranslateExtent(E),p({translateExtent:E})},resetSelectedElements:()=>{const{edges:E,nodes:g,triggerNodeChanges:x,triggerEdgeChanges:b,elementsSelectable:_}=m();if(!_)return;const k=g.reduce((C,S)=>S.selected?[...C,io(S.id,!1)]:C,[]),N=E.reduce((C,S)=>S.selected?[...C,io(S.id,!1)]:C,[]);x(k),b(N)},setNodeExtent:E=>{const{nodes:g,nodeLookup:x,parentLookup:b,nodeOrigin:_,elevateNodesOnSelect:k,nodeExtent:N,zIndexMode:C}=m();E[0][0]===N[0][0]&&E[0][1]===N[0][1]&&E[1][0]===N[1][0]&&E[1][1]===N[1][1]||(ME(g,x,b,{nodeOrigin:_,nodeExtent:E,elevateNodesOnSelect:k,checkEquality:!1,zIndexMode:C}),p({nodeExtent:E}))},panBy:E=>{const{transform:g,width:x,height:b,panZoom:_,translateExtent:k}=m();return Soe({delta:E,panZoom:_,transform:g,translateExtent:k,width:x,height:b})},setCenter:async(E,g,x)=>{const{width:b,height:_,maxZoom:k,panZoom:N}=m();if(!N)return!1;const C=typeof(x==null?void 0:x.zoom)<"u"?x.zoom:k;return await N.setViewport({x:b/2-E*C,y:_/2-g*C,zoom:C},{duration:x==null?void 0:x.duration,ease:x==null?void 0:x.ease,interpolate:x==null?void 0:x.interpolate}),!0},cancelConnection:()=>{p({connection:{...GD}})},updateConnection:E=>{p({connection:E})},reset:()=>p({...gA()})}},Object.is);function Uv({initialNodes:e,initialEdges:t,defaultNodes:n,defaultEdges:r,initialWidth:s,initialHeight:i,initialMinZoom:a,initialMaxZoom:o,initialFitViewOptions:c,fitView:u,nodeOrigin:d,nodeExtent:f,zIndexMode:h,children:p}){const[m]=w.useState(()=>sue({nodes:e,edges:t,defaultNodes:n,defaultEdges:r,width:s,height:i,fitView:u,minZoom:a,maxZoom:o,fitViewOptions:c,nodeOrigin:d,nodeExtent:f,zIndexMode:h}));return l.jsx(wle,{value:m,children:l.jsx(Kle,{children:p})})}function iue({children:e,nodes:t,edges:n,defaultNodes:r,defaultEdges:s,width:i,height:a,fitView:o,fitViewOptions:c,minZoom:u,maxZoom:d,nodeOrigin:f,nodeExtent:h,zIndexMode:p}){return w.useContext(i0)?l.jsx(l.Fragment,{children:e}):l.jsx(Uv,{initialNodes:t,initialEdges:n,defaultNodes:r,defaultEdges:s,initialWidth:i,initialHeight:a,fitView:o,initialFitViewOptions:c,initialMinZoom:u,initialMaxZoom:d,nodeOrigin:f,nodeExtent:h,zIndexMode:p,children:e})}const aue={width:"100%",height:"100%",overflow:"hidden",position:"relative",zIndex:0};function oue({nodes:e,edges:t,defaultNodes:n,defaultEdges:r,className:s,nodeTypes:i,edgeTypes:a,onNodeClick:o,onEdgeClick:c,onInit:u,onMove:d,onMoveStart:f,onMoveEnd:h,onConnect:p,onConnectStart:m,onConnectEnd:y,onClickConnectStart:E,onClickConnectEnd:g,onNodeMouseEnter:x,onNodeMouseMove:b,onNodeMouseLeave:_,onNodeContextMenu:k,onNodeDoubleClick:N,onNodeDragStart:C,onNodeDrag:S,onNodeDragStop:A,onNodesDelete:O,onEdgesDelete:D,onDelete:F,onSelectionChange:X,onSelectionDragStart:L,onSelectionDrag:j,onSelectionDragStop:T,onSelectionContextMenu:R,onSelectionStart:M,onSelectionEnd:B,onBeforeDelete:I,connectionMode:V,connectionLineType:G=_a.Bezier,connectionLineStyle:P,connectionLineComponent:ie,connectionLineContainerStyle:q,deleteKeyCode:ne="Backspace",selectionKeyCode:oe="Shift",selectionOnDrag:ee=!1,selectionMode:ce=uf.Full,panActivationKeyCode:re="Space",multiSelectionKeyCode:pe=ff()?"Meta":"Control",zoomActivationKeyCode:ye=ff()?"Meta":"Control",snapToGrid:J,snapGrid:fe,onlyRenderVisibleElements:Ee=!1,selectNodesOnDrag:Te,nodesDraggable:Ge,autoPanOnNodeFocus:ke,nodesConnectable:rt,nodesFocusable:ze,nodeOrigin:We=TP,edgesFocusable:yt,edgesReconnectable:at,elementsSelectable:St=!0,defaultViewport:Tt=Mle,minZoom:H=.5,maxZoom:Z=2,translateExtent:le=cf,preventScrolling:be=!0,nodeExtent:Le,defaultMarkerColor:Ke="#b1b1b7",zoomOnScroll:Ot=!0,zoomOnPinch:He=!0,panOnScroll:Ce=!1,panOnScrollSpeed:Ie=.5,panOnScrollMode:wt=So.Free,zoomOnDoubleClick:Kt=!0,panOnDrag:Pt=!0,onPaneClick:pn,onPaneMouseEnter:je,onPaneMouseMove:st,onPaneMouseLeave:It,onPaneScroll:At,onPaneContextMenu:me,paneClickDistance:Ve=1,nodeClickDistance:nt=0,children:Xt,onReconnect:mn,onReconnectStart:Qt,onReconnectEnd:te,onEdgeContextMenu:he,onEdgeDoubleClick:Oe,onEdgeMouseEnter:De,onEdgeMouseMove:lt,onEdgeMouseLeave:Bt,reconnectRadius:it=10,onNodesChange:Q,onEdgesChange:ve,noDragClassName:xe="nodrag",noWheelClassName:Xe="nowheel",noPanClassName:qe="nopan",fitView:Je,fitViewOptions:ct,connectOnClick:Rt,attributionPosition:Ft,proOptions:vn,defaultEdgeOptions:_n,elevateNodesOnSelect:Ut=!0,elevateEdgesOnSelect:Ir=!1,disableKeyboardA11y:Dn=!1,autoPanOnConnect:or,autoPanOnNodeDrag:Or,autoPanOnSelection:Er=!0,autoPanSpeed:lr,connectionRadius:kn,isValidConnection:Zt,onError:Nn,style:Vn,id:Zn,nodeDragThreshold:on,connectionDragThreshold:as,viewport:Kn,onViewportChange:Pn,width:Jn,height:os,colorMode:Si="light",debug:ri,onScroll:Cs,ariaLabelConfig:Rr,zIndexMode:Zo="basic",...Jo},el){const Ti=Zn||"1",er=Ble(Si),Is=w.useCallback(Vr=>{Vr.currentTarget.scrollTo({top:0,left:0,behavior:"instant"}),Cs==null||Cs(Vr)},[Cs]);return l.jsx("div",{"data-testid":"rf__wrapper",...Jo,onScroll:Is,style:{...Vn,...aue},ref:el,className:jn(["react-flow",s,er]),id:Zn,role:"application",children:l.jsxs(iue,{nodes:e,edges:t,width:Jn,height:os,fitView:Je,fitViewOptions:ct,minZoom:H,maxZoom:Z,nodeOrigin:We,nodeExtent:Le,zIndexMode:Zo,children:[l.jsx(Ple,{nodes:e,edges:t,defaultNodes:n,defaultEdges:r,onConnect:p,onConnectStart:m,onConnectEnd:y,onClickConnectStart:E,onClickConnectEnd:g,nodesDraggable:Ge,autoPanOnNodeFocus:ke,nodesConnectable:rt,nodesFocusable:ze,edgesFocusable:yt,edgesReconnectable:at,elementsSelectable:St,elevateNodesOnSelect:Ut,elevateEdgesOnSelect:Ir,minZoom:H,maxZoom:Z,nodeExtent:Le,onNodesChange:Q,onEdgesChange:ve,snapToGrid:J,snapGrid:fe,connectionMode:V,translateExtent:le,connectOnClick:Rt,defaultEdgeOptions:_n,fitView:Je,fitViewOptions:ct,onNodesDelete:O,onEdgesDelete:D,onDelete:F,onNodeDragStart:C,onNodeDrag:S,onNodeDragStop:A,onSelectionDrag:j,onSelectionDragStart:L,onSelectionDragStop:T,onMove:d,onMoveStart:f,onMoveEnd:h,noPanClassName:qe,nodeOrigin:We,rfId:Ti,autoPanOnConnect:or,autoPanOnNodeDrag:Or,autoPanSpeed:lr,onError:Nn,connectionRadius:kn,isValidConnection:Zt,selectNodesOnDrag:Te,nodeDragThreshold:on,connectionDragThreshold:as,onBeforeDelete:I,debug:ri,ariaLabelConfig:Rr,zIndexMode:Zo}),l.jsx(nue,{onInit:u,onNodeClick:o,onEdgeClick:c,onNodeMouseEnter:x,onNodeMouseMove:b,onNodeMouseLeave:_,onNodeContextMenu:k,onNodeDoubleClick:N,nodeTypes:i,edgeTypes:a,connectionLineType:G,connectionLineStyle:P,connectionLineComponent:ie,connectionLineContainerStyle:q,selectionKeyCode:oe,selectionOnDrag:ee,selectionMode:ce,deleteKeyCode:ne,multiSelectionKeyCode:pe,panActivationKeyCode:re,zoomActivationKeyCode:ye,onlyRenderVisibleElements:Ee,defaultViewport:Tt,translateExtent:le,minZoom:H,maxZoom:Z,preventScrolling:be,zoomOnScroll:Ot,zoomOnPinch:He,zoomOnDoubleClick:Kt,panOnScroll:Ce,panOnScrollSpeed:Ie,panOnScrollMode:wt,panOnDrag:Pt,autoPanOnSelection:Er,onPaneClick:pn,onPaneMouseEnter:je,onPaneMouseMove:st,onPaneMouseLeave:It,onPaneScroll:At,onPaneContextMenu:me,paneClickDistance:Ve,nodeClickDistance:nt,onSelectionContextMenu:R,onSelectionStart:M,onSelectionEnd:B,onReconnect:mn,onReconnectStart:Qt,onReconnectEnd:te,onEdgeContextMenu:he,onEdgeDoubleClick:Oe,onEdgeMouseEnter:De,onEdgeMouseMove:lt,onEdgeMouseLeave:Bt,reconnectRadius:it,defaultMarkerColor:Ke,noDragClassName:xe,noWheelClassName:Xe,noPanClassName:qe,rfId:Ti,disableKeyboardA11y:Dn,nodeExtent:Le,viewport:Kn,onViewportChange:Pn}),l.jsx(Lle,{onSelectionChange:X}),Xt,l.jsx(Ale,{proOptions:vn,position:Ft}),l.jsx(Tle,{rfId:Ti,disableKeyboardA11y:Dn})]})})}var n4=RP(oue);const lue=e=>{var t;return(t=e.domNode)==null?void 0:t.querySelector(".react-flow__edgelabel-renderer")};function cue({children:e}){const t=xt(lue);return t?Ns.createPortal(e,t):null}function r4(e){const[t,n]=w.useState(e),r=w.useCallback(s=>n(i=>CP(s,i)),[]);return[t,n,r]}function s4(e){const[t,n]=w.useState(e),r=w.useCallback(s=>n(i=>IP(s,i)),[]);return[t,n,r]}const uue=e=>t=>{if(!e.includeHiddenNodes)return t.nodesInitialized;if(t.nodeLookup.size===0)return!1;for(const[,{internals:n}]of t.nodeLookup)if(n.handleBounds===void 0||!Rv(n.userNode))return!1;return!0};function due(e={includeHiddenNodes:!1}){return xt(uue(e))}function fue({dimensions:e,lineWidth:t,variant:n,className:r}){return l.jsx("path",{strokeWidth:t,d:`M${e[0]/2} 0 V${e[1]} M0 ${e[1]/2} H${e[0]}`,className:jn(["react-flow__background-pattern",n,r])})}function hue({radius:e,className:t}){return l.jsx("circle",{cx:e,cy:e,r:e,className:jn(["react-flow__background-pattern","dots",t])})}var Da;(function(e){e.Lines="lines",e.Dots="dots",e.Cross="cross"})(Da||(Da={}));const pue={[Da.Dots]:1,[Da.Lines]:1,[Da.Cross]:6},mue=e=>({transform:e.transform,patternId:`pattern-${e.rfId}`});function i4({id:e,variant:t=Da.Dots,gap:n=20,size:r,lineWidth:s=1,offset:i=0,color:a,bgColor:o,style:c,className:u,patternClassName:d}){const f=w.useRef(null),{transform:h,patternId:p}=xt(mue,sn),m=r||pue[t],y=t===Da.Dots,E=t===Da.Cross,g=Array.isArray(n)?n:[n,n],x=[g[0]*h[2]||1,g[1]*h[2]||1],b=m*h[2],_=Array.isArray(i)?i:[i,i],k=E?[b,b]:x,N=[_[0]*h[2]||1+k[0]/2,_[1]*h[2]||1+k[1]/2],C=`${p}${e||""}`;return l.jsxs("svg",{className:jn(["react-flow__background",u]),style:{...c,...l0,"--xy-background-color-props":o,"--xy-background-pattern-color-props":a},ref:f,"data-testid":"rf__background",children:[l.jsx("pattern",{id:C,x:h[0]%x[0],y:h[1]%x[1],width:x[0],height:x[1],patternUnits:"userSpaceOnUse",patternTransform:`translate(-${N[0]},-${N[1]})`,children:y?l.jsx(hue,{radius:b/2,className:d}):l.jsx(fue,{dimensions:k,lineWidth:s,variant:t,className:d})}),l.jsx("rect",{x:"0",y:"0",width:"100%",height:"100%",fill:`url(#${C})`})]})}i4.displayName="Background";const a4=w.memo(i4);function gue(){return l.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 32 32",children:l.jsx("path",{d:"M32 18.133H18.133V32h-4.266V18.133H0v-4.266h13.867V0h4.266v13.867H32z"})})}function yue(){return l.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 32 5",children:l.jsx("path",{d:"M0 0h32v4.2H0z"})})}function bue(){return l.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 32 30",children:l.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 Eue(){return l.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 25 32",children:l.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 xue(){return l.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 25 32",children:l.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 rp({children:e,className:t,...n}){return l.jsx("button",{type:"button",className:jn(["react-flow__controls-button",t]),...n,children:e})}const wue=e=>({isInteractive:e.nodesDraggable||e.nodesConnectable||e.elementsSelectable,minZoomReached:e.transform[2]<=e.minZoom,maxZoomReached:e.transform[2]>=e.maxZoom,ariaLabelConfig:e.ariaLabelConfig});function o4({style:e,showZoom:t=!0,showFitView:n=!0,showInteractive:r=!0,fitViewOptions:s,onZoomIn:i,onZoomOut:a,onFitView:o,onInteractiveChange:c,className:u,children:d,position:f="bottom-left",orientation:h="vertical","aria-label":p}){const m=an(),{isInteractive:y,minZoomReached:E,maxZoomReached:g,ariaLabelConfig:x}=xt(wue,sn),{zoomIn:b,zoomOut:_,fitView:k}=o0(),N=()=>{b(),i==null||i()},C=()=>{_(),a==null||a()},S=()=>{k(s),o==null||o()},A=()=>{m.setState({nodesDraggable:!y,nodesConnectable:!y,elementsSelectable:!y}),c==null||c(!y)},O=h==="horizontal"?"horizontal":"vertical";return l.jsxs(a0,{className:jn(["react-flow__controls",O,u]),position:f,style:e,"data-testid":"rf__controls","aria-label":p??x["controls.ariaLabel"],children:[t&&l.jsxs(l.Fragment,{children:[l.jsx(rp,{onClick:N,className:"react-flow__controls-zoomin",title:x["controls.zoomIn.ariaLabel"],"aria-label":x["controls.zoomIn.ariaLabel"],disabled:g,children:l.jsx(gue,{})}),l.jsx(rp,{onClick:C,className:"react-flow__controls-zoomout",title:x["controls.zoomOut.ariaLabel"],"aria-label":x["controls.zoomOut.ariaLabel"],disabled:E,children:l.jsx(yue,{})})]}),n&&l.jsx(rp,{className:"react-flow__controls-fitview",onClick:S,title:x["controls.fitView.ariaLabel"],"aria-label":x["controls.fitView.ariaLabel"],children:l.jsx(bue,{})}),r&&l.jsx(rp,{className:"react-flow__controls-interactive",onClick:A,title:x["controls.interactive.ariaLabel"],"aria-label":x["controls.interactive.ariaLabel"],children:y?l.jsx(xue,{}):l.jsx(Eue,{})}),d]})}o4.displayName="Controls";const l4=w.memo(o4);function vue({id:e,x:t,y:n,width:r,height:s,style:i,color:a,strokeColor:o,strokeWidth:c,className:u,borderRadius:d,shapeRendering:f,selected:h,onClick:p}){const{background:m,backgroundColor:y}=i||{},E=a||m||y;return l.jsx("rect",{className:jn(["react-flow__minimap-node",{selected:h},u]),x:t,y:n,rx:d,ry:d,width:r,height:s,style:{fill:E,stroke:o,strokeWidth:c},shapeRendering:f,onClick:p?g=>p(g,e):void 0})}const _ue=w.memo(vue),kue=e=>e.nodes.map(t=>t.id),eb=e=>e instanceof Function?e:()=>e;function Nue({nodeStrokeColor:e,nodeColor:t,nodeClassName:n="",nodeBorderRadius:r=5,nodeStrokeWidth:s,nodeComponent:i=_ue,onClick:a}){const o=xt(kue,sn),c=eb(t),u=eb(e),d=eb(n),f=typeof window>"u"||window.chrome?"crispEdges":"geometricPrecision";return l.jsx(l.Fragment,{children:o.map(h=>l.jsx(Tue,{id:h,nodeColorFunc:c,nodeStrokeColorFunc:u,nodeClassNameFunc:d,nodeBorderRadius:r,nodeStrokeWidth:s,NodeComponent:i,onClick:a,shapeRendering:f},h))})}function Sue({id:e,nodeColorFunc:t,nodeStrokeColorFunc:n,nodeClassNameFunc:r,nodeBorderRadius:s,nodeStrokeWidth:i,shapeRendering:a,NodeComponent:o,onClick:c}){const{node:u,x:d,y:f,width:h,height:p}=xt(m=>{const y=m.nodeLookup.get(e);if(!y)return{node:void 0,x:0,y:0,width:0,height:0};const E=y.internals.userNode,{x:g,y:x}=y.internals.positionAbsolute,{width:b,height:_}=aa(E);return{node:E,x:g,y:x,width:b,height:_}},sn);return!u||u.hidden||!Rv(u)?null:l.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:c,id:u.id})}const Tue=w.memo(Sue);var Aue=w.memo(Nue);const Cue=200,Iue=150,Oue=e=>!e.hidden,Rue=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?ZD($f(e.nodeLookup,{filter:Oue}),t):t,rfId:e.rfId,panZoom:e.panZoom,translateExtent:e.translateExtent,flowWidth:e.width,flowHeight:e.height,ariaLabelConfig:e.ariaLabelConfig}},Lue="react-flow__minimap-desc";function c4({style:e,className:t,nodeStrokeColor:n,nodeColor:r,nodeClassName:s="",nodeBorderRadius:i=5,nodeStrokeWidth:a,nodeComponent:o,bgColor:c,maskColor:u,maskStrokeColor:d,maskStrokeWidth:f,position:h="bottom-right",onClick:p,onNodeClick:m,pannable:y=!1,zoomable:E=!1,ariaLabel:g,inversePan:x,zoomStep:b=1,offsetScale:_=5}){const k=an(),N=w.useRef(null),{boundingRect:C,viewBB:S,rfId:A,panZoom:O,translateExtent:D,flowWidth:F,flowHeight:X,ariaLabelConfig:L}=xt(Rue,sn),j=(e==null?void 0:e.width)??Cue,T=(e==null?void 0:e.height)??Iue,R=C.width/j,M=C.height/T,B=Math.max(R,M),I=B*j,V=B*T,G=_*B,P=C.x-(I-C.width)/2-G,ie=C.y-(V-C.height)/2-G,q=I+G*2,ne=V+G*2,oe=`${Lue}-${A}`,ee=w.useRef(0),ce=w.useRef();ee.current=B,w.useEffect(()=>{if(N.current&&O)return ce.current=joe({domNode:N.current,panZoom:O,getTransform:()=>k.getState().transform,getViewScale:()=>ee.current}),()=>{var J;(J=ce.current)==null||J.destroy()}},[O]),w.useEffect(()=>{var J;(J=ce.current)==null||J.update({translateExtent:D,width:F,height:X,inversePan:x,pannable:y,zoomStep:b,zoomable:E})},[y,E,x,b,D,F,X]);const re=p?J=>{var Te;const[fe,Ee]=((Te=ce.current)==null?void 0:Te.pointer(J))||[0,0];p(J,{x:fe,y:Ee})}:void 0,pe=m?w.useCallback((J,fe)=>{const Ee=k.getState().nodeLookup.get(fe).internals.userNode;m(J,Ee)},[]):void 0,ye=g??L["minimap.ariaLabel"];return l.jsx(a0,{position:h,style:{...e,"--xy-minimap-background-color-props":typeof c=="string"?c: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*B: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:jn(["react-flow__minimap",t]),"data-testid":"rf__minimap",children:l.jsxs("svg",{width:j,height:T,viewBox:`${P} ${ie} ${q} ${ne}`,className:"react-flow__minimap-svg",role:"img","aria-labelledby":oe,ref:N,onClick:re,children:[ye&&l.jsx("title",{id:oe,children:ye}),l.jsx(Aue,{onClick:pe,nodeColor:r,nodeStrokeColor:n,nodeBorderRadius:i,nodeClassName:s,nodeStrokeWidth:a,nodeComponent:o}),l.jsx("path",{className:"react-flow__minimap-mask",d:`M${P-G},${ie-G}h${q+G*2}v${ne+G*2}h${-q-G*2}z + M${S.x},${S.y}h${S.width}v${S.height}h${-S.width}z`,fillRule:"evenodd",pointerEvents:"none"})]})})}c4.displayName="MiniMap";const Mue=w.memo(c4),jue=e=>t=>e?`${Math.max(1/t.transform[2],1)}`:void 0,Due={[Pc.Line]:"right",[Pc.Handle]:"bottom-right"};function Pue({nodeId:e,position:t,variant:n=Pc.Handle,className:r,style:s=void 0,children:i,color:a,minWidth:o=10,minHeight:c=10,maxWidth:u=Number.MAX_VALUE,maxHeight:d=Number.MAX_VALUE,keepAspectRatio:f=!1,resizeDirection:h,autoScale:p=!0,shouldResize:m,onResizeStart:y,onResize:E,onResizeEnd:g}){const x=DP(),b=typeof e=="string"?e:x,_=an(),k=w.useRef(null),N=n===Pc.Handle,C=xt(w.useCallback(jue(N&&p),[N,p]),sn),S=w.useRef(null),A=t??Due[n];w.useEffect(()=>{if(!(!k.current||!b))return S.current||(S.current=Woe({domNode:k.current,nodeId:b,getStoreItems:()=>{const{nodeLookup:D,transform:F,snapGrid:X,snapToGrid:L,nodeOrigin:j,domNode:T}=_.getState();return{nodeLookup:D,transform:F,snapGrid:X,snapToGrid:L,nodeOrigin:j,paneDomNode:T}},onChange:(D,F)=>{const{triggerNodeChanges:X,nodeLookup:L,parentLookup:j,nodeOrigin:T}=_.getState(),R=[],M={x:D.x,y:D.y},B=L.get(b);if(B&&B.expandParent&&B.parentId){const I=B.origin??T,V=D.width??B.measured.width??0,G=D.height??B.measured.height??0,P={id:B.id,parentId:B.parentId,rect:{width:V,height:G,...eP({x:D.x??B.position.x,y:D.y??B.position.y},{width:V,height:G},B.parentId,L,I)}},ie=Bv([P],L,j,T);R.push(...ie),M.x=D.x?Math.max(I[0]*V,D.x):void 0,M.y=D.y?Math.max(I[1]*G,D.y):void 0}if(M.x!==void 0&&M.y!==void 0){const I={id:b,type:"position",position:{...M}};R.push(I)}if(D.width!==void 0&&D.height!==void 0){const V={id:b,type:"dimensions",resizing:!0,setAttributes:h?h==="horizontal"?"width":"height":!0,dimensions:{width:D.width,height:D.height}};R.push(V)}for(const I of F){const V={...I,type:"position"};R.push(V)}X(R)},onEnd:({width:D,height:F})=>{const X={id:b,type:"dimensions",resizing:!1,dimensions:{width:D,height:F}};_.getState().triggerNodeChanges([X])}})),S.current.update({controlPosition:A,boundaries:{minWidth:o,minHeight:c,maxWidth:u,maxHeight:d},keepAspectRatio:f,resizeDirection:h,onResizeStart:y,onResize:E,onResizeEnd:g,shouldResize:m}),()=>{var D;(D=S.current)==null||D.destroy()}},[A,o,c,u,d,f,y,E,g,m]);const O=A.split("-");return l.jsx("div",{className:jn(["react-flow__resize-control","nodrag",...O,n,r]),ref:k,style:{...s,scale:C,...a&&{[N?"backgroundColor":"borderColor"]:a}},children:i})}w.memo(Pue);var u4=Object.defineProperty,Bue=(e,t,n)=>t in e?u4(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,Fue=(e,t)=>{for(var n in t)u4(e,n,{get:t[n],enumerable:!0})},Uue=(e,t,n)=>Bue(e,t+"",n),d4={};Fue(d4,{Graph:()=>As,alg:()=>$v,json:()=>h4,version:()=>zue});var $ue=Object.defineProperty,f4=(e,t)=>{for(var n in t)$ue(e,n,{get:t[n],enumerable:!0})},As=class{constructor(e){this._isDirected=!0,this._isMultigraph=!1,this._isCompound=!1,this._nodes={},this._in={},this._preds={},this._out={},this._sucs={},this._edgeObjs={},this._edgeLabels={},this._nodeCount=0,this._edgeCount=0,this._defaultNodeLabelFn=()=>{},this._defaultEdgeLabelFn=()=>{},e&&(this._isDirected="directed"in e?e.directed:!0,this._isMultigraph="multigraph"in e?e.multigraph:!1,this._isCompound="compound"in e?e.compound:!1),this._isCompound&&(this._parent={},this._children={},this._children["\0"]={})}isDirected(){return this._isDirected}isMultigraph(){return this._isMultigraph}isCompound(){return this._isCompound}setGraph(e){return this._label=e,this}graph(){return this._label}setDefaultNodeLabel(e){return typeof e!="function"?this._defaultNodeLabelFn=()=>e:this._defaultNodeLabelFn=e,this}nodeCount(){return this._nodeCount}nodes(){return Object.keys(this._nodes)}sources(){return this.nodes().filter(e=>Object.keys(this._in[e]).length===0)}sinks(){return this.nodes().filter(e=>Object.keys(this._out[e]).length===0)}setNodes(e,t){return e.forEach(n=>{t!==void 0?this.setNode(n,t):this.setNode(n)}),this}setNode(e,t){return e in this._nodes?(arguments.length>1&&(this._nodes[e]=t),this):(this._nodes[e]=arguments.length>1?t:this._defaultNodeLabelFn(e),this._isCompound&&(this._parent[e]="\0",this._children[e]={},this._children["\0"][e]=!0),this._in[e]={},this._preds[e]={},this._out[e]={},this._sucs[e]={},++this._nodeCount,this)}node(e){return this._nodes[e]}hasNode(e){return e in this._nodes}removeNode(e){if(e in this._nodes){let t=n=>this.removeEdge(this._edgeObjs[n]);delete this._nodes[e],this._isCompound&&(this._removeFromParentsChildList(e),delete this._parent[e],this.children(e).forEach(n=>{this.setParent(n)}),delete this._children[e]),Object.keys(this._in[e]).forEach(t),delete this._in[e],delete this._preds[e],Object.keys(this._out[e]).forEach(t),delete this._out[e],delete this._sucs[e],--this._nodeCount}return this}setParent(e,t){if(!this._isCompound)throw new Error("Cannot set parent in a non-compound graph");if(t===void 0)t="\0";else{t+="";for(let n=t;n!==void 0;n=this.parent(n))if(n===e)throw new Error("Setting "+t+" as parent of "+e+" would create a cycle");this.setNode(t)}return this.setNode(e),this._removeFromParentsChildList(e),this._parent[e]=t,this._children[t][e]=!0,this}parent(e){if(this._isCompound){let t=this._parent[e];if(t!=="\0")return t}}children(e="\0"){if(this._isCompound){let t=this._children[e];if(t)return Object.keys(t)}else{if(e==="\0")return this.nodes();if(this.hasNode(e))return[]}return[]}predecessors(e){let t=this._preds[e];if(t)return Object.keys(t)}successors(e){let t=this._sucs[e];if(t)return Object.keys(t)}neighbors(e){let t=this.predecessors(e);if(t){let n=new Set(t);for(let r of this.successors(e))n.add(r);return Array.from(n.values())}}isLeaf(e){let t;return this.isDirected()?t=this.successors(e):t=this.neighbors(e),t.length===0}filterNodes(e){let t=new this.constructor({directed:this._isDirected,multigraph:this._isMultigraph,compound:this._isCompound});t.setGraph(this.graph()),Object.entries(this._nodes).forEach(([s,i])=>{e(s)&&t.setNode(s,i)}),Object.values(this._edgeObjs).forEach(s=>{t.hasNode(s.v)&&t.hasNode(s.w)&&t.setEdge(s,this.edge(s))});let n={},r=s=>{let i=this.parent(s);return!i||t.hasNode(i)?(n[s]=i??void 0,i??void 0):i in n?n[i]:r(i)};return this._isCompound&&t.nodes().forEach(s=>t.setParent(s,r(s))),t}setDefaultEdgeLabel(e){return typeof e!="function"?this._defaultEdgeLabelFn=()=>e:this._defaultEdgeLabelFn=e,this}edgeCount(){return this._edgeCount}edges(){return Object.values(this._edgeObjs)}setPath(e,t){return e.reduce((n,r)=>(t!==void 0?this.setEdge(n,r,t):this.setEdge(n,r),r)),this}setEdge(e,t,n,r){let s,i,a,o,c=!1;typeof e=="object"&&e!==null&&"v"in e?(s=e.v,i=e.w,a=e.name,arguments.length===2&&(o=t,c=!0)):(s=e,i=t,a=r,arguments.length>2&&(o=n,c=!0)),s=""+s,i=""+i,a!==void 0&&(a=""+a);let u=Yu(this._isDirected,s,i,a);if(u in this._edgeLabels)return c&&(this._edgeLabels[u]=o),this;if(a!==void 0&&!this._isMultigraph)throw new Error("Cannot set a named edge when isMultigraph = false");this.setNode(s),this.setNode(i),this._edgeLabels[u]=c?o:this._defaultEdgeLabelFn(s,i,a);let d=Hue(this._isDirected,s,i,a);return s=d.v,i=d.w,Object.freeze(d),this._edgeObjs[u]=d,yA(this._preds[i],s),yA(this._sucs[s],i),this._in[i][u]=d,this._out[s][u]=d,this._edgeCount++,this}edge(e,t,n){let r=arguments.length===1?tb(this._isDirected,e):Yu(this._isDirected,e,t,n);return this._edgeLabels[r]}edgeAsObj(e,t,n){let r=arguments.length===1?this.edge(e):this.edge(e,t,n);return typeof r!="object"?{label:r}:r}hasEdge(e,t,n){return(arguments.length===1?tb(this._isDirected,e):Yu(this._isDirected,e,t,n))in this._edgeLabels}removeEdge(e,t,n){let r=arguments.length===1?tb(this._isDirected,e):Yu(this._isDirected,e,t,n),s=this._edgeObjs[r];if(s){let i=s.v,a=s.w;delete this._edgeLabels[r],delete this._edgeObjs[r],bA(this._preds[a],i),bA(this._sucs[i],a),delete this._in[a][r],delete this._out[i][r],this._edgeCount--}return this}inEdges(e,t){return this.isDirected()?this.filterEdges(this._in[e],e,t):this.nodeEdges(e,t)}outEdges(e,t){return this.isDirected()?this.filterEdges(this._out[e],e,t):this.nodeEdges(e,t)}nodeEdges(e,t){if(e in this._nodes)return this.filterEdges({...this._in[e],...this._out[e]},e,t)}_removeFromParentsChildList(e){delete this._children[this._parent[e]][e]}filterEdges(e,t,n){if(!e)return;let r=Object.values(e);return n?r.filter(s=>s.v===t&&s.w===n||s.v===n&&s.w===t):r}};function yA(e,t){e[t]?e[t]++:e[t]=1}function bA(e,t){e[t]!==void 0&&!--e[t]&&delete e[t]}function Yu(e,t,n,r){let s=""+t,i=""+n;if(!e&&s>i){let a=s;s=i,i=a}return s+""+i+""+(r===void 0?"\0":r)}function Hue(e,t,n,r){let s=""+t,i=""+n;if(!e&&s>i){let o=s;s=i,i=o}let a={v:s,w:i};return r&&(a.name=r),a}function tb(e,t){return Yu(e,t.v,t.w,t.name)}var zue="4.0.1",h4={};f4(h4,{read:()=>Gue,write:()=>Vue});function Vue(e){let t={options:{directed:e.isDirected(),multigraph:e.isMultigraph(),compound:e.isCompound()},nodes:Kue(e),edges:Yue(e)},n=e.graph();return n!==void 0&&(t.value=structuredClone(n)),t}function Kue(e){return e.nodes().map(t=>{let n=e.node(t),r=e.parent(t),s={v:t};return n!==void 0&&(s.value=n),r!==void 0&&(s.parent=r),s})}function Yue(e){return e.edges().map(t=>{let n=e.edge(t),r={v:t.v,w:t.w};return t.name!==void 0&&(r.name=t.name),n!==void 0&&(r.value=n),r})}function Gue(e){let t=new As(e.options);return e.value!==void 0&&t.setGraph(e.value),e.nodes.forEach(n=>{t.setNode(n.v,n.value),n.parent&&t.setParent(n.v,n.parent)}),e.edges.forEach(n=>{t.setEdge({v:n.v,w:n.w,name:n.name},n.value)}),t}var $v={};f4($v,{CycleException:()=>Qm,bellmanFord:()=>p4,components:()=>Xue,dijkstra:()=>Xm,dijkstraAll:()=>Jue,findCycles:()=>ede,floydWarshall:()=>nde,isAcyclic:()=>sde,postorder:()=>ade,preorder:()=>ode,prim:()=>lde,shortestPaths:()=>cde,tarjan:()=>g4,topsort:()=>y4});var Wue=()=>1;function p4(e,t,n,r){return que(e,String(t),n||Wue,r||function(s){return e.outEdges(s)})}function que(e,t,n,r){let s={},i,a=0,o=e.nodes(),c=function(f){let h=n(f);s[f.v].distance+he.key)}has(e){return e in this._keyIndices}priority(e){let t=this._keyIndices[e];if(t!==void 0)return this._arr[t].priority}min(){if(this.size()===0)throw new Error("Queue underflow");return this._arr[0].key}add(e,t){let n=this._keyIndices,r=String(e);if(!(r in n)){let s=this._arr,i=s.length;return n[r]=i,s.push({key:r,priority:t}),this._decrease(i),!0}return!1}removeMin(){this._swap(0,this._arr.length-1);let e=this._arr.pop();return delete this._keyIndices[e.key],this._heapify(0),e.key}decrease(e,t){let n=this._keyIndices[e];if(n===void 0)throw new Error(`Key not found: ${e}`);let r=this._arr[n].priority;if(t>r)throw new Error(`New priority is greater than current priority. Key: ${e} Old: ${r} New: ${t}`);this._arr[n].priority=t,this._decrease(n)}_heapify(e){let t=this._arr,n=2*e,r=n+1,s=e;n>1,!(t[r].priority1;function Xm(e,t,n,r){let s=function(i){return e.outEdges(i)};return Zue(e,String(t),n||Que,r||s)}function Zue(e,t,n,r){let s={},i=new m4,a,o,c=function(u){let d=u.v!==a?u.v:u.w,f=s[d],h=n(u),p=o.distance+h;if(h<0)throw new Error("dijkstra does not allow negative edge weights. Bad edge: "+u+" Weight: "+h);p0&&(a=i.removeMin(),o=s[a],o.distance!==Number.POSITIVE_INFINITY);)r(a).forEach(c);return s}function Jue(e,t,n){return e.nodes().reduce(function(r,s){return r[s]=Xm(e,s,t,n),r},{})}function g4(e){let t=0,n=[],r={},s=[];function i(a){let o=r[a]={onStack:!0,lowlink:t,index:t++};if(n.push(a),e.successors(a).forEach(function(c){c in r?r[c].onStack&&(o.lowlink=Math.min(o.lowlink,r[c].index)):(i(c),o.lowlink=Math.min(o.lowlink,r[c].lowlink))}),o.lowlink===o.index){let c=[],u;do u=n.pop(),r[u].onStack=!1,c.push(u);while(a!==u);s.push(c)}}return e.nodes().forEach(function(a){a in r||i(a)}),s}function ede(e){return g4(e).filter(function(t){return t.length>1||t.length===1&&e.hasEdge(t[0],t[0])})}var tde=()=>1;function nde(e,t,n){return rde(e,t||tde,n||function(r){return e.outEdges(r)})}function rde(e,t,n){let r={},s=e.nodes();return s.forEach(function(i){r[i]={},r[i][i]={distance:0,predecessor:""},s.forEach(function(a){i!==a&&(r[i][a]={distance:Number.POSITIVE_INFINITY,predecessor:""})}),n(i).forEach(function(a){let o=a.v===i?a.w:a.v,c=t(a);r[i][o]={distance:c,predecessor:i}})}),s.forEach(function(i){let a=r[i];s.forEach(function(o){let c=r[o];s.forEach(function(u){let d=c[i],f=a[u],h=c[u],p=d.distance+f.distance;p{var c;return(c=e.isDirected()?e.successors(o):e.neighbors(o))!=null?c:[]},a={};return t.forEach(function(o){if(!e.hasNode(o))throw new Error("Graph does not have node: "+o);s=b4(e,o,n==="post",a,i,r,s)}),s}function b4(e,t,n,r,s,i,a){return t in r||(r[t]=!0,n||(a=i(a,t)),s(t).forEach(function(o){a=b4(e,o,n,r,s,i,a)}),n&&(a=i(a,t))),a}function E4(e,t,n){return ide(e,t,n,function(r,s){return r.push(s),r},[])}function ade(e,t){return E4(e,t,"post")}function ode(e,t){return E4(e,t,"pre")}function lde(e,t){let n=new As,r={},s=new m4,i;function a(c){let u=c.v===i?c.w:c.v,d=s.priority(u);if(d!==void 0){let f=t(c);f0;){if(i=s.removeMin(),i in r)n.setEdge(i,r[i]);else{if(o)throw new Error("Input graph is not connected: "+e);o=!0}e.nodeEdges(i).forEach(a)}return n}function cde(e,t,n,r){return ude(e,t,n,r??(s=>{let i=e.outEdges(s);return i??[]}))}function ude(e,t,n,r){if(n===void 0)return Xm(e,t,n,r);let s=!1,i=e.nodes();for(let a=0;at.setNode(n,e.node(n))),e.edges().forEach(n=>{let r=t.edge(n.v,n.w)||{weight:0,minlen:1},s=e.edge(n);t.setEdge(n.v,n.w,{weight:r.weight+s.weight,minlen:Math.max(r.minlen,s.minlen)})}),t}function x4(e){let t=new As({multigraph:e.isMultigraph()}).setGraph(e.graph());return e.nodes().forEach(n=>{e.children(n).length||t.setNode(n,e.node(n))}),e.edges().forEach(n=>{t.setEdge(n,e.edge(n))}),t}function EA(e,t){let n=e.x,r=e.y,s=t.x-n,i=t.y-r,a=e.width/2,o=e.height/2;if(!s&&!i)throw new Error("Not possible to find intersection inside of the rectangle");let c,u;return Math.abs(i)*a>Math.abs(s)*o?(i<0&&(o=-o),c=o*s/i,u=o):(s<0&&(a=-a),c=a,u=a*i/s),{x:n+c,y:r+u}}function Vf(e){let t=pf(v4(e)+1).map(()=>[]);return e.nodes().forEach(n=>{let r=e.node(n),s=r.rank;s!==void 0&&(t[s]||(t[s]=[]),t[s][r.order]=n)}),t}function fde(e){let t=e.nodes().map(r=>{let s=e.node(r).rank;return s===void 0?Number.MAX_VALUE:s}),n=mi(Math.min,t);e.nodes().forEach(r=>{let s=e.node(r);Object.hasOwn(s,"rank")&&(s.rank-=n)})}function hde(e){let t=e.nodes().map(a=>e.node(a).rank).filter(a=>a!==void 0),n=mi(Math.min,t),r=[];e.nodes().forEach(a=>{let o=e.node(a).rank-n;r[o]||(r[o]=[]),r[o].push(a)});let s=0,i=e.graph().nodeRankFactor;Array.from(r).forEach((a,o)=>{a===void 0&&o%i!==0?--s:a!==void 0&&s&&a.forEach(c=>e.node(c).rank+=s)})}function xA(e,t,n,r){let s={width:0,height:0};return arguments.length>=4&&(s.rank=n,s.order=r),tu(e,"border",s,t)}function pde(e,t=w4){let n=[];for(let r=0;rw4){let n=pde(t);return e(...n.map(r=>e(...r)))}else return e(...t)}function v4(e){let t=e.nodes().map(n=>{let r=e.node(n).rank;return r===void 0?Number.MIN_VALUE:r});return mi(Math.max,t)}function mde(e,t){let n={lhs:[],rhs:[]};return e.forEach(r=>{t(r)?n.lhs.push(r):n.rhs.push(r)}),n}function _4(e,t){let n=Date.now();try{return t()}finally{console.log(e+" time: "+(Date.now()-n)+"ms")}}function k4(e,t){return t()}var gde=0;function Hv(e){let t=++gde;return e+(""+t)}function pf(e,t,n=1){t==null&&(t=e,e=0);let r=i=>itr[t]:n=t,Object.entries(e).reduce((r,[s,i])=>(r[s]=n(i,s),r),{})}function yde(e,t){return e.reduce((n,r,s)=>(n[r]=t[s],n),{})}var u0="\0",bde="3.0.0",Ede=class{constructor(){Uue(this,"_sentinel");let e={};e._next=e._prev=e,this._sentinel=e}dequeue(){let e=this._sentinel,t=e._prev;if(t!==e)return wA(t),t}enqueue(e){let t=this._sentinel;e._prev&&e._next&&wA(e),e._next=t._next,t._next._prev=e,t._next=e,e._prev=t}toString(){let e=[],t=this._sentinel,n=t._prev;for(;n!==t;)e.push(JSON.stringify(n,xde)),n=n._prev;return"["+e.join(", ")+"]"}};function wA(e){e._prev._next=e._next,e._next._prev=e._prev,delete e._next,delete e._prev}function xde(e,t){if(e!=="_next"&&e!=="_prev")return t}var wde=Ede,vde=()=>1;function _de(e,t){if(e.nodeCount()<=1)return[];let n=Nde(e,t||vde);return kde(n.graph,n.buckets,n.zeroIdx).flatMap(r=>e.outEdges(r.v,r.w)||[])}function kde(e,t,n){var r;let s=[],i=t[t.length-1],a=t[0],o;for(;e.nodeCount();){for(;o=a.dequeue();)nb(e,t,n,o);for(;o=i.dequeue();)nb(e,t,n,o);if(e.nodeCount()){for(let c=t.length-2;c>0;--c)if(o=(r=t[c])==null?void 0:r.dequeue(),o){s=s.concat(nb(e,t,n,o,!0)||[]);break}}}return s}function nb(e,t,n,r,s){let i=[],a=s?i:void 0;return(e.inEdges(r.v)||[]).forEach(o=>{let c=e.edge(o),u=e.node(o.v);s&&i.push({v:o.v,w:o.w}),u.out-=c,PE(t,n,u)}),(e.outEdges(r.v)||[]).forEach(o=>{let c=e.edge(o),u=o.w,d=e.node(u);d.in-=c,PE(t,n,d)}),e.removeNode(r.v),a}function Nde(e,t){let n=new As,r=0,s=0;e.nodes().forEach(o=>{n.setNode(o,{v:o,in:0,out:0})}),e.edges().forEach(o=>{let c=n.edge(o.v,o.w)||0,u=t(o),d=c+u;n.setEdge(o.v,o.w,d);let f=n.node(o.v),h=n.node(o.w);s=Math.max(s,f.out+=u),r=Math.max(r,h.in+=u)});let i=Sde(s+r+3).map(()=>new wde),a=r+1;return n.nodes().forEach(o=>{PE(i,a,n.node(o))}),{graph:n,buckets:i,zeroIdx:a}}function PE(e,t,n){var r,s,i;n.out?n.in?(i=e[n.out-n.in+t])==null||i.enqueue(n):(s=e[e.length-1])==null||s.enqueue(n):(r=e[0])==null||r.enqueue(n)}function Sde(e){let t=[];for(let n=0;n{let r=e.edge(n);e.removeEdge(n),r.forwardName=n.name,r.reversed=!0,e.setEdge(n.w,n.v,r,Hv("rev"))});function t(n){return r=>n.edge(r).weight}}function Ade(e){let t=[],n={},r={};function s(i){Object.hasOwn(r,i)||(r[i]=!0,n[i]=!0,e.outEdges(i).forEach(a=>{Object.hasOwn(n,a.w)?t.push(a):s(a.w)}),delete n[i])}return e.nodes().forEach(s),t}function Cde(e){e.edges().forEach(t=>{let n=e.edge(t);if(n.reversed){e.removeEdge(t);let r=n.forwardName;delete n.reversed,delete n.forwardName,e.setEdge(t.w,t.v,n,r)}})}function Ide(e){e.graph().dummyChains=[],e.edges().forEach(t=>Ode(e,t))}function Ode(e,t){let n=t.v,r=e.node(n).rank,s=t.w,i=e.node(s).rank,a=t.name,o=e.edge(t),c=o.labelRank;if(i===r+1)return;e.removeEdge(t);let u,d,f;for(f=0,++r;r{let n=e.node(t),r=n.edgeLabel,s;for(e.setEdge(n.edgeObj,r);n.dummy;)s=e.successors(t)[0],e.removeNode(t),r.points.push({x:n.x,y:n.y}),n.dummy==="edge-label"&&(r.x=n.x,r.y=n.y,r.width=n.width,r.height=n.height),t=s,n=e.node(t)})}function zv(e){let t={};function n(r){let s=e.node(r);if(Object.hasOwn(t,r))return s.rank;t[r]=!0;let i=e.outEdges(r),a=i?i.map(c=>c==null?Number.POSITIVE_INFINITY:n(c.w)-e.edge(c).minlen):[],o=mi(Math.min,a);return o===Number.POSITIVE_INFINITY&&(o=0),s.rank=o}e.sources().forEach(n)}function Fc(e,t){return e.node(t.w).rank-e.node(t.v).rank-e.edge(t).minlen}var N4=Lde;function Lde(e){let t=new As({directed:!1}),n=e.nodes();if(n.length===0)throw new Error("Graph must have at least one node");let r=n[0],s=e.nodeCount();t.setNode(r,{});let i,a;for(;Mde(t,e){let a=i.v,o=r===a?i.w:a;!e.hasNode(o)&&!Fc(t,i)&&(e.setNode(o,{}),e.setEdge(r,o,{}),n(o))})}return e.nodes().forEach(n),e.nodeCount()}function jde(e,t){return t.edges().reduce((n,r)=>{let s=Number.POSITIVE_INFINITY;return e.hasNode(r.v)!==e.hasNode(r.w)&&(s=Fc(t,r)),st.node(r).rank+=n)}var{preorder:Pde,postorder:Bde}=$v,Fde=qo;qo.initLowLimValues=Kv;qo.initCutValues=Vv;qo.calcCutValue=S4;qo.leaveEdge=A4;qo.enterEdge=C4;qo.exchangeEdges=I4;function qo(e){e=dde(e),zv(e);let t=N4(e);Kv(t),Vv(t,e);let n,r;for(;n=A4(t);)r=C4(t,e,n),I4(t,e,n,r)}function Vv(e,t){let n=Bde(e,e.nodes());n=n.slice(0,n.length-1),n.forEach(r=>Ude(e,t,r))}function Ude(e,t,n){let r=e.node(n).parent,s=e.edge(n,r);s.cutvalue=S4(e,t,n)}function S4(e,t,n){let r=e.node(n).parent,s=!0,i=t.edge(n,r),a=0;i||(s=!1,i=t.edge(r,n)),a=i.weight;let o=t.nodeEdges(n);return o&&o.forEach(c=>{let u=c.v===n,d=u?c.w:c.v;if(d!==r){let f=u===s,h=t.edge(c).weight;if(a+=f?h:-h,Hde(e,n,d)){let p=e.edge(n,d).cutvalue;a+=f?-p:p}}}),a}function Kv(e,t){arguments.length<2&&(t=e.nodes()[0]),T4(e,{},1,t)}function T4(e,t,n,r,s){let i=n,a=e.node(r);t[r]=!0;let o=e.neighbors(r);return o&&o.forEach(c=>{Object.hasOwn(t,c)||(n=T4(e,t,n,c,r))}),a.low=i,a.lim=n++,s?a.parent=s:delete a.parent,n}function A4(e){return e.edges().find(t=>e.edge(t).cutvalue<0)}function C4(e,t,n){let r=n.v,s=n.w;t.hasEdge(r,s)||(r=n.w,s=n.v);let i=e.node(r),a=e.node(s),o=i,c=!1;return i.lim>a.lim&&(o=a,c=!0),t.edges().filter(u=>c===vA(e,e.node(u.v),o)&&c!==vA(e,e.node(u.w),o)).reduce((u,d)=>Fc(t,d)!e.node(s).parent);if(!n)return;let r=Pde(e,[n]);r=r.slice(1),r.forEach(s=>{let i=e.node(s).parent,a=t.edge(s,i),o=!1;a||(a=t.edge(i,s),o=!0),t.node(s).rank=t.node(i).rank+(o?a.minlen:-a.minlen)})}function Hde(e,t,n){return e.hasEdge(t,n)}function vA(e,t,n){return n.low<=t.lim&&t.lim<=n.lim}var zde=Vde;function Vde(e){let t=e.graph().ranker;if(typeof t=="function")return t(e);switch(t){case"network-simplex":_A(e);break;case"tight-tree":Yde(e);break;case"longest-path":Kde(e);break;case"none":break;default:_A(e)}}var Kde=zv;function Yde(e){zv(e),N4(e)}function _A(e){Fde(e)}var Gde=Wde;function Wde(e){let t=Xde(e);e.graph().dummyChains.forEach(n=>{let r=e.node(n),s=r.edgeObj,i=qde(e,t,s.v,s.w),a=i.path,o=i.lca,c=0,u=a[c],d=!0;for(;n!==s.w;){if(r=e.node(n),d){for(;(u=a[c])!==o&&e.node(u).maxRanka||o>t[c].lim));let u=c,d=r;for(;(d=e.parent(d))!==u;)i.push(d);return{path:s.concat(i.reverse()),lca:u}}function Xde(e){let t={},n=0;function r(s){let i=n;e.children(s).forEach(r),t[s]={low:i,lim:n++}}return e.children(u0).forEach(r),t}function Qde(e){let t=tu(e,"root",{},"_root"),n=Zde(e),r=Object.values(n),s=mi(Math.max,r)-1,i=2*s+1;e.graph().nestingRoot=t,e.edges().forEach(o=>e.edge(o).minlen*=i);let a=Jde(e)+1;e.children(u0).forEach(o=>O4(e,t,i,a,s,n,o)),e.graph().nodeRankFactor=i}function O4(e,t,n,r,s,i,a){var o;let c=e.children(a);if(!c.length){a!==t&&e.setEdge(t,a,{weight:0,minlen:n});return}let u=xA(e,"_bt"),d=xA(e,"_bb"),f=e.node(a);e.setParent(u,a),f.borderTop=u,e.setParent(d,a),f.borderBottom=d,c.forEach(h=>{var p;O4(e,t,n,r,s,i,h);let m=e.node(h),y=m.borderTop?m.borderTop:h,E=m.borderBottom?m.borderBottom:h,g=m.borderTop?r:2*r,x=y!==E?1:s-((p=i[a])!=null?p:0)+1;e.setEdge(u,y,{weight:g,minlen:x,nestingEdge:!0}),e.setEdge(E,d,{weight:g,minlen:x,nestingEdge:!0})}),e.parent(a)||e.setEdge(t,u,{weight:0,minlen:s+((o=i[a])!=null?o:0)})}function Zde(e){let t={};function n(r,s){let i=e.children(r);i&&i.length&&i.forEach(a=>n(a,s+1)),t[r]=s}return e.children(u0).forEach(r=>n(r,1)),t}function Jde(e){return e.edges().reduce((t,n)=>t+e.edge(n).weight,0)}function efe(e){let t=e.graph();e.removeNode(t.nestingRoot),delete t.nestingRoot,e.edges().forEach(n=>{e.edge(n).nestingEdge&&e.removeEdge(n)})}var tfe=nfe;function nfe(e){function t(n){let r=e.children(n),s=e.node(n);if(r.length&&r.forEach(t),Object.hasOwn(s,"minRank")){s.borderLeft=[],s.borderRight=[];for(let i=s.minRank,a=s.maxRank+1;iNA(e.node(t))),e.edges().forEach(t=>NA(e.edge(t)))}function NA(e){let t=e.width;e.width=e.height,e.height=t}function ife(e){e.nodes().forEach(t=>rb(e.node(t))),e.edges().forEach(t=>{var n;let r=e.edge(t);(n=r.points)==null||n.forEach(rb),Object.hasOwn(r,"y")&&rb(r)})}function rb(e){e.y=-e.y}function afe(e){e.nodes().forEach(t=>sb(e.node(t))),e.edges().forEach(t=>{var n;let r=e.edge(t);(n=r.points)==null||n.forEach(sb),Object.hasOwn(r,"x")&&sb(r)})}function sb(e){let t=e.x;e.x=e.y,e.y=t}function ofe(e){let t={},n=e.nodes().filter(o=>!e.children(o).length),r=n.map(o=>e.node(o).rank),s=mi(Math.max,r),i=pf(s+1).map(()=>[]);function a(o){if(t[o])return;t[o]=!0;let c=e.node(o);i[c.rank].push(o);let u=e.successors(o);u&&u.forEach(a)}return n.sort((o,c)=>e.node(o).rank-e.node(c).rank).forEach(a),i}function lfe(e,t){let n=0;for(let r=1;rd)),s=t.flatMap(u=>{let d=e.outEdges(u);return d?d.map(f=>({pos:r[f.w],weight:e.edge(f).weight})).sort((f,h)=>f.pos-h.pos):[]}),i=1;for(;i{let d=u.pos+i;o[d]+=u.weight;let f=0;for(;d>0;)d%2&&(f+=o[d+1]),d=d-1>>1,o[d]+=u.weight;c+=u.weight*f}),c}function ufe(e,t=[]){return t.map(n=>{let r=e.inEdges(n);if(!r||!r.length)return{v:n};{let s=r.reduce((i,a)=>{let o=e.edge(a),c=e.node(a.v);return{sum:i.sum+o.weight*c.order,weight:i.weight+o.weight}},{sum:0,weight:0});return{v:n,barycenter:s.sum/s.weight,weight:s.weight}}})}function dfe(e,t){let n={};e.forEach((s,i)=>{let a={indegree:0,in:[],out:[],vs:[s.v],i};s.barycenter!==void 0&&(a.barycenter=s.barycenter,a.weight=s.weight),n[s.v]=a}),t.edges().forEach(s=>{let i=n[s.v],a=n[s.w];i!==void 0&&a!==void 0&&(a.indegree++,i.out.push(a))});let r=Object.values(n).filter(s=>!s.indegree);return ffe(r)}function ffe(e){let t=[];function n(s){return i=>{i.merged||(i.barycenter===void 0||s.barycenter===void 0||i.barycenter>=s.barycenter)&&hfe(s,i)}}function r(s){return i=>{i.in.push(s),--i.indegree===0&&e.push(i)}}for(;e.length;){let s=e.pop();t.push(s),s.in.reverse().forEach(n(s)),s.out.forEach(r(s))}return t.filter(s=>!s.merged).map(s=>Zm(s,["vs","i","barycenter","weight"]))}function hfe(e,t){let n=0,r=0;e.weight&&(n+=e.barycenter*e.weight,r+=e.weight),t.weight&&(n+=t.barycenter*t.weight,r+=t.weight),e.vs=t.vs.concat(e.vs),e.barycenter=n/r,e.weight=r,e.i=Math.min(t.i,e.i),t.merged=!0}function pfe(e,t){let n=mde(e,d=>Object.hasOwn(d,"barycenter")),r=n.lhs,s=n.rhs.sort((d,f)=>f.i-d.i),i=[],a=0,o=0,c=0;r.sort(mfe(!!t)),c=SA(i,s,c),r.forEach(d=>{c+=d.vs.length,i.push(d.vs),a+=d.barycenter*d.weight,o+=d.weight,c=SA(i,s,c)});let u={vs:i.flat(1)};return o&&(u.barycenter=a/o,u.weight=o),u}function SA(e,t,n){let r;for(;t.length&&(r=t[t.length-1]).i<=n;)t.pop(),e.push(r.vs),n++;return n}function mfe(e){return(t,n)=>t.barycentern.barycenter?1:e?n.i-t.i:t.i-n.i}function L4(e,t,n,r){let s=e.children(t),i=e.node(t),a=i?i.borderLeft:void 0,o=i?i.borderRight:void 0,c={};a&&(s=s.filter(h=>h!==a&&h!==o));let u=ufe(e,s);u.forEach(h=>{if(e.children(h.v).length){let p=L4(e,h.v,n,r);c[h.v]=p,Object.hasOwn(p,"barycenter")&&yfe(h,p)}});let d=dfe(u,n);gfe(d,c);let f=pfe(d,r);if(a&&o){f.vs=[a,f.vs,o].flat(1);let h=e.predecessors(a);if(h&&h.length){let p=e.node(h[0]),m=e.predecessors(o),y=e.node(m[0]);Object.hasOwn(f,"barycenter")||(f.barycenter=0,f.weight=0),f.barycenter=(f.barycenter*f.weight+p.order+y.order)/(f.weight+2),f.weight+=2}}return f}function gfe(e,t){e.forEach(n=>{n.vs=n.vs.flatMap(r=>t[r]?t[r].vs:r)})}function yfe(e,t){e.barycenter!==void 0?(e.barycenter=(e.barycenter*e.weight+t.barycenter*t.weight)/(e.weight+t.weight),e.weight+=t.weight):(e.barycenter=t.barycenter,e.weight=t.weight)}function bfe(e,t,n,r){r||(r=e.nodes());let s=Efe(e),i=new As({compound:!0}).setGraph({root:s}).setDefaultNodeLabel(a=>e.node(a));return r.forEach(a=>{let o=e.node(a),c=e.parent(a);if(o.rank===t||o.minRank<=t&&t<=o.maxRank){i.setNode(a),i.setParent(a,c||s);let u=e[n](a);u&&u.forEach(d=>{let f=d.v===a?d.w:d.v,h=i.edge(f,a),p=h!==void 0?h.weight:0;i.setEdge(f,a,{weight:e.edge(d).weight+p})}),Object.hasOwn(o,"minRank")&&i.setNode(a,{borderLeft:o.borderLeft[t],borderRight:o.borderRight[t]})}}),i}function Efe(e){let t;for(;e.hasNode(t=Hv("_root")););return t}function xfe(e,t,n){let r={},s;n.forEach(i=>{let a=e.parent(i),o,c;for(;a;){if(o=e.parent(a),o?(c=r[o],r[o]=a):(c=s,s=a),c&&c!==a){t.setEdge(c,a);return}a=o}})}function M4(e,t={}){if(typeof t.customOrder=="function"){t.customOrder(e,M4);return}let n=v4(e),r=TA(e,pf(1,n+1),"inEdges"),s=TA(e,pf(n-1,-1,-1),"outEdges"),i=ofe(e);if(AA(e,i),t.disableOptimalOrderHeuristic)return;let a=Number.POSITIVE_INFINITY,o,c=t.constraints||[];for(let u=0,d=0;d<4;++u,++d){wfe(u%2?r:s,u%4>=2,c),i=Vf(e);let f=lfe(e,i);f{r.has(i)||r.set(i,[]),r.get(i).push(a)};for(let i of e.nodes()){let a=e.node(i);if(typeof a.rank=="number"&&s(a.rank,i),typeof a.minRank=="number"&&typeof a.maxRank=="number")for(let o=a.minRank;o<=a.maxRank;o++)o!==a.rank&&s(o,i)}return t.map(function(i){return bfe(e,i,n,r.get(i)||[])})}function wfe(e,t,n){let r=new As;e.forEach(function(s){n.forEach(o=>r.setEdge(o.left,o.right));let i=s.graph().root,a=L4(s,i,r,t);a.vs.forEach((o,c)=>s.node(o).order=c),xfe(s,r,a.vs)})}function AA(e,t){Object.values(t).forEach(n=>n.forEach((r,s)=>e.node(r).order=s))}function vfe(e,t){let n={};function r(s,i){let a=0,o=0,c=s.length,u=i[i.length-1];return i.forEach((d,f)=>{let h=kfe(e,d),p=h?e.node(h).order:c;(h||d===u)&&(i.slice(o,f+1).forEach(m=>{let y=e.predecessors(m);y&&y.forEach(E=>{let g=e.node(E),x=g.order;(x{let f=i[d];if(f!==void 0&&e.node(f).dummy){let h=e.predecessors(f);h&&h.forEach(p=>{if(p===void 0)return;let m=e.node(p);m.dummy&&(m.orderu)&&j4(n,p,f)})}})}function s(i,a){let o=-1,c=-1,u=0;return a.forEach((d,f)=>{if(e.node(d).dummy==="border"){let h=e.predecessors(d);if(h&&h.length){let p=h[0];if(p===void 0)return;c=e.node(p).order,r(a,u,f,o,c),u=f,o=c}}r(a,u,a.length,c,i.length)}),a}return t.length&&t.reduce(s),n}function kfe(e,t){if(e.node(t).dummy){let n=e.predecessors(t);if(n)return n.find(r=>e.node(r).dummy)}}function j4(e,t,n){if(t>n){let s=t;t=n,n=s}let r=e[t];r||(e[t]=r={}),r[n]=!0}function Nfe(e,t,n){if(t>n){let s=t;t=n,n=s}let r=e[t];return r!==void 0&&Object.hasOwn(r,n)}function Sfe(e,t,n,r){let s={},i={},a={};return t.forEach(o=>{o.forEach((c,u)=>{s[c]=c,i[c]=c,a[c]=u})}),t.forEach(o=>{let c=-1;o.forEach(u=>{let d=r(u);if(d&&d.length){let f=d.sort((p,m)=>{let y=a[p],E=a[m];return(y!==void 0?y:0)-(E!==void 0?E:0)}),h=(f.length-1)/2;for(let p=Math.floor(h),m=Math.ceil(h);p<=m;++p){let y=f[p];if(y===void 0)continue;let E=a[y];if(E!==void 0&&i[u]===u&&c{var g;let x=(g=i[E.v])!=null?g:0,b=a.edge(E);return Math.max(y,x+(b!==void 0?b:0))},0):i[p]=0}function d(p){let m=a.outEdges(p),y=Number.POSITIVE_INFINITY;m&&(y=m.reduce((g,x)=>{let b=i[x.w],_=a.edge(x);return Math.min(g,(b!==void 0?b:0)-(_!==void 0?_:0))},Number.POSITIVE_INFINITY));let E=e.node(p);y!==Number.POSITIVE_INFINITY&&E.borderType!==o&&(i[p]=Math.max(i[p]!==void 0?i[p]:0,y))}function f(p){return a.predecessors(p)||[]}function h(p){return a.successors(p)||[]}return c(u,f),c(d,h),Object.keys(r).forEach(p=>{var m;let y=n[p];y!==void 0&&(i[p]=(m=i[y])!=null?m:0)}),i}function Afe(e,t,n,r){let s=new As,i=e.graph(),a=Lfe(i.nodesep,i.edgesep,r);return t.forEach(o=>{let c;o.forEach(u=>{let d=n[u];if(d!==void 0){if(s.setNode(d),c!==void 0){let f=n[c];if(f!==void 0){let h=s.edge(f,d);s.setEdge(f,d,Math.max(a(e,u,c),h||0))}}c=u}})}),s}function Cfe(e,t){return Object.values(t).reduce((n,r)=>{let s=Number.NEGATIVE_INFINITY,i=Number.POSITIVE_INFINITY;Object.entries(r).forEach(([o,c])=>{let u=Mfe(e,o)/2;s=Math.max(c+u,s),i=Math.min(c-u,i)});let a=s-i;return a{["l","r"].forEach(a=>{let o=i+a,c=e[o];if(!c||c===t)return;let u=Object.values(c),d=r-mi(Math.min,u);a!=="l"&&(d=s-mi(Math.max,u)),d&&(e[o]=c0(c,f=>f+d))})})}function Ofe(e,t=void 0){let n=e.ul;return n?c0(n,(r,s)=>{var i,a;if(t){let c=t.toLowerCase(),u=e[c];if(u&&u[s]!==void 0)return u[s]}let o=Object.values(e).map(c=>{let u=c[s];return u!==void 0?u:0}).sort((c,u)=>c-u);return(((i=o[1])!=null?i:0)+((a=o[2])!=null?a:0))/2}):{}}function Rfe(e){let t=Vf(e),n=Object.assign(vfe(e,t),_fe(e,t)),r={},s;["u","d"].forEach(a=>{s=a==="u"?t:Object.values(t).reverse(),["l","r"].forEach(o=>{o==="r"&&(s=s.map(d=>Object.values(d).reverse()));let c=Sfe(e,s,n,d=>(a==="u"?e.predecessors(d):e.successors(d))||[]),u=Tfe(e,s,c.root,c.align,o==="r");o==="r"&&(u=c0(u,d=>-d)),r[a+o]=u})});let i=Cfe(e,r);return Ife(r,i),Ofe(r,e.graph().align)}function Lfe(e,t,n){return(r,s,i)=>{let a=r.node(s),o=r.node(i),c=0,u;if(c+=a.width/2,Object.hasOwn(a,"labelpos"))switch(a.labelpos.toLowerCase()){case"l":u=-a.width/2;break;case"r":u=a.width/2;break}if(u&&(c+=n?u:-u),u=void 0,c+=(a.dummy?t:e)/2,c+=(o.dummy?t:e)/2,c+=o.width/2,Object.hasOwn(o,"labelpos"))switch(o.labelpos.toLowerCase()){case"l":u=o.width/2;break;case"r":u=-o.width/2;break}return u&&(c+=n?u:-u),c}}function Mfe(e,t){return e.node(t).width}function jfe(e){e=x4(e),Dfe(e),Object.entries(Rfe(e)).forEach(([t,n])=>e.node(t).x=n)}function Dfe(e){let t=Vf(e),n=e.graph(),r=n.ranksep,s=n.rankalign,i=0;t.forEach(a=>{let o=a.reduce((c,u)=>{var d;let f=(d=e.node(u).height)!=null?d:0;return c>f?c:f},0);a.forEach(c=>{let u=e.node(c);s==="top"?u.y=i+u.height/2:s==="bottom"?u.y=i+o-u.height/2:u.y=i+o/2}),i+=o+r})}function Pfe(e,t={}){let n=t.debugTiming?_4:k4;return n("layout",()=>{let r=n(" buildLayoutGraph",()=>Gfe(e));return n(" runLayout",()=>Bfe(r,n,t)),n(" updateInputGraph",()=>Ffe(e,r)),r})}function Bfe(e,t,n){t(" makeSpaceForEdgeLabels",()=>Wfe(e)),t(" removeSelfEdges",()=>rhe(e)),t(" acyclic",()=>Tde(e)),t(" nestingGraph.run",()=>Qde(e)),t(" rank",()=>zde(x4(e))),t(" injectEdgeLabelProxies",()=>qfe(e)),t(" removeEmptyRanks",()=>hde(e)),t(" nestingGraph.cleanup",()=>efe(e)),t(" normalizeRanks",()=>fde(e)),t(" assignRankMinMax",()=>Xfe(e)),t(" removeEdgeLabelProxies",()=>Qfe(e)),t(" normalize.run",()=>Ide(e)),t(" parentDummyChains",()=>Gde(e)),t(" addBorderSegments",()=>tfe(e)),t(" order",()=>M4(e,n)),t(" insertSelfEdges",()=>she(e)),t(" adjustCoordinateSystem",()=>rfe(e)),t(" position",()=>jfe(e)),t(" positionSelfEdges",()=>ihe(e)),t(" removeBorderNodes",()=>nhe(e)),t(" normalize.undo",()=>Rde(e)),t(" fixupEdgeLabelCoords",()=>ehe(e)),t(" undoCoordinateSystem",()=>sfe(e)),t(" translateGraph",()=>Zfe(e)),t(" assignNodeIntersects",()=>Jfe(e)),t(" reversePoints",()=>the(e)),t(" acyclic.undo",()=>Cde(e))}function Ffe(e,t){e.nodes().forEach(n=>{let r=e.node(n),s=t.node(n);r&&(r.x=s.x,r.y=s.y,r.order=s.order,r.rank=s.rank,t.children(n).length&&(r.width=s.width,r.height=s.height))}),e.edges().forEach(n=>{let r=e.edge(n),s=t.edge(n);r.points=s.points,Object.hasOwn(s,"x")&&(r.x=s.x,r.y=s.y)}),e.graph().width=t.graph().width,e.graph().height=t.graph().height}var Ufe=["nodesep","edgesep","ranksep","marginx","marginy"],$fe={ranksep:50,edgesep:20,nodesep:50,rankdir:"TB",rankalign:"center"},Hfe=["acyclicer","ranker","rankdir","align","rankalign"],zfe=["width","height","rank"],CA={width:0,height:0},Vfe=["minlen","weight","width","height","labeloffset"],Kfe={minlen:1,weight:1,width:0,height:0,labeloffset:10,labelpos:"r"},Yfe=["labelpos"];function Gfe(e){let t=new As({multigraph:!0,compound:!0}),n=ab(e.graph());return t.setGraph(Object.assign({},$fe,ib(n,Ufe),Zm(n,Hfe))),e.nodes().forEach(r=>{let s=ab(e.node(r)),i=ib(s,zfe);Object.keys(CA).forEach(o=>{i[o]===void 0&&(i[o]=CA[o])}),t.setNode(r,i);let a=e.parent(r);a!==void 0&&t.setParent(r,a)}),e.edges().forEach(r=>{let s=ab(e.edge(r));t.setEdge(r,Object.assign({},Kfe,ib(s,Vfe),Zm(s,Yfe)))}),t}function Wfe(e){let t=e.graph();t.ranksep/=2,e.edges().forEach(n=>{let r=e.edge(n);r.minlen*=2,r.labelpos.toLowerCase()!=="c"&&(t.rankdir==="TB"||t.rankdir==="BT"?r.width+=r.labeloffset:r.height+=r.labeloffset)})}function qfe(e){e.edges().forEach(t=>{let n=e.edge(t);if(n.width&&n.height){let r=e.node(t.v),s={rank:(e.node(t.w).rank-r.rank)/2+r.rank,e:t};tu(e,"edge-proxy",s,"_ep")}})}function Xfe(e){let t=0;e.nodes().forEach(n=>{let r=e.node(n);r.borderTop&&(r.minRank=e.node(r.borderTop).rank,r.maxRank=e.node(r.borderBottom).rank,t=Math.max(t,r.maxRank))}),e.graph().maxRank=t}function Qfe(e){e.nodes().forEach(t=>{let n=e.node(t);if(n.dummy==="edge-proxy"){let r=n;e.edge(r.e).labelRank=n.rank,e.removeNode(t)}})}function Zfe(e){let t=Number.POSITIVE_INFINITY,n=0,r=Number.POSITIVE_INFINITY,s=0,i=e.graph(),a=i.marginx||0,o=i.marginy||0;function c(u){let d=u.x,f=u.y,h=u.width,p=u.height;t=Math.min(t,d-h/2),n=Math.max(n,d+h/2),r=Math.min(r,f-p/2),s=Math.max(s,f+p/2)}e.nodes().forEach(u=>c(e.node(u))),e.edges().forEach(u=>{let d=e.edge(u);Object.hasOwn(d,"x")&&c(d)}),t-=a,r-=o,e.nodes().forEach(u=>{let d=e.node(u);d.x-=t,d.y-=r}),e.edges().forEach(u=>{let d=e.edge(u);d.points.forEach(f=>{f.x-=t,f.y-=r}),Object.hasOwn(d,"x")&&(d.x-=t),Object.hasOwn(d,"y")&&(d.y-=r)}),i.width=n-t+a,i.height=s-r+o}function Jfe(e){e.edges().forEach(t=>{let n=e.edge(t),r=e.node(t.v),s=e.node(t.w),i,a;n.points?(i=n.points[0],a=n.points[n.points.length-1]):(n.points=[],i=s,a=r),n.points.unshift(EA(r,i)),n.points.push(EA(s,a))})}function ehe(e){e.edges().forEach(t=>{let n=e.edge(t);if(Object.hasOwn(n,"x"))switch((n.labelpos==="l"||n.labelpos==="r")&&(n.width-=n.labeloffset),n.labelpos){case"l":n.x-=n.width/2+n.labeloffset;break;case"r":n.x+=n.width/2+n.labeloffset;break}})}function the(e){e.edges().forEach(t=>{let n=e.edge(t);n.reversed&&n.points.reverse()})}function nhe(e){e.nodes().forEach(t=>{if(e.children(t).length){let n=e.node(t),r=e.node(n.borderTop),s=e.node(n.borderBottom),i=e.node(n.borderLeft[n.borderLeft.length-1]),a=e.node(n.borderRight[n.borderRight.length-1]);n.width=Math.abs(a.x-i.x),n.height=Math.abs(s.y-r.y),n.x=i.x+n.width/2,n.y=r.y+n.height/2}}),e.nodes().forEach(t=>{e.node(t).dummy==="border"&&e.removeNode(t)})}function rhe(e){e.edges().forEach(t=>{if(t.v===t.w){let n=e.node(t.v);n.selfEdges||(n.selfEdges=[]),n.selfEdges.push({e:t,label:e.edge(t)}),e.removeEdge(t)}})}function she(e){Vf(e).forEach(t=>{let n=0;t.forEach((r,s)=>{let i=e.node(r);i.order=s+n,(i.selfEdges||[]).forEach(a=>{tu(e,"selfedge",{width:a.label.width,height:a.label.height,rank:i.rank,order:s+ ++n,e:a.e,label:a.label},"_se")}),delete i.selfEdges})})}function ihe(e){e.nodes().forEach(t=>{let n=e.node(t);if(n.dummy==="selfedge"){let r=n,s=e.node(r.e.v),i=s.x+s.width/2,a=s.y,o=n.x-i,c=s.height/2;e.setEdge(r.e,r.label),e.removeNode(t),r.label.points=[{x:i+2*o/3,y:a-c},{x:i+5*o/6,y:a-c},{x:i+o,y:a},{x:i+5*o/6,y:a+c},{x:i+2*o/3,y:a+c}],r.label.x=n.x,r.label.y=n.y}})}function ib(e,t){return c0(Zm(e,t),Number)}function ab(e){let t={};return e&&Object.entries(e).forEach(([n,r])=>{typeof n=="string"&&(n=n.toLowerCase()),t[n]=r}),t}function ahe(e){let t=Vf(e),n=new As({compound:!0,multigraph:!0}).setGraph({});return e.nodes().forEach(r=>{n.setNode(r,{label:r}),n.setParent(r,"layer"+e.node(r).rank)}),e.edges().forEach(r=>n.setEdge(r.v,r.w,{},r.name)),t.forEach((r,s)=>{let i="layer"+s;n.setNode(i,{rank:"same"}),r.reduce((a,o)=>(n.setEdge(a,o,{style:"invis"}),o))}),n}var ohe={graphlib:d4,version:bde,layout:Pfe,debug:ahe,util:{time:_4,notime:k4}},IA=ohe;/*! For license information please see dagre.esm.js.LEGAL.txt */const zl={llm:{label:"智能体",description:"理解任务并直接完成一个具体工作",icon:Ro},sequential:{label:"分步协作",description:"内部步骤按照顺序依次执行",icon:RL},parallel:{label:"同时处理",description:"内部步骤同时工作,完成后统一汇总",icon:wL},loop:{label:"循环执行",description:"重复执行内部步骤,直到满足停止条件",icon:jw},a2a:{label:"远程智能体",description:"调用已经存在的远程 Agent",icon:Lg}},BE=220,FE=88,OA=96,RA=34,Jm=64,LA=310,Vl=24,D4=56,UE=40,MA=40,lhe=18,che=58,uhe=!1,dhe=e=>e==="sequential"||e==="parallel"||e==="loop";function $E(e,t){const n=e.agentType??"llm";return dhe(n)||n==="llm"&&(t.length===0||e.subAgents.length>0)}function HE(e,t=[],n="horizontal"){const r=e.agentType??"llm";if(!$E(e,t))return{width:BE,height:FE};const s=e.subAgents.map((d,f)=>HE(d,[...t,f],n)),i=s.length?Math.max(...s.map(d=>d.width)):0,a=s.length?Math.max(...s.map(d=>d.height)):0,o=s.length&&r!=="parallel"?D4:Vl,c=n==="horizontal"?r!=="parallel":r==="parallel",u=s.length?r==="parallel"?lhe+MA:r==="loop"?che:0:MA;return c?{width:Math.max(LA,s.reduce((d,f)=>d+f.width,0)+UE*Math.max(0,s.length-1)+o*2),height:Jm+Vl+a+u+Vl}:{width:Math.max(LA,i+Vl*2),height:Jm+o+s.reduce((d,f)=>d+f.height,0)+UE*Math.max(0,s.length-1)+u+o}}function Cu(e){return e.length===0?"agent-root":`agent-${e.join("-")}`}function fhe(e,t){return e.length===t.length&&e.every((n,r)=>n===t[r])}function jA(e){const t=n=>[n.agentType??"llm",n.subAgents.map(t)];return JSON.stringify(t(e))}function Iu(e,t,n,r){const s=(r==null?void 0:r.tone)==="sequential"?"hsl(213 40% 40%)":(r==null?void 0:r.tone)==="loop"?"hsl(151 34% 34%)":"hsl(220 9% 38%)";return{id:`${e}-${t}${r!=null&&r.loop?"-loop":""}`,source:e,target:t,sourceHandle:r!=null&&r.loop?"loop-source":void 0,targetHandle:r!=null&&r.loop?"loop-target":void 0,label:n,type:"insertStep",data:r?{insert:r.insert,loop:r.loop,tone:r.tone}:void 0,animated:r==null?void 0:r.loop,markerEnd:{type:Lc.ArrowClosed,width:16,height:16,color:s},style:{stroke:s,strokeWidth:1.5},labelStyle:{fill:"hsl(215 14% 42%)",fontSize:10,fontWeight:600},labelBgStyle:{fill:"hsl(var(--background))",fillOpacity:.92}}}function DA(e,t){const n=[{id:"terminal-input",type:"terminal",position:{x:0,y:0},data:{kind:"terminal",title:"用户请求"},selectable:!1,draggable:!1},{id:"terminal-output",type:"terminal",position:{x:0,y:0},data:{kind:"terminal",title:"最终回复"},selectable:!1,draggable:!1}],r=[];function s(u,d,f,h,p){const m=u.agentType??"llm",y=Cu(d);return $E(u,d)?(i(u,d,f,h,p),y):(n.push({id:y,type:"agent",parentId:f,extent:"parent",position:h,data:{kind:"agent",path:d,agent:u,title:m==="a2a"?"远程智能体":u.name.trim()||(d.length===0?"主 Agent":"未命名步骤"),pattern:m,description:u.description.trim()||zl[m].description,childCount:u.subAgents.length,containedIn:p}}),y)}function i(u,d,f,h={x:0,y:0},p){const m=u.agentType??"sequential",y=Cu(d),E=HE(u,d,t);n.push({id:y,type:"group",parentId:f,extent:f?"parent":void 0,position:h,style:{width:E.width,height:E.height},data:{kind:"agent",path:d,agent:u,title:u.name.trim()||(d.length===0?"主 Agent":zl[m].label),pattern:m,description:zl[m].description,childCount:u.subAgents.length,containedIn:p,layoutWidth:E.width,layoutHeight:E.height}});const g=u.subAgents.map((N,C)=>HE(N,[...d,C],t)),x=g.length&&m!=="parallel"?D4:Vl,b=t==="horizontal"?m!=="parallel":m==="parallel";let _=x;const k=u.subAgents.map((N,C)=>{const S=g[C],A=b?{x:_,y:Jm+Vl}:{x:(E.width-S.width)/2,y:Jm+_};return _+=(b?S.width:S.height)+UE,s(N,[...d,C],y,A,m)});if(m==="sequential"||m==="loop"){for(let N=0;N1&&r.push(Iu(k[k.length-1],k[0],"继续循环",{loop:!0,tone:"loop"}))}return y}const a=(u,d)=>{const f=u.agentType??"llm",h=Cu(d);if($E(u,d))return i(u,d),[h];if(n.push({id:h,type:"agent",position:{x:0,y:0},data:{kind:"agent",path:d,agent:u,title:f==="a2a"?"远程智能体":u.name.trim()||(d.length===0?"主 Agent":"未命名步骤"),pattern:f,description:u.description.trim()||zl[f].description,childCount:u.subAgents.length}}),u.subAgents.length===0)return[h];const p=[];return u.subAgents.forEach((m,y)=>{const E=[...d,y],g=Cu(E);r.push(Iu(h,g,"调用",{insert:{parentPath:d,index:y}})),p.push(...a(m,E))}),p},o=Cu([]),c=a(e,[]);return r.push(Iu("terminal-input",o)),c.forEach(u=>r.push(Iu(u,"terminal-output"))),hhe(n,r,t)}function hhe(e,t,n){const r=new IA.graphlib.Graph().setDefaultEdgeLabel(()=>({}));r.setGraph({rankdir:n==="vertical"?"TB":"LR",ranksep:50,nodesep:34,edgesep:14,marginx:24,marginy:24});const s=new Set(e.filter(i=>!i.parentId).map(i=>i.id));return e.filter(i=>!i.parentId).forEach(i=>{const a=i.data.kind==="terminal";r.setNode(i.id,{width:a?OA:i.data.layoutWidth??BE,height:a?RA:i.data.layoutHeight??FE})}),t.filter(i=>s.has(i.source)&&s.has(i.target)).forEach(i=>r.setEdge(i.source,i.target)),IA.layout(r),{nodes:e.map(i=>{if(i.parentId)return i;const a=r.node(i.id),o=i.data.kind==="terminal",c=o?OA:i.data.layoutWidth??BE,u=o?RA:i.data.layoutHeight??FE;return{...i,position:{x:a.x-c/2,y:a.y-u/2}}}),edges:t}}const d0=w.createContext(null),f0=w.createContext("horizontal");function phe({id:e,sourceX:t,sourceY:n,targetX:r,targetY:s,sourcePosition:i,targetPosition:a,markerEnd:o,style:c,label:u,data:d}){const f=w.useContext(d0),[h,p]=w.useState(!1),[m,y,E]=Wm({sourceX:t,sourceY:n,targetX:r,targetY:s,sourcePosition:i,targetPosition:a,offset:d!=null&&d.loop?28:20});return l.jsxs(l.Fragment,{children:[l.jsx(zf,{id:e,path:m,markerEnd:o,style:c}),f&&(d==null?void 0:d.insert)&&l.jsx("path",{d:m,className:"abc-edge-hover-path",onPointerEnter:()=>p(!0),onPointerLeave:()=>p(!1)}),(u||f&&(d==null?void 0:d.insert))&&l.jsx(cue,{children:l.jsxs("div",{className:`abc-edge-tools${f&&(d!=null&&d.insert)?" can-insert":""}${h?" is-visible":""}`,style:{transform:`translate(-50%, -50%) translate(${y}px, ${E}px)`},onPointerEnter:()=>p(!0),onPointerLeave:()=>p(!1),children:[u&&l.jsx("span",{className:"abc-edge-label",children:u}),f&&(d==null?void 0:d.insert)&&l.jsx("button",{type:"button",className:"abc-edge-add nodrag nopan","aria-label":"在这里插入步骤",title:"在这里插入步骤",onClick:g=>{g.stopPropagation(),f==null||f.onInsert(d.insert.parentPath,d.insert.index)},children:l.jsx(sr,{})})]})})]})}function mhe({data:e,selected:t}){const n=w.useContext(d0),r=w.useContext(f0),s=r==="vertical"?Fe.Top:Fe.Left,i=r==="vertical"?Fe.Bottom:Fe.Right,a=r==="vertical"?Fe.Right:Fe.Bottom,o=e.pattern??"llm",c=zl[o],u=c.icon;return l.jsxs("div",{className:`abc-node is-${o}${e.containedIn?` is-contained-in-${e.containedIn}`:""}${t?" is-selected":""}`,children:[l.jsx(mr,{type:"target",position:s,className:"abc-handle"}),o!=="llm"&&l.jsx("span",{className:"abc-node-icon",children:l.jsx(u,{})}),l.jsxs("span",{className:"abc-node-copy",children:[l.jsxs("span",{className:"abc-node-meta",children:[l.jsx("span",{children:c.label}),!!e.childCount&&l.jsxs("small",{children:[e.childCount," 个步骤"]})]}),l.jsx("strong",{children:e.title}),l.jsx("small",{children:e.description})]}),n&&e.path!==void 0&&e.path.length>0&&l.jsx("button",{type:"button",className:"abc-node-delete nodrag nopan","aria-label":`删除 ${e.title}`,title:"删除节点",onClick:d=>{d.stopPropagation(),n==null||n.onDelete(e.path)},children:l.jsx(ta,{})}),l.jsx(mr,{type:"source",position:i,className:"abc-handle"}),e.containedIn==="loop"&&l.jsxs(l.Fragment,{children:[l.jsx(mr,{id:"loop-target",type:"target",position:a,className:"abc-handle abc-loop-handle"}),l.jsx(mr,{id:"loop-source",type:"source",position:a,className:"abc-handle abc-loop-handle"})]})]})}function ghe({data:e,selected:t}){const n=w.useContext(d0),r=w.useContext(f0),s=r==="vertical"?Fe.Top:Fe.Left,i=r==="vertical"?Fe.Bottom:Fe.Right,a=r==="vertical"?Fe.Right:Fe.Bottom,o=e.pattern??"sequential",c=zl[o],u=o==="llm"?"子 Agent":"步骤",d=e.childCount??0,f=o==="llm"?"添加子 Agent":o==="parallel"?"添加一个同时处理的步骤":o==="loop"?"添加循环步骤":"添加下一个步骤";return l.jsxs("div",{className:`abc-group is-${o}${t?" is-selected":""}`,children:[l.jsx(mr,{type:"target",position:s,className:"abc-handle"}),l.jsxs("header",{className:"abc-group-head",children:[l.jsxs("span",{children:[l.jsx("strong",{title:e.title,children:e.title}),l.jsx("small",{children:o==="llm"?"智能体 · 可根据任务调用框内子 Agent":o==="parallel"?`${c.label} · 框内步骤同时开始,全部完成后再继续`:`${c.label} · ${c.description}`})]}),l.jsxs("em",{children:[d," 个",u]})]}),n&&e.path!==void 0&&d>0&&o!=="parallel"&&l.jsxs("div",{className:"abc-group-boundary-actions",children:[l.jsx("button",{type:"button",className:"abc-group-boundary-add is-start nodrag nopan","aria-label":"添加到最前",title:"添加到最前",onClick:h=>{h.stopPropagation(),n.onInsert(e.path,0)},children:l.jsx(sr,{})}),l.jsx("button",{type:"button",className:"abc-group-boundary-add is-end nodrag nopan","aria-label":"添加到最后",title:"添加到最后",onClick:h=>{h.stopPropagation(),n.onAdd(e.path)},children:l.jsx(sr,{})})]}),n&&e.path!==void 0&&d>0&&o==="parallel"&&l.jsxs("button",{type:"button",className:"abc-group-add abc-group-add-bottom nodrag nopan",onClick:h=>{h.stopPropagation(),n.onAdd(e.path)},children:[l.jsx(sr,{}),l.jsx("span",{children:f})]}),n&&e.path!==void 0&&d===0&&l.jsxs("button",{type:"button",className:"abc-group-add abc-group-add-empty nodrag nopan",onClick:h=>{h.stopPropagation(),n.onAdd(e.path)},children:[l.jsx(sr,{}),l.jsx("span",{children:f})]}),n&&e.path!==void 0&&e.path.length>0&&l.jsx("button",{type:"button",className:"abc-node-delete nodrag nopan","aria-label":`删除 ${e.title}`,title:"删除节点",onClick:h=>{h.stopPropagation(),n==null||n.onDelete(e.path)},children:l.jsx(ta,{})}),l.jsx(mr,{type:"source",position:i,className:"abc-handle"}),e.containedIn==="loop"&&l.jsxs(l.Fragment,{children:[l.jsx(mr,{id:"loop-target",type:"target",position:a,className:"abc-handle abc-loop-handle"}),l.jsx(mr,{id:"loop-source",type:"source",position:a,className:"abc-handle abc-loop-handle"})]})]})}function yhe({data:e}){const t=w.useContext(f0);return l.jsxs("div",{className:"abc-terminal",children:[l.jsx(mr,{type:"target",position:t==="vertical"?Fe.Top:Fe.Left,className:"abc-handle"}),l.jsx("span",{children:e.title}),l.jsx(mr,{type:"source",position:t==="vertical"?Fe.Bottom:Fe.Right,className:"abc-handle"})]})}const bhe={agent:mhe,group:ghe,terminal:yhe},Ehe={insertStep:phe};function xhe({draft:e,selectedPath:t,onSelect:n,onAdd:r,onInsert:s,onDelete:i,readOnly:a=!1,interactivePreview:o=!1,direction:c="horizontal"}){const u=w.useMemo(()=>DA(e,c),[]),[d,f,h]=r4(u.nodes),[p,m,y]=s4(u.edges),E=due(),g=w.useRef(`${c}:${jA(e)}`),x=w.useRef(null),{fitView:b}=o0(),_=w.useMemo(()=>DA(e,c),[c,e]),[k,N]=w.useState(()=>window.matchMedia("(max-width: 860px)").matches),C=w.useMemo(()=>a?{padding:.16,minZoom:.05,maxZoom:.9}:k?{padding:.08,minZoom:.35,maxZoom:.9}:{padding:.14,minZoom:.42,maxZoom:1.1},[k,a]),S=w.useCallback(()=>{window.requestAnimationFrame(()=>{window.requestAnimationFrame(()=>void b(C))})},[C,b]);w.useEffect(()=>{const O=window.matchMedia("(max-width: 860px)"),D=F=>N(F.matches);return O.addEventListener("change",D),()=>O.removeEventListener("change",D)},[]),w.useEffect(()=>{const O=`${c}:${jA(e)}`,D=O!==g.current;g.current=O,m(_.edges),f(F=>{const X=new Map(F.map(L=>[L.id,L.position]));return _.nodes.map(L=>({...L,position:!D&&X.get(L.id)?X.get(L.id):L.position,selected:L.data.kind==="agent"&&!!L.data.path&&fhe(L.data.path,t)}))}),D&&S()},[_,e,S,t,m,f]),w.useEffect(()=>{S()},[k,S]),w.useEffect(()=>{E&&S()},[_,S,E]),w.useEffect(()=>{if(!a||!x.current)return;const O=new ResizeObserver(()=>S());return O.observe(x.current),S(),()=>O.disconnect()},[S,a]);const A=w.useMemo(()=>a?null:{onAdd:r,onInsert:s,onDelete:i},[r,i,s,a]);return l.jsx(f0.Provider,{value:c,children:l.jsx(d0.Provider,{value:A,children:l.jsx("section",{className:`abc-root is-${c}${a?" is-readonly":""}`,"aria-label":a?"只读 Agent 执行画布":"Agent 执行画布",children:l.jsx("div",{ref:x,className:"abc-canvas",children:l.jsxs(n4,{nodes:d,edges:p,nodeTypes:bhe,edgeTypes:Ehe,onNodesChange:h,onEdgesChange:y,onNodeClick:(O,D)=>{!a&&D.data.kind==="agent"&&D.data.path&&n(D.data.path)},nodesDraggable:!a,nodesConnectable:!1,nodesFocusable:!a,elementsSelectable:!a,edgesFocusable:!1,edgesReconnectable:!1,panOnDrag:!a||o,zoomOnDoubleClick:o,zoomOnPinch:!a||o,zoomOnScroll:!a||o,fitView:!0,fitViewOptions:C,minZoom:a?.05:.35,maxZoom:1.6,proOptions:{hideAttribution:!0},children:[l.jsx(a4,{gap:20,size:1.2,color:"hsl(34 20% 82%)"}),(!a||o)&&l.jsx(l4,{showInteractive:!1}),uhe]})})})})})}function eg(e){return l.jsx(Uv,{children:l.jsx(xhe,{...e})})}const whe="doubao-seed-2-1-pro-260628",vhe="一个基于 VeADK 构建的智能助手,理解用户意图并调用合适的工具完成任务。",_he=`你是一个专业、可靠的智能助手。 + +你的目标是准确理解用户的需求,并给出条理清晰、简洁有用的回答。 + +约束: +- 信息不足时主动提问澄清,不要臆造事实。 +- 需要时合理调用可用的工具,并说明关键结论。 +- 保持礼貌、专业的语气。`;function Nr(){return{name:"",description:vhe,instruction:_he,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:whe,modelProvider:"",modelApiBase:"",shortTermBackend:"local",longTermBackend:"local",autoSaveSession:!1,knowledgebaseBackend:kc,knowledgebaseIndex:"",tracingExporters:[],selectedSkills:[],deployment:{feishuEnabled:!1}}}const khe=[{id:"case-1",kind:"good",input:"总结本周客户反馈,并按优先级归类。",expectation:"覆盖主要问题,给出清晰的优先级与下一步动作。",tag:"总结"},{id:"case-2",kind:"good",input:"查询最新公开资料并附上来源。",expectation:"调用搜索工具,结论与引用一一对应。",tag:"工具调用"},{id:"case-3",kind:"bad",input:"在信息不足时直接给出确定结论。",expectation:"应明确说明未知,并主动询问缺失信息。",tag:"幻觉"},{id:"case-4",kind:"bad",input:"连续重复调用相同工具获取同一结果。",expectation:"复用已有结果,避免无意义的重复调用。",tag:"效率"}],Nhe=[{id:"eval-regression",name:"核心能力回归",agentIds:[],caseSet:"核心回归集",evaluator:"综合质量评估器",metrics:["回答质量","工具调用"],concurrency:"4",history:[{id:"run-1",createdAt:"今天 10:32",score:88,status:"completed"},{id:"run-2",createdAt:"昨天 16:08",score:84,status:"completed"}]},{id:"eval-safety",name:"安全与幻觉检查",agentIds:[],caseSet:"安全边界集",evaluator:"事实一致性评估器",metrics:["事实准确性","拒答合理性"],concurrency:"2",history:[{id:"run-3",createdAt:"7 月 25 日 14:20",score:91,status:"completed"}]}],She=[{id:"basic",label:"基本信息"},{id:"evaluations",label:"评测集"}];function P4(e){const t=e.tools??[],n=_c.filter(s=>s.toolNames.some(i=>t.includes(i))),r=new Set(n.flatMap(s=>s.toolNames));return{...Nr(),name:e.name,description:e.description,instruction:e.instruction||Nr().instruction,agentType:e.type,modelName:e.model,tools:t.filter(s=>!r.has(s)),builtinTools:n.map(s=>s.id),skills:(e.skills??[]).map(s=>s.name),subAgents:(e.children??[]).map(P4)}}function The(e,t){var n;return e!=null&&e.draft?e.draft:e!=null&&e.graph?P4(e.graph):{...Nr(),name:(e==null?void 0:e.name)||t,description:(e==null?void 0:e.description)||"暂无描述",agentType:(e==null?void 0:e.type)??"llm",modelName:e==null?void 0:e.model,tools:(e==null?void 0:e.tools)??[],skills:((n=e==null?void 0:e.skills)==null?void 0:n.map(r=>r.name))??[]}}function B4(e){return e?1+e.children.reduce((t,n)=>t+B4(n),0):1}function F4(e){return 1+e.subAgents.reduce((t,n)=>t+F4(n),0)}const zE=[{phase:"prepare",label:"准备部署",description:"校验配置并创建部署任务"},{phase:"build",label:"构建镜像",description:"生成运行环境与智能体代码"},{phase:"deploy",label:"部署服务",description:"创建并启动 AgentKit Runtime"},{phase:"publish",label:"发布服务",description:"等待服务就绪并生成访问地址"},{phase:"complete",label:"部署完成",description:"智能体已可以正常使用"}];function Ahe(e){if(e.status==="success")return zE.length-1;const t=e.phase??{准备部署:"prepare",构建镜像:"build",部署:"deploy",发布:"publish",部署完成:"complete"}[e.label],n=zE.findIndex(r=>r.phase===t);return n<0?0:n}function PA({task:e}){const t=Ahe(e),n=e.status==="success"?100:Math.max(6,Math.min(100,e.pct??6)),r=e.status==="running"?"正在部署":e.status==="success"?"部署完成":e.status==="error"?"部署失败":"部署已取消";return l.jsxs("section",{className:`aw-deploy-progress-card is-${e.status}`,"aria-live":"polite",children:[l.jsxs("div",{className:"aw-deploy-progress-head",children:[l.jsxs("div",{children:[l.jsx("span",{className:"aw-deploy-progress-icon","aria-hidden":!0,children:e.status==="running"?l.jsx(Mt,{className:"spin"}):e.status==="success"?l.jsx(NL,{}):e.status==="error"?l.jsx(Rg,{}):l.jsx(V1,{})}),l.jsxs("div",{children:[l.jsx("h3",{children:r}),l.jsx("p",{children:e.runtimeName})]})]}),l.jsx("strong",{children:e.status==="running"?`${Math.round(n)}%`:e.label})]}),l.jsx("div",{className:"aw-deploy-progress-track",role:"progressbar","aria-label":"部署进度","aria-valuemin":0,"aria-valuemax":100,"aria-valuenow":Math.round(n),children:l.jsx("span",{style:{width:`${n}%`}})}),l.jsx("ol",{className:"aw-deploy-steps",children:zE.map((s,i)=>{const a=e.status==="success"||i{e.length!==0&&Te(te=>te.map((he,Oe)=>Oe===0&&he.agentIds.length===0?{...he,agentIds:e.slice(0,2).map(De=>De.id)}:he))},[e]);const rt=w.useMemo(()=>{const te=new Map;for(const he of e)he.runtimeId&&te.set(he.runtimeId,he);return te},[e]),ze=w.useMemo(()=>{var he;const te=new Map;for(const Oe of t){const De=(he=Oe.deploymentTarget)==null?void 0:he.runtimeId;if(!De||!rt.has(De))continue;const lt=te.get(De);(!lt||Oe.updatedAt>lt.updatedAt)&&te.set(De,Oe)}return te},[rt,t]),We=w.useMemo(()=>{const te=new Map;for(const he of d){if(!he.runtimeId)continue;const Oe=te.get(he.runtimeId);(!Oe||he.startedAt>Oe.startedAt)&&te.set(he.runtimeId,he)}return te},[d]),yt=w.useMemo(()=>{const te=R.trim().toLowerCase();return te?e.filter(he=>{const Oe=he.runtimeId?ze.get(he.runtimeId):void 0,De=he.runtimeId?We.get(he.runtimeId):void 0;return[he.label,he.app,he.host??"",(Oe==null?void 0:Oe.draft.name)??"",(Oe==null?void 0:Oe.draft.description)??"",(De==null?void 0:De.runtimeName)??""].join(" ").toLowerCase().includes(te)}):e},[e,We,R,ze]),at=w.useMemo(()=>{const te=R.trim().toLowerCase();return t.filter(he=>{var De;const Oe=(De=he.deploymentTarget)==null?void 0:De.runtimeId;return Oe&&rt.has(Oe)?!1:te?`${he.draft.name} ${he.draft.description}`.toLowerCase().includes(te):!0})},[rt,t,R]),St=w.useMemo(()=>t.filter(te=>{var Oe;const he=(Oe=te.deploymentTarget)==null?void 0:Oe.runtimeId;return!he||!rt.has(he)}).length,[rt,t]),Tt=w.useMemo(()=>{const te=R.trim().toLowerCase();return te?Ee.filter(he=>he.name.toLowerCase().includes(te)):Ee},[Ee,R]),H=e.find(te=>te.id===A),Z=t.find(te=>te.id===D),le=d.find(te=>te.id===X),be=H!=null&&H.runtimeId?ze.get(H.runtimeId):void 0,Le=A&&s===A?r:null,Ke=w.useMemo(()=>{const te=new Map(e.map((Oe,De)=>[Oe.id,De])),he=new Map(n.map((Oe,De)=>[Oe,De]));return[...yt].sort((Oe,De)=>{const lt=Oe.runtimeId?We.get(Oe.runtimeId):void 0,Bt=De.runtimeId?We.get(De.runtimeId):void 0,it=(lt==null?void 0:lt.status)==="running"?lt.startedAt:0,Q=(Bt==null?void 0:Bt.status)==="running"?Bt.startedAt:0;if(it!==Q)return Q-it;const ve=he.get(Oe.id),xe=he.get(De.id);return ve!=null&&xe!=null?ve-xe:ve!=null?-1:xe!=null?1:(te.get(Oe.id)??0)-(te.get(De.id)??0)})},[n,e,yt,We]),Ot=(H==null?void 0:H.label)||(Le==null?void 0:Le.name)||(Z==null?void 0:Z.draft.name)||(le==null?void 0:le.runtimeName)||"未选择智能体",He=Ee.find(te=>te.id===Ge),Ce=w.useMemo(()=>(le==null?void 0:le.agentDraft)??(Z==null?void 0:Z.draft)??(be==null?void 0:be.draft)??The(Le,(H==null?void 0:H.label)??"agent"),[Le,H==null?void 0:H.label,be==null?void 0:be.draft,Z==null?void 0:Z.draft,le==null?void 0:le.agentDraft]),Ie=w.useMemo(()=>{if(le)return le;if(Z)return d.filter(te=>{var he,Oe;return((he=te.agentDraft)==null?void 0:he.name)===Z.draft.name||te.runtimeName===Z.draft.name||!!((Oe=Z.deploymentTarget)!=null&&Oe.runtimeId)&&te.runtimeId===Z.deploymentTarget.runtimeId}).sort((te,he)=>he.startedAt-te.startedAt)[0];if(H)return d.filter(te=>!!H.runtimeId&&te.runtimeId===H.runtimeId||te.runtimeName===H.label).sort((te,he)=>he.startedAt-te.startedAt)[0]},[d,H,Z,le]);w.useEffect(()=>{if(!f)return;const te=d.find(Oe=>Oe.id===f),he=te!=null&&te.runtimeId?rt.get(te.runtimeId):void 0;if(he){L(""),F(""),O(he.id),S("basic");return}O(""),F(""),L(f),S("basic")},[rt,d,f]),w.useEffect(()=>{!h||!e.some(te=>te.id===h)||(L(""),F(""),O(h),S("basic"))},[e,h]),w.useEffect(()=>{let te=!1;if(T(null),!!(H!=null&&H.runtimeId))return Vw(H.runtimeId,H.region??"cn-beijing").then(he=>{te||T(he)}).catch(()=>{te||T(null)}),()=>{te=!0}},[H==null?void 0:H.region,H==null?void 0:H.runtimeId]);const wt=fe.filter(te=>{if(te.kind!==B)return!1;const he=V.trim().toLowerCase();return he?`${te.input} ${te.expectation} ${te.tag}`.toLowerCase().includes(he):!0}),Kt=te=>{Te(he=>he.map(Oe=>Oe.id===te.id?te:Oe))},Pt=()=>{const te=new Set(e.map(De=>De.id)),he=n.filter(De=>te.has(De)),Oe=new Set(he);return[...he,...e.filter(De=>!Oe.has(De.id)).map(De=>De.id)]},pn=(te,he,Oe)=>{if(!m||te===he)return;const De=Pt().filter(it=>it!==te),lt=De.indexOf(he),Bt=lt<0?De.length:Oe==="after"?lt+1:lt;De.splice(Bt,0,te),m(De)},je=(te,he)=>{if(!P||P===he)return;const Oe=te.currentTarget.getBoundingClientRect();ne(he),ee(te.clientY>Oe.top+Oe.height/2?"after":"before")},st=(te,he)=>{if(!m)return;const Oe=Pt(),De=Oe.indexOf(te),lt=Math.max(0,Math.min(Oe.length-1,De+he));De<0||De===lt||(Oe.splice(De,1),Oe.splice(lt,0,te),m(Oe))},It=async te=>{if(!(!y||te.canDelete!==!0||ce)&&window.confirm(`确定删除 Agent "${te.label}"?该 Runtime 将被永久删除。`)){re(!0),ye("");try{await y([te]),A===te.id&&O("")}catch(he){ye(he instanceof Error?he.message:String(he))}finally{re(!1)}}},At=te=>{if(!E||ce)return;const he=te.draft.name||"未命名 Agent";window.confirm(`确定删除草稿 "${he}"?`)&&(ye(""),E([te]),D===te.id&&F(""))},me=()=>{const te=`eval-${Date.now()}`,he={id:te,name:`新评测组 ${Ee.length+1}`,agentIds:[],caseSet:"核心回归集",evaluator:"综合质量评估器",metrics:["回答质量"],concurrency:"4",history:[]};Te(Oe=>[he,...Oe]),ke(te)},Ve=te=>{Kt({...te,history:[{id:`run-${Date.now()}`,createdAt:"刚刚",score:86+te.history.length%7,status:"completed"},...te.history]})};return l.jsxs("div",{className:"aw-root",children:[l.jsxs("nav",{className:"aw-view-tabs","aria-label":"智能体工作台",children:[l.jsx("button",{type:"button",className:k==="library"?"is-active":"","aria-pressed":k==="library",onClick:()=>{N("library"),M("")},children:"智能体库"}),l.jsx("button",{type:"button",className:k==="evaluation"?"is-active":"","aria-pressed":k==="evaluation",onClick:()=>{N("evaluation"),M("")},children:"评测"})]}),l.jsxs("div",{className:"aw-workspace-frame",children:[l.jsxs("div",{className:"aw-workspace","aria-hidden":k==="evaluation"||void 0,ref:te=>te==null?void 0:te.toggleAttribute("inert",k==="evaluation"),children:[l.jsxs("aside",{className:"aw-sidebar","aria-label":k==="library"?"智能体列表":"评测组列表",children:[l.jsxs("label",{className:"aw-search",children:[l.jsx(Wd,{"aria-hidden":!0}),l.jsx("input",{value:R,onChange:te=>M(te.currentTarget.value),placeholder:k==="library"?"搜索智能体":"搜索评测组","aria-label":k==="library"?"搜索智能体":"搜索评测组"})]}),l.jsxs("button",{type:"button",className:"aw-create-card",onClick:k==="library"?x:me,disabled:k==="library"&&!a,children:[l.jsx(sr,{"aria-hidden":!0}),l.jsx("span",{children:k==="library"?"新建 Agent":"新建评测组"})]}),k==="library"&&pe&&l.jsx("div",{className:"aw-delete-error",role:"alert",children:pe}),l.jsx("div",{className:"aw-agent-list",children:k==="evaluation"?Tt.length===0?l.jsx("div",{className:"aw-list-empty",children:"没有匹配的评测组"}):Tt.map(te=>l.jsxs("button",{type:"button",className:`aw-agent-item${te.id===Ge?" is-active":""}`,onClick:()=>ke(te.id),children:[l.jsxs("span",{className:"aw-agent-copy aw-eval-group-copy",children:[l.jsx("strong",{children:te.name}),l.jsxs("small",{children:[te.agentIds.length," 个智能体 · ",te.history.length," 次运行"]})]}),l.jsx(ld,{"aria-hidden":!0})]},te.id)):c&&Ke.length===0&&at.length===0?l.jsx("div",{className:"aw-list-empty",children:"正在读取云端智能体…"}):u&&Ke.length===0&&at.length===0?l.jsxs("div",{className:"aw-list-empty aw-list-error",children:[l.jsx("span",{children:u}),p&&l.jsx("button",{type:"button",onClick:p,children:"重试"})]}):Ke.length===0&&at.length===0?l.jsx("div",{className:"aw-list-empty",children:"没有匹配的智能体"}):l.jsxs(l.Fragment,{children:[at.map(te=>{const he=d.filter(Oe=>{var De,lt;return((De=Oe.agentDraft)==null?void 0:De.name)===te.draft.name||Oe.runtimeName===te.draft.name||!!((lt=te.deploymentTarget)!=null&<.runtimeId)&&Oe.runtimeId===te.deploymentTarget.runtimeId}).sort((Oe,De)=>De.startedAt-Oe.startedAt)[0];return l.jsxs("button",{type:"button",className:`aw-agent-item${te.id===D?" is-active":""}`,onClick:()=>{O(""),L(""),F(te.id),S("basic")},children:[l.jsxs("span",{className:"aw-agent-copy",children:[l.jsxs("span",{className:"aw-agent-name-row",children:[l.jsx("strong",{children:te.draft.name||"未命名 Agent"}),l.jsx("span",{className:`aw-draft-badge${(he==null?void 0:he.status)==="running"?" is-deploying":""}`,children:(he==null?void 0:he.status)==="running"?"部署中":"草稿"})]}),l.jsx("small",{children:te.deploymentTarget?"待更新":"尚未发布"})]}),l.jsx(ld,{"aria-hidden":!0})]},te.id)}),Ke.map(te=>{const he=te.runtimeId?We.get(te.runtimeId):void 0,Oe=te.runtimeId?ze.get(te.runtimeId):void 0,De=(he==null?void 0:he.status)==="running"?{label:"部署中",className:" is-deploying"}:(he==null?void 0:he.status)==="error"?{label:"失败",className:" is-error"}:(he==null?void 0:he.status)==="cancelled"?{label:"已取消",className:" is-muted"}:Oe?{label:"待更新",className:""}:null,lt=(he==null?void 0:he.status)==="running"?"正在更新部署":Oe?"待更新":te.remote?te.host||"远程智能体":"本地智能体",Bt=["aw-agent-item","aw-agent-item--sortable",te.id===A?"is-active":"",te.id===P?"is-dragging":"",te.id===q&&te.id!==P?`is-drop-target is-drop-${oe}`:""].filter(Boolean).join(" ");return l.jsxs("button",{type:"button",draggable:!!m,className:Bt,"aria-keyshortcuts":m?"Alt+ArrowUp Alt+ArrowDown":void 0,onDragStart:it=>{m&&(J.current=!0,ie(te.id),it.dataTransfer.effectAllowed="move",it.dataTransfer.setData("text/plain",te.id))},onDragEnter:it=>{je(it,te.id)},onDragOver:it=>{!P||P===te.id||(it.preventDefault(),it.dataTransfer.dropEffect="move",je(it,te.id))},onDragLeave:it=>{const Q=it.relatedTarget;Q instanceof Node&&it.currentTarget.contains(Q)||q===te.id&&ne("")},onDrop:it=>{it.preventDefault();const Q=it.dataTransfer.getData("text/plain")||P;pn(Q,te.id,oe),ie(""),ne(""),ee("before")},onDragEnd:()=>{ie(""),ne(""),ee("before"),window.setTimeout(()=>{J.current=!1},0)},onKeyDown:it=>{it.altKey&&(it.key==="ArrowUp"?(it.preventDefault(),st(te.id,-1)):it.key==="ArrowDown"&&(it.preventDefault(),st(te.id,1)))},onClick:it=>{if(J.current){it.preventDefault(),J.current=!1;return}L(""),F(""),O(te.id),S("basic"),g(te.id)},children:[l.jsxs("span",{className:"aw-agent-copy",children:[l.jsxs("span",{className:"aw-agent-name-row",children:[l.jsx("strong",{children:te.label}),te.currentVersion!=null&&l.jsxs("span",{className:"aw-version-badge",children:["v",te.currentVersion]}),De&&l.jsx("span",{className:`aw-draft-badge${De.className}`,children:De.label})]}),l.jsx("small",{children:lt})]}),l.jsx(ld,{"aria-hidden":!0})]},te.id)})]})}),l.jsxs("div",{className:"aw-list-count",children:["共 ",k==="library"?e.length+St:Ee.length," 个"]})]}),k==="evaluation"&&He?l.jsx(Ohe,{group:He,agents:e,cases:fe,onChange:Kt,onRun:Ve}):k==="evaluation"?l.jsx("main",{className:"aw-main aw-empty-selection",children:l.jsx("p",{children:"未选择评测组"})}):!H&&!Z&&!le?l.jsx("main",{className:"aw-main aw-empty-selection",children:l.jsx("p",{children:"未选择智能体"})}):(Ie==null?void 0:Ie.status)==="running"?l.jsx("main",{className:"aw-main aw-deployment-focus",children:l.jsx(PA,{task:Ie})}):l.jsxs("main",{className:"aw-main",children:[l.jsx("div",{className:"aw-agent-head",children:l.jsxs("div",{children:[l.jsxs("div",{className:"aw-agent-title-row",children:[l.jsx("h2",{children:Ot}),(H==null?void 0:H.currentVersion)!=null&&l.jsxs("span",{children:["v",H.currentVersion]}),Z&&l.jsx("span",{children:"草稿"}),be&&l.jsx("span",{children:"待更新"}),!H&&!Z&&le&&l.jsx("span",{children:le.label})]}),l.jsx("p",{children:Ce.description||(i?"正在读取智能体信息…":"暂无描述")})]})}),l.jsx("nav",{className:"aw-agent-tabs","aria-label":"智能体详情",children:She.map(te=>l.jsx("button",{type:"button",className:C===te.id?"is-active":"","aria-pressed":C===te.id,onClick:()=>S(te.id),children:te.label},te.id))}),l.jsxs("div",{className:"aw-content",children:[C==="basic"&&l.jsxs("div",{className:"aw-basic-stack",children:[l.jsxs("section",{className:"aw-canvas-card",children:[l.jsx("div",{className:"aw-card-head",children:l.jsx("strong",{children:"执行流程"})}),l.jsx("div",{className:"aw-canvas",children:l.jsx(eg,{draft:Ce,direction:"horizontal",selectedPath:[],onSelect:()=>{},onAdd:()=>{},onInsert:()=>{},onDelete:()=>{},readOnly:!0,interactivePreview:!0})})]}),l.jsxs("section",{className:"aw-details-card",children:[l.jsx("div",{className:"aw-card-head",children:l.jsx("strong",{children:"详细信息"})}),l.jsxs("dl",{className:"aw-facts",children:[l.jsxs("div",{children:[l.jsx("dt",{children:"模型"}),l.jsx("dd",{children:(Le==null?void 0:Le.model)||Ce.modelName||"暂未提供"})]}),l.jsxs("div",{children:[l.jsx("dt",{children:"智能体数量"}),l.jsx("dd",{children:Le!=null&&Le.graph?B4(Le.graph):F4(Ce)})]}),l.jsxs("div",{children:[l.jsx("dt",{children:"工具"}),l.jsx("dd",{children:(Le==null?void 0:Le.tools.length)??Ce.tools.length+(((nt=Ce.builtinTools)==null?void 0:nt.length)??0)+(((Xt=Ce.customTools)==null?void 0:Xt.length)??0)+(((mn=Ce.mcpTools)==null?void 0:mn.length)??0)})]}),l.jsxs("div",{children:[l.jsx("dt",{children:"技能"}),l.jsx("dd",{children:Le?Le.skillsPreviewSupported?Le.skills.length:"暂不支持预览":((Qt=Ce.selectedSkills)==null?void 0:Qt.length)??Ce.skills.length})]}),l.jsxs("div",{children:[l.jsx("dt",{children:"当前版本"}),l.jsx("dd",{children:(j==null?void 0:j.currentVersion)!=null?`v${j.currentVersion}`:(H==null?void 0:H.currentVersion)!=null?`v${H.currentVersion}`:"暂未提供"})]}),l.jsxs("div",{children:[l.jsx("dt",{children:"状态"}),l.jsx("dd",{children:Z?"草稿":(Ie==null?void 0:Ie.status)==="error"?"部署失败":(Ie==null?void 0:Ie.status)==="cancelled"?"已取消":be?"待更新":l.jsxs(l.Fragment,{children:[l.jsx("span",{className:"aw-status-dot"}),"可用"]})})]})]})]}),Ie&&l.jsx(PA,{task:Ie}),l.jsxs("section",{className:"aw-deployment-panel aw-settings-card",children:[l.jsx("div",{className:"aw-section-head",children:l.jsxs("div",{children:[l.jsx("h3",{children:"部署配置"}),l.jsx("p",{children:"配置目标环境与网络访问方式。"})]})}),l.jsxs("dl",{className:"aw-readonly-config",children:[l.jsxs("div",{children:[l.jsx("dt",{children:"运行状态"}),l.jsx("dd",{children:(j==null?void 0:j.status)||"读取中…"})]}),l.jsxs("div",{children:[l.jsx("dt",{children:"部署区域"}),l.jsx("dd",{children:(j==null?void 0:j.region)||(H==null?void 0:H.region)||(Ie==null?void 0:Ie.region)||"暂未提供"})]}),l.jsxs("div",{children:[l.jsx("dt",{children:"网络访问"}),l.jsx("dd",{children:j!=null&&j.networkTypes.length?j.networkTypes.join(" / "):"暂未提供"})]})]})]}),l.jsxs("section",{className:"aw-option-panel aw-settings-card",children:[l.jsx("div",{className:"aw-section-head",children:l.jsxs("div",{children:[l.jsx("h3",{children:"优化项"}),l.jsx("p",{children:"针对运行质量开启专项优化策略。"})]})}),l.jsxs("div",{className:"aw-option-content",children:[l.jsx("div",{className:"aw-option-list","aria-disabled":"true",children:[["上下文优化","压缩冗余信息,保留对当前任务最有价值的上下文。"],["幻觉抑制","在证据不足时降低确定性表达并主动请求补充信息。"],["工具调用优化","减少重复调用,并优先复用已经获得的结果。"]].map(([te,he])=>l.jsxs("label",{children:[l.jsx("input",{type:"checkbox",disabled:!0}),l.jsxs("span",{children:[l.jsx("strong",{children:te}),l.jsx("small",{children:he})]})]},te))}),l.jsx("div",{className:"aw-option-glass",role:"status",children:l.jsx("span",{children:"暂未开放"})})]})]})]}),C==="evaluations"&&l.jsxs("section",{className:"aw-cases",children:[l.jsx("div",{className:"aw-case-filters",children:["good","bad"].map(te=>l.jsx("button",{type:"button",className:B===te?"is-active":"","aria-pressed":B===te,onClick:()=>I(te),children:te==="good"?"Good case":"Bad case"},te))}),l.jsxs("label",{className:"aw-case-search",children:[l.jsx(Wd,{"aria-hidden":!0}),l.jsx("input",{type:"search",value:V,onChange:te=>G(te.currentTarget.value),placeholder:"搜索用户输入、期望行为或标签","aria-label":"搜索评测案例"})]}),l.jsx(Ihe,{cases:wt})]})]}),C==="basic"&&(H||Z)&&l.jsxs("div",{className:"aw-basic-actions",children:[l.jsx("button",{type:"button",className:"aw-update studio-update-action",disabled:Z||be?!a:!(H!=null&&H.runtimeId)||!o||i||!Le,onClick:()=>Z?_==null?void 0:_(Z):be?_==null?void 0:_(be):b(Ce),children:Z||be?"继续编辑":"更新"}),(Z||be)&&l.jsxs("button",{type:"button",className:"aw-head-delete studio-update-action",onClick:()=>{const te=Z??be;te&&At(te)},disabled:ce,"aria-label":"删除草稿",title:"删除草稿",children:[l.jsx(ta,{"aria-hidden":!0}),l.jsx("span",{children:"删除草稿"})]}),(H==null?void 0:H.canDelete)&&l.jsxs("button",{type:"button",className:"aw-head-delete studio-update-action",onClick:()=>void It(H),disabled:ce,"aria-label":"删除 Agent",title:"删除 Agent",children:[l.jsx(ta,{"aria-hidden":!0}),l.jsx("span",{children:ce?"删除中…":"删除 Agent"})]})]})]})]}),k==="evaluation"&&l.jsx("div",{className:"aw-evaluation-glass",role:"status",children:l.jsx("span",{children:"敬请期待"})})]})]})}function Ihe({cases:e}){return l.jsxs("div",{className:"aw-case-table",children:[l.jsxs("div",{className:"aw-case-row aw-case-row-head",children:[l.jsx("span",{children:"用户输入"}),l.jsx("span",{children:"期望行为"}),l.jsx("span",{children:"标签"})]}),e.length===0?l.jsx("div",{className:"aw-case-empty",children:"没有匹配的案例"}):e.map(t=>l.jsxs("div",{className:"aw-case-row",children:[l.jsx("strong",{children:t.input}),l.jsx("p",{children:t.expectation}),l.jsx("span",{className:"aw-case-tag",children:t.tag})]},t.id))]})}function Ohe({group:e,agents:t,cases:n,onChange:r,onRun:s}){const[i,a]=w.useState("config"),o=e.agentIds.map(f=>t.find(h=>h.id===f)).filter(f=>!!f),c=["回答质量","事实准确性","工具调用","响应效率"];w.useEffect(()=>a("config"),[e.id]);const u=f=>{r({...e,agentIds:e.agentIds.includes(f)?e.agentIds.filter(h=>h!==f):[...e.agentIds,f]})},d=f=>{r({...e,metrics:e.metrics.includes(f)?e.metrics.filter(h=>h!==f):[...e.metrics,f]})};return l.jsxs("main",{className:"aw-main",children:[l.jsxs("div",{className:"aw-eval-head",children:[l.jsxs("div",{children:[l.jsxs("div",{className:"aw-agent-title-row",children:[l.jsx("h2",{children:e.name}),l.jsx("span",{children:"评测组"})]}),l.jsxs("p",{children:[o.length," 个参评智能体 · ",e.caseSet," · ",e.history.length," 次运行"]})]}),l.jsxs("button",{type:"button",className:"aw-run",onClick:()=>s(e),disabled:!0,children:[l.jsx(RH,{"aria-hidden":!0}),"开始评测"]})]}),l.jsxs("nav",{className:"aw-agent-tabs","aria-label":"评测组详情",children:[l.jsx("button",{type:"button",className:i==="config"?"is-active":"","aria-pressed":i==="config",onClick:()=>a("config"),disabled:!0,children:"评测配置"}),l.jsx("button",{type:"button",className:i==="history"?"is-active":"","aria-pressed":i==="history",onClick:()=>a("history"),disabled:!0,children:"历史结果"})]}),l.jsx("div",{className:"aw-content",children:i==="config"?l.jsxs("div",{className:"aw-eval-setup",children:[l.jsxs("section",{className:"aw-eval-block",children:[l.jsxs("div",{className:"aw-card-head",children:[l.jsx("strong",{children:"参评智能体"}),l.jsxs("span",{children:["已选择 ",o.length," 个"]})]}),l.jsx("div",{className:"aw-eval-agent-grid",children:t.map(f=>l.jsxs("label",{children:[l.jsx("input",{type:"checkbox",checked:e.agentIds.includes(f.id),onChange:()=>u(f.id)}),l.jsxs("span",{children:[l.jsx("strong",{children:f.label}),l.jsx("small",{children:f.remote?"远程":"本地"})]})]},f.id))})]}),l.jsxs("div",{className:"aw-eval-setting-grid",children:[l.jsxs("section",{className:"aw-eval-block",children:[l.jsx("div",{className:"aw-card-head",children:l.jsx("strong",{children:"评测资源"})}),l.jsxs("div",{className:"aw-eval-fields",children:[l.jsxs("label",{children:[l.jsx("span",{children:"评测集"}),l.jsxs("select",{value:e.caseSet,onChange:f=>r({...e,caseSet:f.currentTarget.value}),children:[l.jsx("option",{children:"核心回归集"}),l.jsx("option",{children:"安全边界集"}),l.jsx("option",{children:"工具调用集"})]}),l.jsxs("small",{children:[n.length," 条案例"]})]}),l.jsxs("label",{children:[l.jsx("span",{children:"评估器"}),l.jsxs("select",{value:e.evaluator,onChange:f=>r({...e,evaluator:f.currentTarget.value}),children:[l.jsx("option",{children:"综合质量评估器"}),l.jsx("option",{children:"事实一致性评估器"}),l.jsx("option",{children:"工具调用评估器"})]})]}),l.jsxs("label",{children:[l.jsx("span",{children:"并发数"}),l.jsxs("select",{value:e.concurrency,onChange:f=>r({...e,concurrency:f.currentTarget.value}),children:[l.jsx("option",{value:"2",children:"2"}),l.jsx("option",{value:"4",children:"4"}),l.jsx("option",{value:"8",children:"8"})]})]})]})]}),l.jsxs("section",{className:"aw-eval-block",children:[l.jsxs("div",{className:"aw-card-head",children:[l.jsx("strong",{children:"评测指标"}),l.jsxs("span",{children:["已选择 ",e.metrics.length," 项"]})]}),l.jsx("div",{className:"aw-metric-list",children:c.map(f=>l.jsxs("label",{children:[l.jsx("input",{type:"checkbox",checked:e.metrics.includes(f),onChange:()=>d(f)}),l.jsx("span",{children:f})]},f))})]})]})]}):l.jsxs("section",{className:"aw-eval-history",children:[l.jsx("div",{className:"aw-section-head",children:l.jsxs("div",{children:[l.jsx("h3",{children:"历史结果"}),l.jsx("p",{children:"查看该评测组历次运行的总体表现。"})]})}),e.history.length===0?l.jsxs("div",{className:"aw-results-empty",children:[l.jsx("strong",{children:"暂无历史结果"}),l.jsx("span",{children:"完成首次评测后,结果会出现在这里。"})]}):l.jsx("div",{className:"aw-history-list",children:e.history.map((f,h)=>l.jsxs("button",{type:"button",children:[l.jsxs("span",{children:[l.jsxs("strong",{children:["评测运行 #",e.history.length-h]}),l.jsxs("small",{children:[f.createdAt," · ",o.length," 个智能体"]})]}),l.jsxs("span",{className:"aw-history-score",children:[l.jsx("strong",{children:f.score}),l.jsx("small",{children:"综合得分"})]}),l.jsxs("span",{className:"aw-complete",children:[l.jsx(Js,{}),"已完成"]}),l.jsx(ld,{"aria-hidden":!0})]},f.id))})]})})]})}const Rhe={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 Lhe(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 Mhe(e){return typeof e=="object"&&e!==null&&typeof e.path=="string"}function jhe(e){return typeof e=="object"&&e!==null&&typeof e.call=="string"}function Yv(e,t){if(Mhe(e))return Lhe(t,e.path);if(jhe(e)){const n=Rhe[e.call],r={};for(const[s,i]of Object.entries(e.args??{}))r[s]=Yv(i,t);return n?n(r):`[unknown fn: ${e.call}]`}return e}function Dhe(e,t){const n=Yv(e,t);return n==null?"":typeof n=="string"?n:String(n)}const U4=new Map;function Xo(e,t){U4.set(e,t)}function Phe(e){return U4.get(e)}function Bhe(e,t,n){const r=t.replace(/^\//,"").split("/").map(i=>i.replace(/~1/g,"/").replace(/~0/g,"~"));let s=e;for(let i=0;iYv(r,e.dataModel),resolveString:r=>Dhe(r,e.dataModel),dispatchAction:t,render:r=>{if(!r)return null;const s=e.components[r];if(!s)return null;const i=Phe(s.component)??Fhe;return l.jsx(i,{node:s,ctx:n},r)}};return l.jsx("div",{className:"a2ui-surface","data-a2ui-surface":e.surfaceId,children:n.render(e.rootId)})}function $he(e){const t=w.useRef(null),n=w.useRef(!0),r=28,s=w.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 Gv({value:e,onRemoveSkill:t,onRemoveAgent:n}){return e.skills.length===0&&!e.targetAgent?null:l.jsxs("div",{className:"invocation-chips","aria-label":"本轮调用上下文",children:[e.skills.map(r=>l.jsxs("span",{className:"invocation-chip invocation-chip--skill",title:r.description,children:[l.jsx(Lo,{"aria-hidden":!0}),l.jsxs("span",{children:["/",r.name]}),t?l.jsx("button",{type:"button",onClick:()=>t(r.name),"aria-label":`移除技能 ${r.name}`,children:l.jsx(Hr,{})}):null]},r.name)),e.targetAgent?l.jsxs("span",{className:"invocation-chip invocation-chip--agent",title:e.targetAgent.description,children:[l.jsx(_L,{"aria-hidden":!0}),l.jsx("span",{children:e.targetAgent.name}),n?l.jsx("button",{type:"button",onClick:n,"aria-label":`移除 Agent ${e.targetAgent.name}`,children:l.jsx(Hr,{})}):null]}):null]})}function Wv(e=""){return e.startsWith("image/")?"image":e.startsWith("video/")?"video":e==="application/pdf"?"pdf":e==="text/markdown"?"markdown":"text"}function H4(e){var n,r,s,i;const t=Wv(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 z4(e){return e?e<1024?`${e} B`:e<1024*1024?`${Math.round(e/1024)} KB`:`${(e/(1024*1024)).toFixed(1)} MB`:""}function V4(e,t){return e.previewUrl?e.previewUrl:e.data?`data:${e.mimeType??"application/octet-stream"};base64,${e.data}`:e.uri?WL(t,e.uri):""}function Hhe({kind:e}){return e==="image"?l.jsx(IL,{}):e==="video"?l.jsx(AL,{}):e==="pdf"?l.jsx(IH,{}):l.jsx(TL,{})}function qv({appName:e,items:t,compact:n=!1,onRemove:r}){const[s,i]=w.useState(null);return l.jsxs(l.Fragment,{children:[l.jsx("div",{className:`media-grid${n?" media-grid--compact":""}`,children:t.map(a=>{const o=Wv(a.mimeType),c=V4(a,e),u=a.status==="uploading"||a.status==="error"||!c,d=l.jsxs("button",{type:"button",className:"media-card-main",disabled:u,onClick:()=>i(a),"aria-label":`预览 ${a.name??"附件"}`,children:[o==="image"&&c?l.jsx("img",{className:"media-card-image",src:c,alt:a.name??"图片",loading:"lazy"}):o==="video"&&c?l.jsxs("div",{className:"media-card-video-container",children:[l.jsx("video",{className:"media-card-video",src:c,muted:!0,playsInline:!0,preload:"metadata","aria-hidden":"true"}),l.jsx("span",{className:"media-card-video-play",children:l.jsx(qH,{})})]}):l.jsx("span",{className:"media-card-icon",children:l.jsx(Hhe,{kind:o})}),l.jsxs("span",{className:"media-card-copy",children:[l.jsx("span",{className:"media-card-name",children:a.name??"附件"}),l.jsxs("span",{className:"media-card-meta",children:[l.jsx("span",{className:"media-card-type",children:H4(a)}),a.status==="uploading"?l.jsxs(l.Fragment,{children:[l.jsx(Mt,{className:"media-card-spinner"})," 上传中"]}):a.status==="error"?a.error??"上传失败":z4(a.sizeBytes)]})]}),!n&&a.status!=="uploading"&&a.status!=="error"?l.jsx(tc,{className:"media-card-open"}):null]});return l.jsxs(Dt.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?l.jsx(bL,{src:c,children:d}):d,r?l.jsx("button",{type:"button",className:"media-card-remove","aria-label":`移除 ${a.name??"附件"}`,onClick:()=>r(a.id),children:l.jsx(Hr,{})}):null]},a.id)})}),l.jsx($s,{children:s?l.jsx(zhe,{appName:e,item:s,onClose:()=>i(null)}):null})]})}function zhe({appName:e,item:t,onClose:n}){const r=w.useMemo(()=>V4(t,e),[e,t]),s=Wv(t.mimeType),[i,a]=w.useState(""),[o,c]=w.useState(s==="text"||s==="markdown"),[u,d]=w.useState("");return w.useEffect(()=>{const f=h=>{h.key==="Escape"&&n()};return window.addEventListener("keydown",f),()=>window.removeEventListener("keydown",f)},[n]),w.useEffect(()=>{if(s!=="text"&&s!=="markdown")return;const f=new AbortController;return c(!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||c(!1)}),()=>f.abort()},[s,r]),l.jsx(Dt.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:l.jsxs(Dt.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:[l.jsxs("header",{className:"media-viewer-header",children:[l.jsxs("div",{children:[l.jsx("strong",{children:t.name??"附件"}),l.jsxs("span",{children:[H4(t),t.sizeBytes?` · ${z4(t.sizeBytes)}`:""]})]}),l.jsxs("nav",{children:[l.jsx("a",{href:r,download:t.name,"aria-label":"下载",children:l.jsx(Rw,{})}),l.jsx("button",{type:"button",onClick:n,"aria-label":"关闭",children:l.jsx(Hr,{})})]})]}),l.jsxs("div",{className:`media-viewer-body media-viewer-body--${s}`,children:[s==="image"?l.jsx("img",{src:r,alt:t.name??"图片"}):null,s==="video"?l.jsx("div",{className:"media-viewer-video-wrapper",children:l.jsx("video",{src:r,controls:!0,autoPlay:!0,playsInline:!0,preload:"auto",className:"media-viewer-video"})}):null,s==="pdf"?l.jsx("iframe",{src:r,title:t.name??"PDF"}):null,o?l.jsxs("div",{className:"media-viewer-loading",children:[l.jsx(Mt,{})," 正在读取文档…"]}):null,!o&&u?l.jsxs("div",{className:"media-viewer-loading",children:["文档加载失败:",u]}):null,!o&&s==="markdown"?l.jsx("div",{className:"media-document",children:l.jsx(Pf,{text:i})}):null,!o&&s==="text"?l.jsx("pre",{className:"media-document media-document--plain",children:i}):null]})]})})}function Vhe(e){return l.jsxs("svg",{viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"1.75",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",...e,children:[l.jsx("circle",{cx:"10.25",cy:"10.25",r:"6.25"}),l.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 Khe(e){return l.jsxs("svg",{viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"1.75",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",...e,children:[l.jsx("rect",{x:"3.25",y:"5.25",width:"15.5",height:"13.5",rx:"2.25"}),l.jsx("circle",{cx:"8.1",cy:"9.3",r:"1.35"}),l.jsx("path",{d:"m4.7 16.5 3.65-3.7 2.45 2.25 2.2-2.2 4.35 4.1"}),l.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 Yhe(e){return l.jsxs("svg",{viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"1.75",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",...e,children:[l.jsx("rect",{x:"3.25",y:"5.5",width:"16.25",height:"13",rx:"2.4"}),l.jsx("path",{d:"m10.2 9.2 4.4 2.8-4.4 2.8V9.2Z"}),l.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 Ghe(e){return l.jsxs("svg",{viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"1.75",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",...e,children:[l.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"}),l.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"}),l.jsx("path",{d:"M8.2 12.25h.01M8.2 16.8h.01"})]})}function Whe(e){return l.jsxs("svg",{viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"1.75",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",...e,children:[l.jsx("path",{d:"M4.25 4.25h4.5v15.5h-4.5zM8.75 5.75h5v14h-5zM13.75 4.25h4.1v10.25h-4.1z"}),l.jsx("path",{d:"M5.75 7h1.5M10.25 8.25h2M10.25 11h2M15.15 7h1.3"}),l.jsx("circle",{cx:"17.45",cy:"17.35",r:"2.45"}),l.jsx("path",{d:"m19.25 19.15 1.55 1.55"})]})}function qhe(e){return l.jsxs("svg",{viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"1.75",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",...e,children:[l.jsx("path",{d:"M4.25 6.25h6.25c1 0 1.5.55 1.5 1.45v11.05c0-.9-.5-1.45-1.5-1.45H4.25V6.25Z"}),l.jsx("path",{d:"M19.75 9.1v8.2H13.5c-1 0-1.5.55-1.5 1.45V7.7c0-.9.5-1.45 1.5-1.45h2.15"}),l.jsx("path",{d:"m19 3.2.58 1.62 1.62.58-1.62.58L19 7.6l-.58-1.62-1.62-.58 1.62-.58L19 3.2Z",fill:"currentColor",stroke:"none"})]})}function Xhe(e){return l.jsxs("svg",{viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"1.75",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",...e,children:[l.jsx("path",{d:"m4.2 8.4 1.15 10.2h13.3L19.8 8.4"}),l.jsx("path",{d:"M4.2 8.4h15.6L17.9 5H6.1L4.2 8.4Z"}),l.jsx("path",{d:"M7.2 12.2c1.1-1 2.25 1.25 3.4.25 1.05-.9 2.15 1.3 3.3.25"}),l.jsx("path",{d:"m8.2 15.1 1.45 1.35 1.45-1.35M13.55 16.45h2.35"})]})}function K4(e){return l.jsx("svg",{viewBox:"0 0 16 16",fill:"none",stroke:"currentColor",strokeWidth:"1.6",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",...e,children:l.jsx("path",{d:"m6 3.25 4.5 4.75L6 12.75"})})}function Qhe({definition:e,label:t,done:n,open:r,onToggle:s}){const i=e.icon,a=t??(n?e.doneLabel:e.runningLabel);return l.jsxs("button",{type:"button",className:`builtin-tool-head${n?" is-done":" is-running"}`,"data-tool-tone":e.tone,onClick:s,"aria-expanded":r,children:[l.jsx("span",{className:"builtin-tool-icon","aria-hidden":"true",children:l.jsx(i,{})}),n?l.jsx("span",{className:"builtin-tool-label",children:a}):l.jsx(na,{className:"builtin-tool-label",duration:2.4,spread:18,"aria-live":"polite",children:a}),l.jsx(K4,{className:`builtin-tool-chevron${r?" is-open":""}`})]})}const Zhe={web_search:{name:"web_search",runningLabel:"正在进行网络搜索",doneLabel:"已完成网络搜索",tone:"search",icon:Vhe},run_code:{name:"run_code",runningLabel:"正在 AgentKit 沙箱中执行代码",doneLabel:"已在 AgentKit 沙箱中完成代码执行",tone:"sandbox",icon:Xhe},image_generate:{name:"image_generate",runningLabel:"正在生成图片",doneLabel:"已完成图片生成",tone:"image",icon:Khe},video_generate:{name:"video_generate",runningLabel:"正在生成视频",doneLabel:"已完成视频生成",tone:"video",icon:Yhe},load_memory:{name:"load_memory",runningLabel:"正在检索长期记忆",doneLabel:"已完成记忆检索",tone:"memory",icon:Ghe},load_knowledgebase:{name:"load_knowledgebase",runningLabel:"正在检索知识库",doneLabel:"已完成知识库检索",tone:"knowledge",icon:Whe},load_skill:{name:"load_skill",runningLabel:"正在加载技能",doneLabel:"已加载技能",tone:"skill",icon:qhe}};function Jhe(e){return Zhe[e]}const Y4="send_a2ui_json_to_client",epe=28;function tpe(e,t,n){let r=t;for(let s=0;s65535?2:1}return r}function npe(e){return e<=4?1:Math.min(18,Math.max(2,Math.ceil(e/6)))}function G4(e,t,n){const[r,s]=w.useState(()=>t?"":e),i=w.useRef(r),a=w.useRef(e),o=w.useRef(null),c=w.useRef(0),u=w.useRef(n);return a.current=e,u.current=n,w.useEffect(()=>{const d=i.current,f=window.matchMedia("(prefers-reduced-motion: reduce)").matches;if(!t||f||!e.startsWith(d)){o.current!==null&&window.cancelAnimationFrame(o.current),o.current=null,d!==e&&(i.current=e,s(e));return}if(d===e||o.current!==null)return;const h=p=>{const m=a.current,y=i.current;if(!m.startsWith(y)){i.current=m,s(m),o.current=null;return}if(p-c.current{var d;(d=u.current)==null||d.call(u)},[r]),w.useEffect(()=>()=>{o.current!==null&&(window.cancelAnimationFrame(o.current),o.current=null)},[]),r}function rpe({className:e}){return l.jsx("svg",{className:e,viewBox:"0 0 24 24",fill:"currentColor","aria-hidden":!0,children:l.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 spe(){return l.jsx("svg",{viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"1.75",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",children:l.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 ipe(e,t){if(e!=="load_skill"||t==null||typeof t!="object"||Array.isArray(t))return;const n=t.skill_name;if(!(typeof n!="string"||!n.trim()))return`使用 ${n.trim()} 技能`}function W4({text:e,done:t,streaming:n=!1,onStreamFrame:r}){const[s,i]=w.useState(!t),a=w.useRef(!1);w.useEffect(()=>{a.current||i(!t)},[t]);const o=()=>{a.current=!0,i(h=>!h)},c=e.replace(/^\s+/,""),u=G4(c,!t||n,r),{ref:d,onScroll:f}=$he(u);return l.jsxs("div",{className:"block-thinking",children:[l.jsxs("button",{className:"think-head",onClick:o,type:"button",children:[l.jsx("span",{className:"think-icon","aria-hidden":"true",children:l.jsx(rpe,{className:`spark ${t?"":"pulse"}`})}),t?l.jsx("span",{className:"think-label think-label--done",children:"已完成思考"}):l.jsx(na,{className:"think-label",duration:2.4,spread:18,children:"思考中"}),l.jsx(xs,{className:`chev ${s?"open":""}`})]}),l.jsx("div",{className:`think-collapse ${s&&u?"open":""}`,children:l.jsx("div",{className:"think-collapse-inner",children:l.jsx("div",{className:"think-body scroll",ref:d,onScroll:f,children:u})})})]})}function q4(){return l.jsx(W4,{text:"",done:!1})}const ape=w.memo(function({text:t,streaming:n,onStreamFrame:r}){const s=G4(t,n,r);return s?l.jsx("div",{className:"bubble",children:l.jsx(Pf,{text:s})}):null});function ope({name:e,args:t,response:n,done:r}){const[s,i]=w.useState(!1),a=e===Y4?"渲染 UI":e,o=Jhe(e),c=n==null?null:typeof n=="string"?n:JSON.stringify(n,null,2),u=c&&c.length>2e3?c.slice(0,2e3)+` +…(已截断)`:c;return l.jsxs(Dt.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?l.jsx(Qhe,{definition:o,label:ipe(e,t),done:r,open:s,onToggle:()=>i(d=>!d)}):l.jsxs("button",{className:"tool-head tool-head--generic",onClick:()=>i(d=>!d),type:"button","aria-expanded":s,children:[l.jsx("span",{className:"tool-icon tool-icon--generic","aria-hidden":"true",children:l.jsx(spe,{})}),r?l.jsx("span",{className:"tool-name",children:a}):l.jsx(na,{className:"tool-name",duration:2.2,spread:15,children:a}),l.jsx(K4,{className:`tool-chevron${s?" is-open":""}`})]}),l.jsx("div",{className:`think-collapse ${s?"open":""}`,children:l.jsx("div",{className:"think-collapse-inner",children:l.jsxs("div",{className:"tool-detail",children:[t!=null&&l.jsxs("div",{className:"tool-section",children:[l.jsx("div",{className:"tool-section-label",children:"参数"}),l.jsx("pre",{className:"tool-args",children:JSON.stringify(t,null,2)})]}),u!=null&&l.jsxs("div",{className:"tool-section",children:[l.jsx("div",{className:"tool-section-label",children:"返回"}),l.jsx("pre",{className:"tool-args tool-result",children:u})]})]})})})]})}function lpe({block:e,onAuth:t}){const[n,r]=w.useState(e.done?"done":"idle"),[s,i]=w.useState(""),a=e.label||"MCP 工具集",o=(()=>{try{return e.authUri?new URL(e.authUri).host:""}catch{return""}})(),c=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"?l.jsxs(Dt.div,{className:"auth-card-collapsed",initial:{opacity:0},animate:{opacity:1},transition:{duration:.2},children:[l.jsx(hS,{className:"auth-card-icon auth-card-icon--done"}),l.jsxs("span",{children:["已授权 · ",a]})]}):l.jsxs(Dt.div,{className:"auth-card",initial:{opacity:0,y:6},animate:{opacity:1,y:0},transition:{duration:.2,ease:"easeOut"},children:[l.jsxs("div",{className:"auth-card-head",children:[l.jsx(hS,{className:"auth-card-icon"}),l.jsxs("span",{className:"auth-card-title",children:[a," 需要授权"]})]}),l.jsxs("p",{className:"auth-card-desc",children:["工具集 ",l.jsx("code",{className:"auth-card-code",children:a})," 使用 OAuth 保护, 需登录授权后方可调用。",o&&l.jsxs(l.Fragment,{children:[" ","将跳转至 ",l.jsx("code",{className:"auth-card-code",children:o})," 完成登录,"]}),"授权完成后对话自动继续。"]}),l.jsx("button",{className:"auth-card-btn",onClick:c,disabled:n==="authorizing"||!e.authUri,children:n==="authorizing"?l.jsxs(l.Fragment,{children:[l.jsx(Mt,{className:"cw-i spin"})," 等待授权…"]}):l.jsx(l.Fragment,{children:"去授权"})}),!e.authUri&&l.jsx("div",{className:"auth-card-err",children:"未在事件中找到授权地址。"}),s&&l.jsx("div",{className:"auth-card-err",children:s})]})}function Xv({blocks:e,appName:t="",streaming:n=!1,onStreamFrame:r,onAction:s,onAuth:i}){return l.jsx(l.Fragment,{children:e.map((a,o)=>{switch(a.kind){case"thinking":return l.jsx(W4,{text:a.text,done:a.done,streaming:n,onStreamFrame:r},o);case"text":{const c=a.text.replace(/^\s+/,"");return c?l.jsx(ape,{text:c,streaming:n,onStreamFrame:r},o):null}case"attachment":return l.jsx(qv,{appName:t,items:a.files},o);case"invocation":return l.jsx(Gv,{value:a.value},o);case"tool":return a.name===Y4&&a.done?null:l.jsx(ope,{name:a.name,args:a.args,response:a.response,done:a.done},o);case"agent-transfer":return null;case"auth":return l.jsx(lpe,{block:a,onAuth:i},o);case"a2ui":return $4(a.messages).filter(c=>c.components[c.rootId]).map(c=>l.jsx(Dt.div,{initial:{opacity:0,y:8,scale:.985},animate:{opacity:1,y:0,scale:1},transition:{type:"spring",stiffness:380,damping:30},children:l.jsx(Uhe,{surface:c,onAction:s})},`${o}-${c.surfaceId}`));default:return null}})})}function X4(e){return e.isComposing||e.keyCode===229}const cpe="/assets/arkclaw-DG3MhHYM.png",upe="/assets/codex-Csw-JJxq.png",dpe="/assets/hermes-C6L-CfGS.png",Ms=[{value:"agent",label:"Agent",description:"与当前选择的 Agent 对话"},{value:"temporary",label:"内置智能体",description:"使用平台提供的智能体"},{value:"skill-create",label:"创建 Skill",description:"使用两个模型生成并对比 Skill"}],fpe=[{label:"ArkClaw",logo:cpe},{label:"Hermes 智能体",logo:dpe}];function BA({mode:e}){return e==="skill-create"?l.jsxs("svg",{className:"new-chat-mode__skill-icon",viewBox:"0 0 20 20","aria-hidden":"true",children:[l.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"}),l.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"?l.jsxs("svg",{className:"new-chat-mode__temporary-icon",viewBox:"0 0 20 20","aria-hidden":"true",children:[l.jsx("path",{d:"m10 2.8 6.1 3.45v7.5L10 17.2l-6.1-3.45v-7.5L10 2.8Z"}),l.jsx("path",{d:"m3.9 6.25 6.1 3.5 6.1-3.5M10 9.75v7.45"})]}):l.jsx(wc,{className:"new-chat-mode__agent-icon"})}function hpe(){return l.jsx("svg",{className:"new-chat-mode__nested-chevron",viewBox:"0 0 12 12","aria-hidden":"true",children:l.jsx("path",{d:"m4.5 3 3 3-3 3"})})}function ppe({value:e,onChange:t,disabled:n=!1,temporaryEnabled:r,skillCreateEnabled:s}){const[i,a]=w.useState(!1),[o,c]=w.useState(!1),[u,d]=w.useState(()=>Ms.findIndex(k=>k.value===e)),f=w.useRef(null),h=w.useRef(null),p=Ms.find(k=>k.value===e)??Ms[0],m=p.value==="temporary"?"Codex 智能体":p.label;function y(k){return k.value==="temporary"?r:k.value==="skill-create"?s:!0}function E(k){return y(k)!==!0}function g(k){const N=y(k);return N===void 0?"正在检查配置":N?k.description:"管理员未配置"}w.useEffect(()=>{if(!i)return;const k=N=>{var C;(C=f.current)!=null&&C.contains(N.target)||(a(!1),c(!1))};return document.addEventListener("mousedown",k),()=>document.removeEventListener("mousedown",k)},[i]);function x(k){let N=u;do N=(N+k+Ms.length)%Ms.length;while(E(Ms[N]));d(N),c(Ms[N].value==="temporary")}function b(k){var N;if(!E(k)){if(k.value==="temporary"){c(!0);return}t(k.value),a(!1),c(!1),(N=h.current)==null||N.focus()}}function _(){t("temporary"),a(!1),c(!1)}return l.jsxs("div",{className:"new-chat-mode",ref:f,children:[l.jsxs("button",{ref:h,type:"button",className:"new-chat-mode__trigger","aria-label":"选择新会话模式","aria-haspopup":"listbox","aria-expanded":i,disabled:n,onClick:()=>{d(Ms.findIndex(k=>k.value===e)),a(k=>(k&&c(!1),!k))},onKeyDown:k=>{k.key==="ArrowDown"||k.key==="ArrowUp"?(k.preventDefault(),i?x(k.key==="ArrowDown"?1:-1):a(!0)):i&&(k.key==="Enter"||k.key===" ")?(k.preventDefault(),b(Ms[u])):i&&k.key==="Escape"&&(k.preventDefault(),a(!1),c(!1))},children:[l.jsx("span",{className:"new-chat-mode__icon",children:l.jsx(BA,{mode:p.value})}),l.jsx("span",{className:"new-chat-mode__current",title:m,children:m}),l.jsx("svg",{className:"new-chat-mode__chevron",viewBox:"0 0 12 12","aria-hidden":"true",children:l.jsx("path",{d:"m3 4.5 3 3 3-3"})})]}),i?l.jsx("div",{className:"new-chat-mode__menu",role:"listbox","aria-label":"新会话模式",tabIndex:-1,onKeyDown:k=>{var N;k.key==="ArrowDown"||k.key==="ArrowUp"?(k.preventDefault(),x(k.key==="ArrowDown"?1:-1)):k.key==="Enter"?(k.preventDefault(),b(Ms[u])):k.key==="Escape"&&(k.preventDefault(),a(!1),c(!1),(N=h.current)==null||N.focus())},children:Ms.map((k,N)=>{const C=k.value==="temporary";return l.jsxs("button",{type:"button",role:"option","aria-selected":e===k.value,"aria-haspopup":C?"menu":void 0,"aria-expanded":C?o:void 0,"aria-disabled":E(k),disabled:E(k),className:`new-chat-mode__option${N===u?" is-active":""}`,onMouseEnter:()=>{d(N),c(k.value==="temporary")},onClick:()=>b(k),children:[l.jsx("span",{className:"new-chat-mode__option-icon",children:l.jsx(BA,{mode:k.value})}),l.jsxs("span",{className:"new-chat-mode__copy",children:[l.jsxs("span",{className:"new-chat-mode__label",children:[k.label,k.value==="skill-create"?l.jsx("span",{className:"new-chat-mode__beta",children:"Beta"}):null]}),l.jsx("span",{children:g(k)})]}),C?l.jsx(hpe,{}):e===k.value?l.jsx("svg",{className:"new-chat-mode__check",viewBox:"0 0 16 16","aria-hidden":"true",children:l.jsx("path",{d:"m3.5 8.2 2.8 2.8 6.2-6"})}):null]},k.value)})}):null,i&&o?l.jsxs("div",{className:"new-chat-mode__submenu",role:"menu","aria-label":"内置智能体",children:[l.jsxs("button",{type:"button",role:"menuitem",className:"new-chat-mode__submenu-option",onClick:_,children:[l.jsx("img",{className:"new-chat-mode__builtin-icon",src:upe,alt:"","aria-hidden":"true"}),l.jsxs("span",{className:"new-chat-mode__copy",children:[l.jsx("span",{className:"new-chat-mode__label",children:"Codex 智能体"}),l.jsx("span",{children:"在沙箱中执行任务"})]})]}),fpe.map(({label:k,logo:N})=>l.jsxs("button",{type:"button",role:"menuitem",className:"new-chat-mode__submenu-option",disabled:!0,children:[l.jsx("img",{className:"new-chat-mode__builtin-icon",src:N,alt:"","aria-hidden":"true"}),l.jsxs("span",{className:"new-chat-mode__copy",children:[l.jsx("span",{className:"new-chat-mode__label",children:k}),l.jsx("span",{children:"暂不可用"})]})]},k))]}):null]})}const Qv=["doubao-seed-2-0-pro-260215","deepseek-v4-flash-260425"];function mpe(){return l.jsxs("svg",{viewBox:"0 0 20 20",fill:"none","aria-hidden":"true",children:[l.jsx("circle",{cx:"8.2",cy:"8.2",r:"4.7"}),l.jsx("path",{d:"m11.7 11.7 4.1 4.1"}),l.jsx("path",{d:"M14.8 2.7v3.2M13.2 4.3h3.2"}),l.jsx("circle",{cx:"8.2",cy:"8.2",r:"1",fill:"currentColor",stroke:"none"})]})}function gpe(){return l.jsxs("svg",{viewBox:"0 0 20 20",fill:"none","aria-hidden":"true",children:[l.jsx("circle",{cx:"4.2",cy:"15.4",r:"1.4"}),l.jsx("circle",{cx:"15.7",cy:"4.2",r:"1.4"}),l.jsx("path",{d:"M5.7 15.1c3.5-.3 1.8-4.7 5.1-5.1 2.8-.4 2.1-3.7 3.5-4.8"}),l.jsx("path",{d:"m12.7 14.2 1.5 1.5 2.9-3.3"})]})}function ype(){return l.jsxs("svg",{viewBox:"0 0 20 20",fill:"none","aria-hidden":"true",children:[l.jsx("path",{d:"M3.2 5.2h7.1M3.2 9.5h5.2M3.2 13.8h4"}),l.jsx("path",{d:"m10.1 14.8.6-2.8 4.7-4.7 2.2 2.2-4.7 4.7-2.8.6Z"}),l.jsx("path",{d:"M14.5 3.1v2.5M13.2 4.4h2.6"})]})}const bpe=[{icon:mpe,text:"帮我分析一个问题,并给出清晰的解决思路"},{icon:gpe,text:"根据我的目标,制定一份可执行的行动计划"},{icon:ype,text:"帮我整理并润色一段内容,让表达更清晰"}];function Epe({sessionId:e,sessionInitializing:t=!1,appName:n,agentName:r,value:s,onChange:i,onSubmit:a,disabled:o,busy:c,showMeta:u,attachments:d,skills:f,agents:h,invocation:p,capabilitiesLoading:m=!1,allowAttachments:y=!0,onInvocationChange:E,onAddFiles:g,onRemoveAttachment:x,newChatMode:b="agent",newChatLayout:_=!1,showModeSelector:k=!1,onModeChange:N,temporaryEnabled:C,skillCreateEnabled:S}){const A=w.useRef(null),O=w.useRef(null),D=w.useRef(null),F=w.useRef(null),[X,L]=w.useState(!1),[j,T]=w.useState(null),[R,M]=w.useState(0),[B,I]=w.useState(!1);async function V(){if(e)try{await navigator.clipboard.writeText(e),I(!0),setTimeout(()=>I(!1),1500)}catch{I(!1)}}w.useLayoutEffect(()=>{const J=A.current;J&&(J.style.height="auto",J.style.height=`${Math.min(J.scrollHeight,200)}px`)},[s]);const G=b==="skill-create";w.useEffect(()=>{G&&(L(!1),T(null))},[G]);const P=!G&&d.some(J=>J.status!=="ready"),ie=!o&&!c&&!P&&(s.trim().length>0||!G&&d.length>0),q=(j==null?void 0:j.query.toLocaleLowerCase())??"",ne=(j==null?void 0:j.kind)==="skill"?f.filter(J=>!p.skills.some(fe=>fe.name===J.name)).filter(J=>`${J.name} ${J.description}`.toLocaleLowerCase().includes(q)).map(J=>({kind:"skill",value:J})):(j==null?void 0:j.kind)==="agent"?h.filter(J=>`${J.name} ${J.description}`.toLocaleLowerCase().includes(q)).map(J=>({kind:"agent",value:J})):[];function oe(J){var fe;L(!1),T(null),(fe=J.current)==null||fe.click()}function ee(J){i(J),L(!1),T(null),requestAnimationFrame(()=>{var fe,Ee;(fe=A.current)==null||fe.focus(),(Ee=A.current)==null||Ee.setSelectionRange(J.length,J.length)})}function ce(J,fe){const Ee=J.slice(0,fe),Te=/(^|\s)([/@])([^\s/@]*)$/.exec(Ee);if(!Te){T(null);return}const Ge=Te[2].length+Te[3].length,ke={kind:Te[2]==="/"?"skill":"agent",query:Te[3],start:fe-Ge,end:fe},rt=!j||j.kind!==ke.kind||j.query!==ke.query||j.start!==ke.start||j.end!==ke.end;T(ke),rt&&M(0),L(!1)}function re(J){if(!j)return;const fe=s.slice(0,j.start)+s.slice(j.end);i(fe),J.kind==="skill"?E({...p,skills:[...p.skills,J.value]}):E({skills:[],targetAgent:J.value});const Ee=j.start;T(null),requestAnimationFrame(()=>{var Te,Ge;(Te=A.current)==null||Te.focus(),(Ge=A.current)==null||Ge.setSelectionRange(Ee,Ee)})}function pe(){if(p.targetAgent){E({skills:[]});return}p.skills.length>0&&E({...p,skills:p.skills.slice(0,-1)})}function ye(J){const fe=J.target.files?Array.from(J.target.files):[];fe.length&&g(fe),J.target.value=""}return l.jsxs("div",{className:`composer${_?" composer--new-chat":""}${G?" composer--skill-mode":""}`,children:[G?null:l.jsx(Gv,{value:p,onRemoveSkill:J=>E({...p,skills:p.skills.filter(fe=>fe.name!==J)}),onRemoveAgent:()=>E({skills:[]})}),!G&&d.length>0&&l.jsx(qv,{appName:n,compact:!0,items:d,onRemove:x}),l.jsxs("div",{className:"composer-box",children:[j?l.jsxs("div",{className:"composer-command-menu",role:"listbox","aria-label":j.kind==="skill"?"可用技能":"可用子 Agent",children:[l.jsxs("div",{className:"composer-command-head",children:[j.kind==="skill"?l.jsx(Lo,{}):l.jsx(_L,{}),l.jsx("span",{children:j.kind==="skill"?"调用技能":"使用子 Agent"}),l.jsx("kbd",{children:j.kind==="skill"?"/":"@"})]}),m?l.jsxs("div",{className:"composer-command-empty",children:[l.jsx(Mt,{className:"spin"})," 正在读取 Agent 能力…"]}):ne.length===0?l.jsx("div",{className:"composer-command-empty",children:j.kind==="skill"?"当前 Agent 没有匹配技能":"当前 Agent 没有匹配子 Agent"}):l.jsx("div",{className:"composer-command-list",children:ne.map((J,fe)=>l.jsxs("button",{type:"button",role:"option","aria-selected":fe===R,className:`composer-command-item${fe===R?" is-active":""}`,onMouseDown:Ee=>{Ee.preventDefault(),re(J)},onMouseEnter:()=>M(fe),children:[l.jsx("span",{className:`composer-command-icon composer-command-icon--${J.kind}`,children:J.kind==="skill"?l.jsx(Lo,{}):l.jsx(Ro,{})}),l.jsxs("span",{className:"composer-command-copy",children:[l.jsxs("strong",{children:[J.kind==="skill"?"/":"@",J.value.name]}),l.jsx("span",{children:J.value.description||(J.kind==="skill"?"加载并执行该技能":"将本轮交给该 Agent")})]}),l.jsx("kbd",{children:fe===R?"↵":J.kind==="skill"?"技能":"Agent"})]},`${J.kind}-${J.value.name}`))})]}):null,G?null:l.jsxs("div",{className:"composer-menu-wrap",children:[l.jsx("button",{type:"button",className:"comp-icon",title:"添加","aria-label":"添加",disabled:o||!y,onClick:()=>{T(null),L(J=>!J)},children:l.jsx(sr,{className:"icon"})}),X&&l.jsxs(l.Fragment,{children:[l.jsx("div",{className:"menu-scrim",onClick:()=>L(!1)}),l.jsxs("div",{className:"composer-menu",role:"menu",children:[l.jsxs("button",{type:"button",className:"menu-item",onClick:()=>oe(O),children:[l.jsx(IL,{className:"icon"}),"上传图片"]}),l.jsxs("button",{type:"button",className:"menu-item",onClick:()=>oe(D),children:[l.jsx(TL,{className:"icon"}),"上传文档或 PDF"]}),l.jsxs("button",{type:"button",className:"menu-item",onClick:()=>oe(F),children:[l.jsx(AL,{className:"icon"}),"上传视频"]})]})]})]}),k&&N?l.jsx(ppe,{value:b,onChange:N,disabled:c,temporaryEnabled:C,skillCreateEnabled:S}):null,l.jsx("div",{className:"composer-input-stack",children:l.jsx("textarea",{ref:A,className:"comp-input scroll",rows:_?4:1,value:s,disabled:o,placeholder:G?`描述你想创建的 Skill,将使用 ${Qv.join(" 和 ")} 并行创建…`:o?"请在页面左上角选择智能体":`向 ${r} 发消息…`,"aria-expanded":!!j,onChange:J=>{i(J.target.value),G||ce(J.target.value,J.target.selectionStart)},onSelect:J=>{G||ce(J.currentTarget.value,J.currentTarget.selectionStart)},onBlur:()=>setTimeout(()=>T(null),0),onKeyDown:J=>{if(!X4(J.nativeEvent)){if(j){if(J.key==="ArrowDown"&&ne.length>0){J.preventDefault(),M(fe=>(fe+1)%ne.length);return}if(J.key==="ArrowUp"&&ne.length>0){J.preventDefault(),M(fe=>(fe-1+ne.length)%ne.length);return}if((J.key==="Enter"||J.key==="Tab")&&ne[R]){J.preventDefault(),re(ne[R]);return}if(J.key==="Escape"){J.preventDefault(),T(null);return}}if(J.key==="Backspace"&&!s&&J.currentTarget.selectionStart===0&&J.currentTarget.selectionEnd===0){pe();return}J.key==="Enter"&&!J.shiftKey&&(J.preventDefault(),ie&&a())}}})}),l.jsx(Dt.button,{type:"button",className:"comp-send",disabled:!ie,onClick:a,"aria-label":"发送",whileTap:ie?{scale:.9}:void 0,transition:{type:"spring",stiffness:600,damping:22},children:c?l.jsx(Mt,{className:"icon spin"}):l.jsx(vL,{className:"icon"})})]}),_&&b==="agent"&&!s.trim()?l.jsx("div",{className:"prompt-suggestions","aria-label":"快捷提示",children:bpe.map(J=>{const fe=J.icon;return l.jsxs("button",{type:"button",className:"prompt-suggestion",disabled:o||c,onClick:()=>ee(J.text),children:[l.jsx(fe,{}),l.jsx("span",{children:J.text})]},J.text)})}):null,u&&l.jsxs("div",{className:"composer-meta",children:[l.jsxs("span",{className:"composer-session-line",children:["会话 ID:",l.jsx("span",{className:"composer-session-id",title:e||void 0,"aria-live":"polite",children:t?"初始化中":e||"—"}),e&&l.jsx("button",{type:"button",className:"composer-session-copy",title:B?"已复制":"复制会话 ID","aria-label":B?"已复制会话 ID":"复制会话 ID",onClick:()=>void V(),children:B?l.jsx(Js,{}):l.jsx(Ow,{})})]}),l.jsx("span",{className:"composer-meta-separator","aria-hidden":!0,children:"|"}),l.jsx("span",{children:"回答仅供参考"})]}),l.jsx("input",{ref:O,type:"file",accept:"image/*",multiple:!0,hidden:!0,onChange:ye}),l.jsx("input",{ref:D,type:"file",accept:".txt,.md,.markdown,.pdf,text/plain,text/markdown,application/pdf",multiple:!0,hidden:!0,onChange:ye}),l.jsx("input",{ref:F,type:"file",accept:"video/mp4,video/webm,video/quicktime",multiple:!0,hidden:!0,onChange:ye})]})}function Q4({title:e,sub:t,cards:n,footer:r}){return l.jsxs("div",{className:"stk",children:[l.jsxs("div",{className:"stk-head",children:[l.jsx("h1",{className:"stk-title",children:e}),t&&l.jsx("p",{className:"stk-sub",children:t})]}),l.jsx("div",{className:"stk-list",children:n.map((s,i)=>l.jsxs(Dt.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:[l.jsx("span",{className:"stk-card-icon",children:l.jsx(s.icon,{})}),l.jsxs("span",{className:"stk-card-text",children:[l.jsx("span",{className:"stk-card-title",children:s.title}),l.jsx("span",{className:"stk-card-desc",children:s.desc})]}),l.jsx(xs,{className:"stk-card-arrow"})]},s.key))}),r&&l.jsx("div",{className:"stk-footer",children:r})]})}const Zv=Symbol.for("yaml.alias"),VE=Symbol.for("yaml.document"),Pa=Symbol.for("yaml.map"),Z4=Symbol.for("yaml.pair"),vi=Symbol.for("yaml.scalar"),nu=Symbol.for("yaml.seq"),Ss=Symbol.for("yaml.node.type"),ru=e=>!!e&&typeof e=="object"&&e[Ss]===Zv,Kf=e=>!!e&&typeof e=="object"&&e[Ss]===VE,Yf=e=>!!e&&typeof e=="object"&&e[Ss]===Pa,Rn=e=>!!e&&typeof e=="object"&&e[Ss]===Z4,Vt=e=>!!e&&typeof e=="object"&&e[Ss]===vi,Gf=e=>!!e&&typeof e=="object"&&e[Ss]===nu;function In(e){if(e&&typeof e=="object")switch(e[Ss]){case Pa:case nu:return!0}return!1}function On(e){if(e&&typeof e=="object")switch(e[Ss]){case Zv:case Pa:case vi:case nu:return!0}return!1}const J4=e=>(Vt(e)||In(e))&&!!e.anchor,ao=Symbol("break visit"),xpe=Symbol("skip children"),vd=Symbol("remove node");function su(e,t){const n=wpe(t);Kf(e)?Kl(null,e.contents,n,Object.freeze([e]))===vd&&(e.contents=null):Kl(null,e,n,Object.freeze([]))}su.BREAK=ao;su.SKIP=xpe;su.REMOVE=vd;function Kl(e,t,n,r){const s=vpe(e,t,n,r);if(On(s)||Rn(s))return _pe(e,r,s),Kl(e,s,n,r);if(typeof s!="symbol"){if(In(t)){r=Object.freeze(r.concat(t));for(let i=0;ie.replace(/[!,[\]{}]/g,t=>kpe[t]);class _r{constructor(t,n){this.docStart=null,this.docEnd=!1,this.yaml=Object.assign({},_r.defaultYaml,t),this.tags=Object.assign({},_r.defaultTags,n)}clone(){const t=new _r(this.yaml,this.tags);return t.docStart=this.docStart,t}atDocument(){const t=new _r(this.yaml,this.tags);switch(this.yaml.version){case"1.1":this.atNextDocument=!0;break;case"1.2":this.atNextDocument=!1,this.yaml={explicit:_r.defaultYaml.explicit,version:"1.2"},this.tags=Object.assign({},_r.defaultTags);break}return t}add(t,n){this.atNextDocument&&(this.yaml={explicit:_r.defaultYaml.explicit,version:"1.1"},this.tags=Object.assign({},_r.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+Npe(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&&On(t.contents)){const i={};su(t.contents,(a,o)=>{On(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(` +`)}}_r.defaultYaml={explicit:!1,version:"1.2"};_r.defaultTags={"!!":"tag:yaml.org,2002:"};function e6(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 t6(e){const t=new Set;return su(e,{Value(n,r){r.anchor&&t.add(r.anchor)}}),t}function n6(e,t){for(let n=1;;++n){const r=`${e}${n}`;if(!t.has(r))return r}}function Spe(e,t){const n=[],r=new Map;let s=null;return{onAnchor:i=>{n.push(i),s??(s=t6(e));const a=n6(t,s);return s.add(a),a},setAnchors:()=>{for(const i of n){const a=r.get(i);if(typeof a=="object"&&a.anchor&&(Vt(a.node)||In(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 Yl(e,t,n,r){if(r&&typeof r=="object")if(Array.isArray(r))for(let s=0,i=r.length;svs(r,String(s),n));if(e&&typeof e.toJSON=="function"){if(!n||!J4(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 Jv{constructor(t){Object.defineProperty(this,Ss,{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(!Kf(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=vs(this,"",a);if(typeof s=="function")for(const{count:c,res:u}of a.anchors.values())s(u,c);return typeof i=="function"?Yl(i,{"":o},"",o):o}}class e_ extends Jv{constructor(t){super(Zv),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=[],su(t,{Node:(i,a)=>{(ru(a)||J4(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 c=`Unresolved alias (the anchor must be set before the alias): ${this.source}`;throw new ReferenceError(c)}let o=r.get(a);if(o||(vs(a,null,n),o=r.get(a)),(o==null?void 0:o.res)===void 0){const c="This should not happen: Alias anchor was not resolved?";throw new ReferenceError(c)}if(i>=0&&(o.count+=1,o.aliasCount===0&&(o.aliasCount=Hp(s,a,r)),o.count*o.aliasCount>i)){const c="Excessive alias count indicates a resource exhaustion attack";throw new ReferenceError(c)}return o.res}toString(t,n,r){const s=`*${this.source}`;if(t){if(e6(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 Hp(e,t,n){if(ru(t)){const r=t.resolve(e),s=n&&r&&n.get(r);return s?s.count*s.aliasCount:0}else if(In(t)){let r=0;for(const s of t.items){const i=Hp(e,s,n);i>r&&(r=i)}return r}else if(Rn(t)){const r=Hp(e,t.key,n),s=Hp(e,t.value,n);return Math.max(r,s)}return 1}const r6=e=>!e||typeof e!="function"&&typeof e!="object";class ot extends Jv{constructor(t){super(vi),this.value=t}toJSON(t,n){return n!=null&&n.keep?this.value:vs(this.value,t,n)}toString(){return String(this.value)}}ot.BLOCK_FOLDED="BLOCK_FOLDED";ot.BLOCK_LITERAL="BLOCK_LITERAL";ot.PLAIN="PLAIN";ot.QUOTE_DOUBLE="QUOTE_DOUBLE";ot.QUOTE_SINGLE="QUOTE_SINGLE";const Tpe="tag:yaml.org,2002:";function Ape(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 mf(e,t,n){var f,h,p;if(Kf(e)&&(e=e.contents),On(e))return e;if(Rn(e)){const m=(h=(f=n.schema[Pa]).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 c;if(r&&e&&typeof e=="object"){if(c=o.get(e),c)return c.anchor??(c.anchor=s(e)),new e_(c.anchor);c={anchor:null,node:null},o.set(e,c)}t!=null&&t.startsWith("!!")&&(t=Tpe+t.slice(2));let u=Ape(e,t,a.tags);if(!u){if(e&&typeof e.toJSON=="function"&&(e=e.toJSON()),!e||typeof e!="object"){const m=new ot(e);return c&&(c.node=m),m}u=e instanceof Map?a[Pa]:Symbol.iterator in Object(e)?a[nu]:a[Pa]}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 ot(e);return t?d.tag=t:u.default||(d.tag=u.tag),c&&(c.node=d),d}function tg(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 mf(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 Gu=e=>e==null||typeof e=="object"&&!!e[Symbol.iterator]().next().done;class s6 extends Jv{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=>On(r)||Rn(r)?r.clone(t):r),this.range&&(n.range=this.range.slice()),n}addIn(t,n){if(Gu(t))this.add(n);else{const[r,...s]=t,i=this.get(r,!0);if(In(i))i.addIn(s,n);else if(i===void 0&&this.schema)this.set(r,tg(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(In(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&&Vt(i)?i.value:i:In(i)?i.getIn(s,n):void 0}hasAllNullValues(t){return this.items.every(n=>{if(!Rn(n))return!1;const r=n.value;return r==null||t&&Vt(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 In(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(In(i))i.setIn(s,n);else if(i===void 0&&this.schema)this.set(r,tg(this.schema,s,n));else throw new Error(`Expected YAML collection at ${r}. Remaining path: ${s}`)}}}const Cpe=e=>e.replace(/^(?!$)(?: $)?/gm,"#");function Ki(e,t){return/^\n+$/.test(e)?e.substring(1):t?e.replace(/^(?! *$)/gm,t):e}const yo=(e,t,n)=>e.endsWith(` +`)?Ki(n,t):n.includes(` +`)?` +`+Ki(n,t):(e.endsWith(" ")?"":" ")+n,i6="flow",KE="block",zp="quoted";function h0(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,E=-1,g=-1;n===KE&&(y=FA(e,y,t.length),y!==-1&&(f=y+c));for(let b;b=e[y+=1];){if(n===zp&&b==="\\"){switch(E=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===KE&&(y=FA(e,y,t.length)),f=y+t.length+c,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+c,h=void 0;else if(n===zp){for(;p===" "||p===" ";)p=b,b=e[y+=1],m=!0;const _=y>g+1?y-2:E-1;if(d[_])return e;u.push(_),d[_]=!0,f=_+c,h=void 0}else m=!0}p=b}if(m&&o&&o(),u.length===0)return e;a&&a();let x=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}),m0=e=>/^(%|---|\.\.\.)/m.test(e);function Ipe(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 _d(e,t){const n=JSON.stringify(e);if(t.options.doubleQuotedAsJSON)return n;const{implicitKey:r}=t,s=t.options.doubleQuotedMinMultiLineLength,i=t.indent||(m0(e)?" ":"");let a="",o=0;for(let c=0,u=n[c];u;u=n[++c])if(u===" "&&n[c+1]==="\\"&&n[c+2]==="n"&&(a+=n.slice(o,c)+"\\ ",c+=1,o=c,u="\\"),u==="\\")switch(n[c+1]){case"u":{a+=n.slice(o,c);const d=n.substr(c+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(c,6)}c+=5,o=c+1}break;case"n":if(r||n[c+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(` +`);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(GE,`$&${u}`));let y=!1,E,g=-1;for(E=0;E{N=!0});const S=h0(`${x}${k}${p}`,u,KE,C);if(!N)return`>${_} +${u}${S}`}return n=n.replace(/\n+/g,`$&${u}`),`|${_} +${u}${x}${n}${p}`}function Ope(e,t,n,r){const{type:s,value:i}=e,{actualString:a,implicitKey:o,indent:c,indentStep:u,inFlow:d}=t;if(o&&i.includes(` +`)||d&&/[[\]{},]/.test(i))return Gl(i,t);if(/^[\n\t ,[\]{}#&*!|>'"%@`]|^[?-]$|^[?-][ \t]|[\n:][ \t]|[ \t]\n|[\n\t ]#|[\n\t :]$/.test(i))return o||d||!i.includes(` +`)?Gl(i,t):Vp(e,t,n,r);if(!o&&!d&&s!==ot.PLAIN&&i.includes(` +`))return Vp(e,t,n,r);if(m0(i)){if(c==="")return t.forceBlockIndent=!0,Vp(e,t,n,r);if(o&&c===u)return Gl(i,t)}const f=i.replace(/\n+/g,`$& +${c}`);if(a){const h=y=>{var E;return y.default&&y.tag!=="tag:yaml.org,2002:str"&&((E=y.test)==null?void 0:E.test(f))},{compat:p,tags:m}=t.doc.schema;if(m.some(h)||p!=null&&p.some(h))return Gl(i,t)}return o?f:h0(f,c,i6,p0(t,!1))}function t_(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!==ot.QUOTE_DOUBLE&&/[\x00-\x08\x0b-\x1f\x7f-\x9f\u{D800}-\u{DFFF}]/u.test(a.value)&&(o=ot.QUOTE_DOUBLE);const c=d=>{switch(d){case ot.BLOCK_FOLDED:case ot.BLOCK_LITERAL:return s||i?Gl(a.value,t):Vp(a,t,n,r);case ot.QUOTE_DOUBLE:return _d(a.value,t);case ot.QUOTE_SINGLE:return YE(a.value,t);case ot.PLAIN:return Ope(a,t,n,r);default:return null}};let u=c(o);if(u===null){const{defaultKeyType:d,defaultStringType:f}=t.options,h=s&&d||f;if(u=c(h),u===null)throw new Error(`Unsupported default string type ${h}`)}return u}function a6(e,t){const n=Object.assign({blockQuote:!0,commentString:Cpe,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 Rpe(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(Vt(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 Lpe(e,t,{anchors:n,doc:r}){if(!r.directives)return"";const s=[],i=(Vt(e)||In(e))&&e.anchor;i&&e6(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 Uc(e,t,n,r){var c;if(Rn(e))return e.toString(t,n,r);if(ru(e)){if(t.doc.directives)return e.toString(t);if((c=t.resolvedAliases)!=null&&c.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=On(e)?e:t.doc.createNode(e,{onTagObj:u=>s=u});s??(s=Rpe(t.doc.schema.tags,i));const a=Lpe(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):Vt(i)?t_(i,t,n,r):i.toString(t,n,r);return a?Vt(i)||o[0]==="{"||o[0]==="["?`${a} ${o}`:`${a} +${t.indent}${o}`:o}function Mpe({key:e,value:t},n,r,s){const{allNullValues:i,doc:a,indent:o,indentStep:c,options:{commentString:u,indentSeq:d,simpleKeys:f}}=n;let h=On(e)&&e.comment||null;if(f){if(h)throw new Error("With simple keys, key nodes cannot have comments");if(In(e)||!On(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||In(e)||(Vt(e)?e.type===ot.BLOCK_FOLDED||e.type===ot.BLOCK_LITERAL:typeof e=="object"));n=Object.assign({},n,{allNullValues:!1,implicitKey:!p&&(f||!i),indent:o+c});let m=!1,y=!1,E=Uc(e,n,()=>m=!0,()=>y=!0);if(!p&&!n.inFlow&&E.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(),E===""?"?":p?`? ${E}`:E}else if(i&&!f||t==null&&p)return E=`? ${E}`,h&&!m?E+=yo(E,n.indent,u(h)):y&&s&&s(),E;m&&(h=null),p?(h&&(E+=yo(E,n.indent,u(h))),E=`? ${E} +${o}:`):(E=`${E}:`,h&&(E+=yo(E,n.indent,u(h))));let g,x,b;On(t)?(g=!!t.spaceBefore,x=t.commentBefore,b=t.comment):(g=!1,x=null,b=null,t&&typeof t=="object"&&(t=a.createNode(t))),n.implicitKey=!1,!p&&!h&&Vt(t)&&(n.indentAtStart=E.length+1),y=!1,!d&&c.length>=2&&!n.inFlow&&!p&&Gf(t)&&!t.flow&&!t.tag&&!t.anchor&&(n.indent=n.indent.substring(2));let _=!1;const k=Uc(t,n,()=>_=!0,()=>y=!0);let N=" ";if(h||g||x){if(N=g?` +`:"",x){const C=u(x);N+=` +${Ki(C,n.indent)}`}k===""&&!n.inFlow?N===` +`&&b&&(N=` + +`):N+=` +${n.indent}`}else if(!p&&In(t)){const C=k[0],S=k.indexOf(` +`),A=S!==-1,O=n.inFlow??t.flow??t.items.length===0;if(A||!O){let D=!1;if(A&&(C==="&"||C==="!")){let F=k.indexOf(" ");C==="&"&&F!==-1&&Fe===sp||typeof e=="symbol"&&e.description===sp,default:"key",tag:"tag:yaml.org,2002:merge",test:/^<<$/,resolve:()=>Object.assign(new ot(Symbol(sp)),{addToJSMap:l6}),stringify:()=>sp},jpe=(e,t)=>(qi.identify(t)||Vt(t)&&(!t.type||t.type===ot.PLAIN)&&qi.identify(t.value))&&(e==null?void 0:e.doc.schema.tags.some(n=>n.tag===qi.tag&&n.default));function l6(e,t,n){const r=c6(e,n);if(Gf(r))for(const s of r.items)ob(e,t,s);else if(Array.isArray(r))for(const s of r)ob(e,t,s);else ob(e,t,r)}function ob(e,t,n){const r=c6(e,n);if(!Yf(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 c6(e,t){return e&&ru(t)?t.resolve(e.doc,e):t}function u6(e,t,{key:n,value:r}){if(On(n)&&n.addToJSMap)n.addToJSMap(e,t,r);else if(jpe(e,n))l6(e,t,r);else{const s=vs(n,"",e);if(t instanceof Map)t.set(s,vs(r,s,e));else if(t instanceof Set)t.add(s);else{const i=Dpe(n,s,e),a=vs(r,i,e);i in t?Object.defineProperty(t,i,{value:a,writable:!0,enumerable:!0,configurable:!0}):t[i]=a}}return t}function Dpe(e,t,n){if(t===null)return"";if(typeof t!="object")return String(t);if(On(e)&&(n!=null&&n.doc)){const r=a6(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)+'..."'),o6(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 n_(e,t,n){const r=mf(e,void 0,n),s=mf(t,void 0,n);return new Tr(r,s)}class Tr{constructor(t,n=null){Object.defineProperty(this,Ss,{value:Z4}),this.key=t,this.value=n}clone(t){let{key:n,value:r}=this;return On(n)&&(n=n.clone(t)),On(r)&&(r=r.clone(t)),new Tr(n,r)}toJSON(t,n){const r=n!=null&&n.mapAsMap?new Map:{};return u6(n,r,this)}toString(t,n,r){return t!=null&&t.doc?Mpe(this,t,n,r):JSON.stringify(this)}}function d6(e,t,n){return(t.inFlow??e.flow?Bpe:Ppe)(e,t,n)}function Ppe({comment:e,items:t},n,{blockItemPrefix:r,flowChars:s,itemIndent:i,onChompKeep:a,onComment:o}){const{indent:c,options:{commentString:u}}=n,d=Object.assign({},n,{indent:i,type:null});let f=!1;const h=[];for(let m=0;mE=null,()=>f=!0);E&&(g+=yo(g,i,u(E))),f&&E&&(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=null);u||(u=f.length>d||g.includes(` +`)),m0&&(u||(u=f.reduce((x,b)=>x+b.length+2,2)+(g.length+2)>t.options.lineWidth)),u&&(g+=",")),E&&(g+=yo(g,r,o(E))),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,E)=>y+E.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 ng({indent:e,options:{commentString:t}},n,r,s){if(r&&s&&(r=r.replace(/^\n+/,"")),r){const i=Ki(t(r),e);n.push(i.trimStart())}}function bo(e,t){const n=Vt(t)?t.value:t;for(const r of e)if(Rn(r)&&(r.key===t||r.key===n||Vt(r.key)&&r.key.value===n))return r}class bs extends s6{static get tagName(){return"tag:yaml.org,2002:map"}constructor(t){super(Pa,t),this.items=[]}static from(t,n,r){const{keepUndefined:s,replacer:i}=r,a=new this(t),o=(c,u)=>{if(typeof i=="function")u=i.call(n,c,u);else if(Array.isArray(i)&&!i.includes(c))return;(u!==void 0||s)&&a.items.push(n_(c,u,r))};if(n instanceof Map)for(const[c,u]of n)o(c,u);else if(n&&typeof n=="object")for(const c of Object.keys(n))o(c,n[c]);return typeof t.sortMapEntries=="function"&&a.items.sort(t.sortMapEntries),a}add(t,n){var a;let r;Rn(t)?r=t:!t||typeof t!="object"||!("key"in t)?r=new Tr(t,t==null?void 0:t.value):r=new Tr(t.key,t.value);const s=bo(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`);Vt(s.value)&&r6(r.value)?s.value.value=r.value:s.value=r.value}else if(i){const o=this.items.findIndex(c=>i(r,c)<0);o===-1?this.items.push(r):this.items.splice(o,0,r)}else this.items.push(r)}delete(t){const n=bo(this.items,t);return n?this.items.splice(this.items.indexOf(n),1).length>0:!1}get(t,n){const r=bo(this.items,t),s=r==null?void 0:r.value;return(!n&&Vt(s)?s.value:s)??void 0}has(t){return!!bo(this.items,t)}set(t,n){this.add(new Tr(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)u6(n,s,i);return s}toString(t,n,r){if(!t)return JSON.stringify(this);for(const s of this.items)if(!Rn(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})),d6(this,t,{blockItemPrefix:"",flowChars:{start:"{",end:"}"},itemIndent:t.indent||"",onChompKeep:r,onComment:n})}}const iu={collection:"map",default:!0,nodeClass:bs,tag:"tag:yaml.org,2002:map",resolve(e,t){return Yf(e)||t("Expected a mapping for this tag"),e},createNode:(e,t,n)=>bs.from(e,t,n)};class $o extends s6{static get tagName(){return"tag:yaml.org,2002:seq"}constructor(t){super(nu,t),this.items=[]}add(t){this.items.push(t)}delete(t){const n=ip(t);return typeof n!="number"?!1:this.items.splice(n,1).length>0}get(t,n){const r=ip(t);if(typeof r!="number")return;const s=this.items[r];return!n&&Vt(s)?s.value:s}has(t){const n=ip(t);return typeof n=="number"&&n=0?t:null}const au={collection:"seq",default:!0,nodeClass:$o,tag:"tag:yaml.org,2002:seq",resolve(e,t){return Gf(e)||t("Expected a sequence for this tag"),e},createNode:(e,t,n)=>$o.from(e,t,n)},g0={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),t_(e,t,n,r)}},y0={identify:e=>e==null,createNode:()=>new ot(null),default:!0,tag:"tag:yaml.org,2002:null",test:/^(?:~|[Nn]ull|NULL)?$/,resolve:()=>new ot(null),stringify:({source:e},t)=>typeof e=="string"&&y0.test.test(e)?e:t.options.nullStr},r_={identify:e=>typeof e=="boolean",default:!0,tag:"tag:yaml.org,2002:bool",test:/^(?:[Tt]rue|TRUE|[Ff]alse|FALSE)$/,resolve:e=>new ot(e[0]==="t"||e[0]==="T"),stringify({source:e,value:t},n){if(e&&r_.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 ni({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 f6={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:ni},h6={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():ni(e)}},p6={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 ot(parseFloat(e)),n=e.indexOf(".");return n!==-1&&e[e.length-1]==="0"&&(t.minFractionDigits=e.length-n-1),t},stringify:ni},b0=e=>typeof e=="bigint"||Number.isInteger(e),s_=(e,t,n,{intAsBigInt:r})=>r?BigInt(e):parseInt(e.substring(t),n);function m6(e,t,n){const{value:r}=e;return b0(r)&&r>=0?n+r.toString(t):ni(e)}const g6={identify:e=>b0(e)&&e>=0,default:!0,tag:"tag:yaml.org,2002:int",format:"OCT",test:/^0o[0-7]+$/,resolve:(e,t,n)=>s_(e,2,8,n),stringify:e=>m6(e,8,"0o")},y6={identify:b0,default:!0,tag:"tag:yaml.org,2002:int",test:/^[-+]?[0-9]+$/,resolve:(e,t,n)=>s_(e,0,10,n),stringify:ni},b6={identify:e=>b0(e)&&e>=0,default:!0,tag:"tag:yaml.org,2002:int",format:"HEX",test:/^0x[0-9a-fA-F]+$/,resolve:(e,t,n)=>s_(e,2,16,n),stringify:e=>m6(e,16,"0x")},Fpe=[iu,au,g0,y0,r_,g6,y6,b6,f6,h6,p6];function UA(e){return typeof e=="bigint"||Number.isInteger(e)}const ap=({value:e})=>JSON.stringify(e),Upe=[{identify:e=>typeof e=="string",default:!0,tag:"tag:yaml.org,2002:str",resolve:e=>e,stringify:ap},{identify:e=>e==null,createNode:()=>new ot(null),default:!0,tag:"tag:yaml.org,2002:null",test:/^null$/,resolve:()=>null,stringify:ap},{identify:e=>typeof e=="boolean",default:!0,tag:"tag:yaml.org,2002:bool",test:/^true$|^false$/,resolve:e=>e==="true",stringify:ap},{identify:UA,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})=>UA(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:ap}],$pe={default:!0,tag:"",test:/^/,resolve(e,t){return t(`Unresolved plain scalar ${JSON.stringify(e)}`),e}},Hpe=[iu,au].concat(Upe,$pe),i_={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 Tr(new ot(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]=Rn(r)?r:new Tr(r)}}else t("Expected a sequence for this tag");return e}function x6(e,t,n){const{replacer:r}=n,s=new $o(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,c;if(Array.isArray(a))if(a.length===2)o=a[0],c=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],c=a[o];else throw new TypeError(`Expected tuple with one key, not ${u.length} keys`)}else o=a;s.items.push(n_(o,c,n))}return s}const a_={collection:"seq",default:!1,tag:"tag:yaml.org,2002:pairs",resolve:E6,createNode:x6};class ic extends $o{constructor(){super(),this.add=bs.prototype.add.bind(this),this.delete=bs.prototype.delete.bind(this),this.get=bs.prototype.get.bind(this),this.has=bs.prototype.has.bind(this),this.set=bs.prototype.set.bind(this),this.tag=ic.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(Rn(s)?(i=vs(s.key,"",n),a=vs(s.value,i,n)):i=vs(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=x6(t,n,r),i=new this;return i.items=s.items,i}}ic.tag="tag:yaml.org,2002:omap";const o_={collection:"seq",identify:e=>e instanceof Map,nodeClass:ic,default:!1,tag:"tag:yaml.org,2002:omap",resolve(e,t){const n=E6(e,t),r=[];for(const{key:s}of n.items)Vt(s)&&(r.includes(s.value)?t(`Ordered maps must not include duplicate keys: ${s.value}`):r.push(s.value));return Object.assign(new ic,n)},createNode:(e,t,n)=>ic.from(e,t,n)};function w6({value:e,source:t},n){return t&&(e?v6:_6).test.test(t)?t:e?n.options.trueStr:n.options.falseStr}const v6={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 ot(!0),stringify:w6},_6={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 ot(!1),stringify:w6},zpe={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:ni},Vpe={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():ni(e)}},Kpe={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 ot(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:ni},Wf=e=>typeof e=="bigint"||Number.isInteger(e);function E0(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 l_(e,t,n){const{value:r}=e;if(Wf(r)){const s=r.toString(t);return r<0?"-"+n+s.substr(1):n+s}return ni(e)}const Ype={identify:Wf,default:!0,tag:"tag:yaml.org,2002:int",format:"BIN",test:/^[-+]?0b[0-1_]+$/,resolve:(e,t,n)=>E0(e,2,2,n),stringify:e=>l_(e,2,"0b")},Gpe={identify:Wf,default:!0,tag:"tag:yaml.org,2002:int",format:"OCT",test:/^[-+]?0[0-7_]+$/,resolve:(e,t,n)=>E0(e,1,8,n),stringify:e=>l_(e,8,"0")},Wpe={identify:Wf,default:!0,tag:"tag:yaml.org,2002:int",test:/^[-+]?[0-9][0-9_]*$/,resolve:(e,t,n)=>E0(e,0,10,n),stringify:ni},qpe={identify:Wf,default:!0,tag:"tag:yaml.org,2002:int",format:"HEX",test:/^[-+]?0x[0-9a-fA-F_]+$/,resolve:(e,t,n)=>E0(e,2,16,n),stringify:e=>l_(e,16,"0x")};class ac extends bs{constructor(t){super(t),this.tag=ac.tag}add(t){let n;Rn(t)?n=t:t&&typeof t=="object"&&"key"in t&&"value"in t&&t.value===null?n=new Tr(t.key,null):n=new Tr(t,null),bo(this.items,n.key)||this.items.push(n)}get(t,n){const r=bo(this.items,t);return!n&&Rn(r)?Vt(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=bo(this.items,t);r&&!n?this.items.splice(this.items.indexOf(r),1):!r&&n&&this.items.push(new Tr(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(n_(a,null,r));return i}}ac.tag="tag:yaml.org,2002:set";const c_={collection:"map",identify:e=>e instanceof Set,nodeClass:ac,default:!1,tag:"tag:yaml.org,2002:set",createNode:(e,t,n)=>ac.from(e,t,n),resolve(e,t){if(Yf(e)){if(e.hasAllNullValues(!0))return Object.assign(new ac,e);t("Set items must all have null values")}else t("Expected a mapping for this tag");return e}};function u_(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 k6(e){let{value:t}=e,n=a=>a;if(typeof t=="bigint")n=a=>BigInt(a);else if(isNaN(t)||!isFinite(t))return ni(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 N6={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})=>u_(e,n),stringify:k6},S6={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=>u_(e,!1),stringify:k6},x0={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(x0.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),c=t[7]?Number((t[7]+"00").substr(1,3)):0;let u=Date.UTC(n,r-1,s,i||0,a||0,o||0,c);const d=t[8];if(d&&d!=="Z"){let f=u_(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$/,""))??""},$A=[iu,au,g0,y0,v6,_6,Ype,Gpe,Wpe,qpe,zpe,Vpe,Kpe,i_,qi,o_,a_,c_,N6,S6,x0],HA=new Map([["core",Fpe],["failsafe",[iu,au,g0]],["json",Hpe],["yaml11",$A],["yaml-1.1",$A]]),zA={binary:i_,bool:r_,float:p6,floatExp:h6,floatNaN:f6,floatTime:S6,int:y6,intHex:b6,intOct:g6,intTime:N6,map:iu,merge:qi,null:y0,omap:o_,pairs:a_,seq:au,set:c_,timestamp:x0},Xpe={"tag:yaml.org,2002:binary":i_,"tag:yaml.org,2002:merge":qi,"tag:yaml.org,2002:omap":o_,"tag:yaml.org,2002:pairs":a_,"tag:yaml.org,2002:set":c_,"tag:yaml.org,2002:timestamp":x0};function lb(e,t,n){const r=HA.get(t);if(r&&!e)return n&&!r.includes(qi)?r.concat(qi):r.slice();let s=r;if(!s)if(Array.isArray(e))s=[];else{const i=Array.from(HA.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(qi)),s.reduce((i,a)=>{const o=typeof a=="string"?zA[a]:a;if(!o){const c=JSON.stringify(a),u=Object.keys(zA).map(d=>JSON.stringify(d)).join(", ");throw new Error(`Unknown custom tag ${c}; use one of ${u}`)}return i.includes(o)||i.push(o),i},[])}const Qpe=(e,t)=>e.keyt.key?1:0;class d_{constructor({compat:t,customTags:n,merge:r,resolveKnownTags:s,schema:i,sortMapEntries:a,toStringDefaults:o}){this.compat=Array.isArray(t)?lb(t,"compat"):t?lb(null,t):null,this.name=typeof i=="string"&&i||"core",this.knownTags=s?Xpe:{},this.tags=lb(n,this.name,r),this.toStringOptions=o??null,Object.defineProperty(this,Pa,{value:iu}),Object.defineProperty(this,vi,{value:g0}),Object.defineProperty(this,nu,{value:au}),this.sortMapEntries=typeof a=="function"?a:a===!0?Qpe:null}clone(){const t=Object.create(d_.prototype,Object.getOwnPropertyDescriptors(this));return t.tags=this.tags.slice(),t}}function Zpe(e,t){var c;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=a6(e,t),{commentString:i}=s.options;if(e.commentBefore){n.length!==1&&n.unshift("");const u=i(e.commentBefore);n.unshift(Ki(u,""))}let a=!1,o=null;if(e.contents){if(On(e.contents)){if(e.contents.spaceBefore&&r&&n.push(""),e.contents.commentBefore){const f=i(e.contents.commentBefore);n.push(Ki(f,""))}s.forceBlockIndent=!!e.comment,o=e.contents.comment}const u=o?void 0:()=>a=!0;let d=Uc(e.contents,s,()=>o=null,u);o&&(d+=yo(d,"",i(o))),(d[0]==="|"||d[0]===">")&&n[n.length-1]==="---"?n[n.length-1]=`--- ${d}`:n.push(d)}else n.push(Uc(e.contents,s));if((c=e.directives)!=null&&c.docEnd)if(e.comment){const u=i(e.comment);u.includes(` +`)?(n.push("..."),n.push(Ki(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(Ki(i(u),"")))}return n.join(` +`)+` +`}class qf{constructor(t,n,r){this.commentBefore=null,this.comment=null,this.errors=[],this.warnings=[],Object.defineProperty(this,Ss,{value:VE});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 _r({version:a}),this.setSchema(a,r),this.contents=t===void 0?null:this.createNode(t,s,r)}clone(){const t=Object.create(qf.prototype,{[Ss]:{value:VE}});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=On(this.contents)?this.contents.clone(t.schema):this.contents,this.range&&(t.range=this.range.slice()),t}add(t){pl(this.contents)&&this.contents.add(t)}addIn(t,n){pl(this.contents)&&this.contents.addIn(t,n)}createAlias(t,n){if(!t.anchor){const r=t6(this);t.anchor=!n||r.has(n)?n6(n||"a",r):n}return new e_(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 E=x=>typeof x=="number"||x instanceof String||x instanceof Number,g=n.filter(E).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:c,onTagObj:u,tag:d}=r??{},{onAnchor:f,setAnchors:h,sourceObjects:p}=Spe(this,a||"a"),m={aliasDuplicateObjects:i??!0,keepUndefined:c??!1,onAnchor:f,onTagObj:u,replacer:s,schema:this.schema,sourceObjects:p},y=mf(t,d,m);return o&&In(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 Tr(s,i)}delete(t){return pl(this.contents)?this.contents.delete(t):!1}deleteIn(t){return Gu(t)?this.contents==null?!1:(this.contents=null,!0):pl(this.contents)?this.contents.deleteIn(t):!1}get(t,n){return In(this.contents)?this.contents.get(t,n):void 0}getIn(t,n){return Gu(t)?!n&&Vt(this.contents)?this.contents.value:this.contents:In(this.contents)?this.contents.getIn(t,n):void 0}has(t){return In(this.contents)?this.contents.has(t):!1}hasIn(t){return Gu(t)?this.contents!==void 0:In(this.contents)?this.contents.hasIn(t):!1}set(t,n){this.contents==null?this.contents=tg(this.schema,[t],n):pl(this.contents)&&this.contents.set(t,n)}setIn(t,n){Gu(t)?this.contents=n:this.contents==null?this.contents=tg(this.schema,Array.from(t),n):pl(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 _r({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 _r({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 d_(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},c=vs(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"?Yl(a,{"":c},"",c):c}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 Zpe(this,t)}}function pl(e){if(In(e))return!0;throw new Error("Expected a YAML collection as document contents")}class T6 extends Error{constructor(t,n,r,s){super(),this.name=t,this.code=r,this.message=s,this.pos=n}}class Wu extends T6{constructor(t,n,r){super("YAMLParseError",t,n,r)}}class Jpe extends T6{constructor(t,n,r){super("YAMLWarning",t,n,r)}}const VA=(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 c=n.linePos[1];(c==null?void 0:c.line)===r&&c.col>s&&(o=Math.max(1,Math.min(c.col-s,80-i)));const u=" ".repeat(i)+"^".repeat(o);n.message+=`: + +${a} +${u} +`}};function $c(e,{flow:t,indicator:n,next:r,offset:s,onError:i,parentIndent:a,startOnNewline:o}){let c=!1,u=o,d=o,f="",h="",p=!1,m=!1,y=null,E=null,g=null,x=null,b=null,_=null,k=null;for(const S of e)switch(m&&(S.type!=="space"&&S.type!=="newline"&&S.type!=="comma"&&i(S.offset,"MISSING_CHAR","Tags and anchors must be separated from the next token by white space"),m=!1),y&&(u&&S.type!=="comment"&&S.type!=="newline"&&i(y,"TAB_AS_INDENT","Tabs are not allowed as indentation"),y=null),S.type){case"space":!t&&(n!=="doc-start"||(r==null?void 0:r.type)!=="flow-collection")&&S.source.includes(" ")&&(y=S),d=!0;break;case"comment":{d||i(S,"MISSING_CHAR","Comments must be separated from other tokens by white space characters");const A=S.source.substring(1)||" ";f?f+=h+A:f=A,h="",u=!1;break}case"newline":u?f?f+=S.source:(!_||n!=="seq-item-ind")&&(c=!0):h+=S.source,u=!0,p=!0,(E||g)&&(x=S),d=!0;break;case"anchor":E&&i(S,"MULTIPLE_ANCHORS","A node can have at most one anchor"),S.source.endsWith(":")&&i(S.offset+S.source.length-1,"BAD_ALIAS","Anchor ending in : is ambiguous",!0),E=S,k??(k=S.offset),u=!1,d=!1,m=!0;break;case"tag":{g&&i(S,"MULTIPLE_TAGS","A node can have at most one tag"),g=S,k??(k=S.offset),u=!1,d=!1,m=!0;break}case n:(E||g)&&i(S,"BAD_PROP_ORDER",`Anchors and tags must be after the ${S.source} indicator`),_&&i(S,"UNEXPECTED_TOKEN",`Unexpected ${S.source} in ${t??"collection"}`),_=S,u=n==="seq-item-ind"||n==="explicit-key-ind",d=!1;break;case"comma":if(t){b&&i(S,"UNEXPECTED_TOKEN",`Unexpected , in ${t}`),b=S,u=!1,d=!1;break}default:i(S,"UNEXPECTED_TOKEN",`Unexpected ${S.type} token`),u=!1,d=!1}const N=e[e.length-1],C=N?N.offset+N.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:c,comment:f,hasNewline:p,anchor:E,tag:g,newlineAfterProp:x,end:C,start:k??C}}function gf(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(gf(t.key)||gf(t.value))return!0}return!1;default:return!0}}function WE(e,t,n){if((t==null?void 0:t.type)==="flow-collection"){const r=t.end[0];r.indent===e&&(r.source==="]"||r.source==="}")&&gf(t)&&n(r,"BAD_INDENT","Flow end indicator should be more indented than parent",!0)}}function A6(e,t,n){const{uniqueKeys:r}=e.options;if(r===!1)return!1;const s=typeof r=="function"?r:(i,a)=>i===a||Vt(i)&&Vt(a)&&i.value===a.value;return t.some(i=>s(i.key,n))}const KA="All mapping items must start at the same column";function eme({composeNode:e,composeEmptyNode:t},n,r,s,i){var d;const a=(i==null?void 0:i.nodeClass)??bs,o=new a(n.schema);n.atRoot&&(n.atRoot=!1);let c=r.offset,u=null;for(const f of r.items){const{start:h,key:p,sep:m,value:y}=f,E=$c(h,{indicator:"explicit-key-ind",next:p??(m==null?void 0:m[0]),offset:c,onError:s,parentIndent:r.indent,startOnNewline:!0}),g=!E.found;if(g){if(p&&(p.type==="block-seq"?s(c,"BLOCK_AS_IMPLICIT_KEY","A block sequence may not be used as an implicit map key"):"indent"in p&&p.indent!==r.indent&&s(c,"BAD_INDENT",KA)),!E.anchor&&!E.tag&&!m){u=E.end,E.comment&&(o.comment?o.comment+=` +`+E.comment:o.comment=E.comment);continue}(E.newlineAfterProp||gf(p))&&s(p??h[h.length-1],"MULTILINE_IMPLICIT_KEY","Implicit keys need to be on a single line")}else((d=E.found)==null?void 0:d.indent)!==r.indent&&s(c,"BAD_INDENT",KA);n.atKey=!0;const x=E.end,b=p?e(n,p,E,s):t(n,x,h,null,E,s);n.schema.compat&&WE(r.indent,p,s),n.atKey=!1,A6(n,o.items,b)&&s(x,"DUPLICATE_KEY","Map keys must be unique");const _=$c(m??[],{indicator:"map-value-ind",next:y,offset:b.range[2],onError:s,parentIndent:r.indent,startOnNewline:!p||p.type==="block-scalar"});if(c=_.end,_.found){g&&((y==null?void 0:y.type)==="block-map"&&!_.hasNewline&&s(c,"BLOCK_AS_IMPLICIT_KEY","Nested mappings are not allowed in compact mappings"),n.options.strict&&E.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,c,m,null,_,s);n.schema.compat&&WE(r.indent,y,s),c=k.range[2];const N=new Tr(b,k);n.options.keepSourceTokens&&(N.srcToken=f),o.items.push(N)}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 Tr(b);n.options.keepSourceTokens&&(k.srcToken=f),o.items.push(k)}}return u&&ue&&(e.type==="block-map"||e.type==="block-seq");function nme({composeNode:e,composeEmptyNode:t},n,r,s,i){var E;const a=r.start.source==="{",o=a?"flow map":"flow sequence",c=(i==null?void 0:i.nodeClass)??(a?bs:$o),u=new c(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=Xf(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 db(e,t,n,r,s,i){const a=n.type==="block-map"?eme(e,t,n,r,i):n.type==="block-seq"?tme(e,t,n,r,i):nme(e,t,n,r,i),o=a.constructor;return s==="!"||s===o.tagName?(a.tag=o.tagName,a):(s&&(a.tag=s),a)}function rme(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(!c){const p=t.schema.knownTags[a];if((p==null?void 0:p.collection)===o)t.schema.tags.push(Object.assign({},p,{default:!1})),c=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),db(e,t,n,s,a)}const u=db(e,t,n,s,a,c),d=((h=c.resolve)==null?void 0:h.call(c,u,p=>s(i,"TAG_RESOLVE_FAILED",p),t.options))??u,f=On(d)?d:new ot(d);return f.range=u.range,f.tag=a,c!=null&&c.format&&(f.format=c.format),f}function sme(e,t,n){const r=t.offset,s=ime(t,e.options.strict,n);if(!s)return{value:"",type:null,comment:"",range:[r,r,r]};const i=s.mode===">"?ot.BLOCK_FOLDED:ot.BLOCK_LITERAL,a=t.source?ame(t.source):[];let o=a.length;for(let y=a.length-1;y>=0;--y){const E=a[y][1];if(E===""||E==="\r")o=y;else break}if(o===0){const y=s.chomp==="+"&&a.length>0?` +`.repeat(Math.max(1,a.length-1)):"";let E=r+s.length;return t.source&&(E+=t.source.length),{value:y,type:i,comment:s.comment,range:[r,E,E]}}let c=t.indent+s.indent,u=t.offset+s.length,d=0;for(let y=0;yc&&(c=E.length);else{E.length=o;--y)a[y][0].length>c&&(o=y+1);let f="",h="",p=!1;for(let y=0;yc||g[0]===" "?(h===" "?h=` +`:!p&&h===` +`&&(h=` + +`),f+=h+E.slice(c)+g,h=` +`,p=!0):g===""?h===` +`?f+=` +`:h=` +`:(f+=h+g,h=" ",p=!1)}switch(s.chomp){case"-":break;case"+":for(let y=o;yn(r+h,p,m);switch(s){case"scalar":o=ot.PLAIN,c=lme(i,u);break;case"single-quoted-scalar":o=ot.QUOTE_SINGLE,c=cme(i,u);break;case"double-quoted-scalar":o=ot.QUOTE_DOUBLE,c=ume(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=Xf(a,d,t,n);return{value:c,type:o,comment:f.comment,range:[r,d,f.offset]}}function lme(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}`),C6(e)}function cme(e,t){return(e[e.length-1]!=="'"||e.length===1)&&t(e.length,"MISSING_CHAR","Missing closing 'quote"),C6(e.slice(1,-1)).replace(/''/g,"'")}function C6(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 dme(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 fme={0:"\0",a:"\x07",b:"\b",e:"\x1B",f:"\f",n:` +`,r:"\r",t:" ",v:"\v",N:"…",_:" ",L:"\u2028",P:"\u2029"," ":" ",'"':'"',"/":"/","\\":"\\"," ":" "};function hme(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 I6(e,t,n,r){const{value:s,type:i,comment:a,range:o}=t.type==="block-scalar"?sme(e,t,r):ome(t,e.options.strict,r),c=n?e.directives.tagName(n.source,f=>r(n,"TAG_RESOLVE_FAILED",f)):null;let u;e.options.stringKeys&&e.atKey?u=e.schema[vi]:c?u=pme(e.schema,s,c,n,r):t.type==="scalar"?u=mme(e,s,t,r):u=e.schema[vi];let d;try{const f=u.resolve(s,h=>r(n??t,"TAG_RESOLVE_FAILED",h),e.options);d=Vt(f)?f:new ot(f)}catch(f){const h=f instanceof Error?f.message:String(f);r(n??t,"TAG_RESOLVE_FAILED",h),d=new ot(s)}return d.range=o,d.source=s,i&&(d.type=i),c&&(d.tag=c),u.format&&(d.format=u.format),a&&(d.comment=a),d}function pme(e,t,n,r,s){var o;if(n==="!")return e[vi];const i=[];for(const c of e.tags)if(!c.collection&&c.tag===n)if(c.default&&c.test)i.push(c);else return c;for(const c of i)if((o=c.test)!=null&&o.test(t))return c;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[vi])}function mme({atKey:e,directives:t,schema:n},r,s,i){const a=n.tags.find(o=>{var c;return(o.default===!0||e&&o.default==="key")&&((c=o.test)==null?void 0:c.test(r))})||n[vi];if(n.compat){const o=n.compat.find(c=>{var u;return c.default&&((u=c.test)==null?void 0:u.test(r))})??n[vi];if(a.tag!==o.tag){const c=t.tagString(a.tag),u=t.tagString(o.tag),d=`Value may be parsed as either ${c} or ${u}`;i(s,"TAG_RESOLVE_FAILED",d,!0)}}return a}function gme(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 yme={composeNode:O6,composeEmptyNode:f_};function O6(e,t,n,r){const s=e.atKey,{spaceBefore:i,comment:a,anchor:o,tag:c}=n;let u,d=!0;switch(t.type){case"alias":u=bme(e,t,r),(o||c)&&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=I6(e,t,c,r),o&&(u.anchor=o.source.substring(1));break;case"block-map":case"block-seq":case"flow-collection":try{u=rme(yme,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=f_(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&&(!Vt(u)||typeof u.value!="string"||u.tag&&u.tag!=="tag:yaml.org,2002:str")&&r(c??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 f_(e,t,n,r,{spaceBefore:s,comment:i,anchor:a,tag:o,end:c},u){const d={type:"scalar",offset:gme(t,n,r),indent:-1,source:""},f=I6(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]=c),f}function bme({options:e},{offset:t,source:n,end:r},s){const i=new e_(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=Xf(r,a,e.strict,s);return i.range=[t,a,o.offset],o.comment&&(i.comment=o.comment),i}function Eme(e,t,{offset:n,start:r,value:s,end:i},a){const o=Object.assign({_directives:t},e),c=new qf(void 0,o),u={atKey:!1,atRoot:!0,directives:c.directives,options:c.options,schema:c.schema},d=$c(r,{indicator:"doc-start",next:s??(i==null?void 0:i[0]),offset:n,onError:a,parentIndent:0,startOnNewline:!0});d.found&&(c.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")),c.contents=s?O6(u,s,d,a):f_(u,d.end,r,null,d,a);const f=c.contents.range[2],h=Xf(i,f,!1,a);return h.comment&&(c.comment=h.comment),c.range=[n,f,h.offset],c}function Ou(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 YA(e){var s;let t="",n=!1,r=!1;for(let i=0;i{const a=Ou(n);i?this.warnings.push(new Jpe(a,r,s)):this.errors.push(new Wu(a,r,s))},this.directives=new _r({version:t.version||"1.2"}),this.options=t}decorate(t,n){const{comment:r,afterEmptyLine:s}=YA(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(In(i)&&!i.flow&&i.items.length>0){let a=i.items[0];Rn(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=Ou(t);i[0]+=n,this.onError(i,"BAD_DIRECTIVE",r,s)}),this.prelude.push(t.source),this.atDirectives=!0;break;case"document":{const n=Eme(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 Wu(Ou(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 Wu(Ou(t),"UNEXPECTED_TOKEN",r));break}this.doc.directives.docEnd=!0;const n=Xf(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 Wu(Ou(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 qf(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 R6="\uFEFF",L6="",M6="",qE="";function wme(e){switch(e){case R6:return"byte-order-mark";case L6:return"doc-mode";case M6:return"flow-error-end";case qE: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 js(e){switch(e){case void 0:case" ":case` +`:case"\r":case" ":return!0;default:return!1}}const GA=new Set("0123456789ABCDEFabcdef"),vme=new Set("0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz-#;/?:@&=+$_.!~*'()"),op=new Set(",[]{}"),_me=new Set(` ,[]{} +\r `),fb=e=>!e||_me.has(e);class kme{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==="...")&&js(this.buffer[t+3]))return-1}return t}getLine(){let t=this.lineEndPos;return(typeof t!="number"||t!==-1&&tthis.indentValue&&!js(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===":")&&js(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(fb),"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=>js(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 qE,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(js(i)||t&&op.has(i))break;n=r}else if(js(s)){let i=this.buffer[r+1];if(s==="\r"&&(i===` +`?(r+=1,s=` +`,i=this.buffer[r+1]):n=r),i==="#"||t&&op.has(i))break;if(s===` +`){const a=this.continueScalar(r+1);if(a===-1)break;r=Math.max(r,a-2)}}else{if(t&&op.has(s))break;n=r}return!s&&!this.atEnd?this.setNext("plain-scalar"):(yield qE,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(fb),t+=yield*this.pushSpaces(!0);continue e;case"-":case"?":case":":{const n=this.flowLevel>0,r=this.charAt(1);if(js(r)||n&&op.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(;!js(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(vme.has(n))n=this.buffer[++t];else if(n==="%"&&GA.has(this.buffer[t+1])&&GA.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 Nme{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 rg(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"&&qA(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&&WA(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 c=0;ct.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(xa(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(j6(n.key)&&!xa(n.sep,"newline")){const o=ml(n.start),c=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:c,sep:u}]})}else a.length>0?n.sep=n.sep.concat(a,this.sourceToken):n.sep.push(this.sourceToken);else if(xa(n.start,"newline"))Object.assign(n,{key:null,sep:[this.sourceToken]});else{const o=ml(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]}):xa(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&&!xa(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)){rg(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||xa(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=lp(r),i=ml(s);qA(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=lp(t),r=ml(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=lp(t),r=ml(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 Tme(e){const t=e.prettyErrors!==!1;return{lineCounter:e.lineCounter||t&&new Nme||null,prettyErrors:t}}function Ame(e,t={}){const{lineCounter:n,prettyErrors:r}=Tme(t),s=new Sme(n==null?void 0:n.addNewLine),i=new xme(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 Wu(o.range.slice(0,2),"MULTIPLE_DOCS","Source contains multiple documents; please use YAML.parseAllDocuments()"));break}return r&&n&&(a.errors.forEach(VA(e,n)),a.warnings.forEach(VA(e,n))),a}function Cme(e,t,n){let r;const s=Ame(e,n);if(!s)return null;if(s.warnings.forEach(i=>o6(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 Ime(e,t,n){let r=null;if(Array.isArray(t)&&(r=t),e===void 0){const{keepUndefined:s}={};if(!s)return}return Kf(e)&&!r?e.toString(n):new qf(e,r,n).toString(n)}const D6=new Set(["local","sqlite","mysql","postgresql"]),P6=new Set(["local","opensearch","redis","viking","mem0"]),B6=new Set(["opensearch","viking","context_search"]),F6=new Set(["apmplus","cozeloop","tls"]),U6=new Set(["web_search","parallel_web_search","link_reader","web_scraper","image_generate","image_edit","video_generate","text_to_speech","run_code","vesearch"]),Ome=new Set(["llm","sequential","parallel","loop","a2a"]);function dt(e,t=""){return typeof e=="string"?e:t}function ys(e){return e===!0}function kd(e){return Array.isArray(e)?e.filter(t=>typeof t=="string"):[]}function $6(e){return Array.isArray(e)?e.map(t=>t&&typeof t=="object"?{name:dt(t.name),description:dt(t.description)}:null).filter(t=>!!t&&!!t.name.trim()):[]}function oc(e,t,n){return typeof e=="string"&&t.has(e)?e:n}function H6(e){return typeof e=="string"&&Ome.has(e)?e:"llm"}function z6(e){return typeof e=="number"&&Number.isFinite(e)&&e>0?Math.floor(e):3}function V6(e){const t=e&&typeof e=="object"?e:{};return{enabled:ys(t.enabled),registrySpaceId:dt(t.registrySpaceId),registryTopK:dt(t.registryTopK),registryRegion:dt(t.registryRegion),registryEndpoint:dt(t.registryEndpoint)}}function K6(e){return Array.isArray(e)?e.map(t=>{const n=t&&typeof t=="object"?t:{},r=n.memory&&typeof n.memory=="object"?n.memory:{},s=V6(n.a2aRegistry),i=H6(n.agentType),a=s.enabled&&i==="llm"?"a2a":i;return{...Nr(),name:dt(n.name),description:dt(n.description),instruction:dt(n.instruction),agentType:a,maxIterations:z6(n.maxIterations),a2aUrl:dt(n.a2aUrl),modelName:dt(n.modelName),modelProvider:dt(n.modelProvider),modelApiBase:dt(n.modelApiBase),builtinTools:kd(n.builtinTools).filter(o=>U6.has(o)),customTools:$6(n.customTools),memory:{shortTerm:ys(r.shortTerm),longTerm:ys(r.longTerm)},shortTermBackend:oc(n.shortTermBackend,D6,"local"),longTermBackend:oc(n.longTermBackend,P6,"local"),autoSaveSession:ys(n.autoSaveSession),knowledgebase:ys(n.knowledgebase),knowledgebaseBackend:oc(n.knowledgebaseBackend,B6,kc),knowledgebaseIndex:dt(n.knowledgebaseIndex),tracing:ys(n.tracing),tracingExporters:kd(n.tracingExporters).filter(o=>F6.has(o)),a2aRegistry:a==="a2a"?{...s,enabled:!0}:s,subAgents:K6(n.subAgents),selectedSkills:Y6(n)}}):[]}function Y6(e){if(!Array.isArray(e.selectedSkills))return[];const t=[];for(const n of e.selectedSkills){const r=n&&typeof n=="object"?n:{},s=dt(r.source),i=s==="local"||s==="skillspace"||s==="skillhub"?s:"skillhub",a=dt(r.name)||dt(r.slug)||dt(r.skillName)||dt(r.skillId)||"skill",o=dt(r.folder)||a,c=dt(r.description);if(i==="skillhub"){const f=dt(r.slug);if(!f)continue;t.push({source:i,folder:o,name:a,description:c,slug:f,namespace:dt(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=dt(m.path),E=dt(m.content);return y?{path:y,content:E}:null}).filter(p=>p!==null);if(h.length===0)continue;t.push({source:i,folder:o,name:a,description:c,localFiles:h});continue}const u=dt(r.skillSpaceId),d=dt(r.skillId);!u||!d||t.push({source:i,folder:o,name:a,description:c,skillSpaceId:u,skillSpaceName:dt(r.skillSpaceName),skillId:d,version:dt(r.version)})}return t}function h_(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=V6(t.a2aRegistry),i=H6(t.agentType),a=s.enabled&&i==="llm"?"a2a":i,o=Array.isArray(t.mcpTools)?t.mcpTools.map(c=>{const u=c&&typeof c=="object"?c:{},d=u.transport==="stdio"?"stdio":"http";return{name:dt(u.name),transport:d,url:dt(u.url),authToken:dt(u.authToken),command:dt(u.command),args:kd(u.args)}}).filter(c=>c.transport==="http"?!!c.url:!!c.command):[];return{...Nr(),name:dt(t.name)||"my_agent",description:dt(t.description),instruction:dt(t.instruction)||"You are a helpful assistant.",agentType:a,maxIterations:z6(t.maxIterations),a2aUrl:dt(t.a2aUrl),modelName:dt(t.modelName),modelProvider:dt(t.modelProvider),modelApiBase:dt(t.modelApiBase),builtinTools:kd(t.builtinTools).filter(c=>U6.has(c)),customTools:$6(t.customTools),mcpTools:o,a2aRegistry:a==="a2a"?{...s,enabled:!0}:s,memory:{shortTerm:ys(n.shortTerm),longTerm:ys(n.longTerm)},shortTermBackend:oc(t.shortTermBackend,D6,"local"),longTermBackend:oc(t.longTermBackend,P6,"local"),autoSaveSession:ys(t.autoSaveSession),knowledgebase:ys(t.knowledgebase),knowledgebaseBackend:oc(t.knowledgebaseBackend,B6,kc),knowledgebaseIndex:dt(t.knowledgebaseIndex),tracing:ys(t.tracing),tracingExporters:kd(t.tracingExporters).filter(c=>F6.has(c)),deployment:{feishuEnabled:ys(r.feishuEnabled)},subAgents:K6(t.subAgents),selectedSkills:Y6(t)}}function G6(e){var n,r,s,i,a,o,c,u,d,f,h,p,m,y,E,g,x,b;const t={agentType:e.agentType??"llm"};if(e.agentType==="a2a"){if((n=e.a2aRegistry)!=null&&n.enabled){const _={enabled:!0};(r=e.a2aRegistry.registrySpaceId)!=null&&r.trim()&&(_.registrySpaceId=e.a2aRegistry.registrySpaceId.trim()),_.registryTopK=((s=e.a2aRegistry.registryTopK)==null?void 0:s.trim())||qs.topK,_.registryRegion=((i=e.a2aRegistry.registryRegion)==null?void 0:i.trim())||qs.region,_.registryEndpoint=((a=e.a2aRegistry.registryEndpoint)==null?void 0:a.trim())||qs.endpoint,t.a2aRegistry=_}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()),(c=e.modelProvider)!=null&&c.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(_=>({name:_.name,description:_.description}))),(h=e.mcpTools)!=null&&h.length&&(t.mcpTools=e.mcpTools.map(_=>{var N,C,S,A;const k={name:_.name,transport:_.transport};return(N=_.url)!=null&&N.trim()&&(k.url=_.url.trim()),(C=_.authToken)!=null&&C.trim()&&(k.authToken=_.authToken.trim()),(S=_.command)!=null&&S.trim()&&(k.command=_.command.trim()),(A=_.args)!=null&&A.length&&(k.args=_.args),k})),((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||"viking",(y=e.knowledgebaseIndex)!=null&&y.trim()&&(t.knowledgebaseIndex=e.knowledgebaseIndex.trim())),e.tracing&&((E=e.tracingExporters)!=null&&E.length)&&(t.tracing=!0,t.tracingExporters=[...e.tracingExporters]),(g=e.deployment)!=null&&g.feishuEnabled&&(t.deployment={feishuEnabled:!0}),(x=e.selectedSkills)!=null&&x.length&&(t.selectedSkills=e.selectedSkills.map(_=>{const k={source:_.source,name:_.name,folder:_.folder};return _.description&&(k.description=_.description),_.source==="skillhub"?(k.slug=_.slug,k.namespace=_.namespace??"public"):_.source==="local"?k.localFiles=_.localFiles??[]:(k.skillSpaceId=_.skillSpaceId,k.skillSpaceName=_.skillSpaceName,k.skillId=_.skillId,_.version&&(k.version=_.version)),k})),(b=e.subAgents)!=null&&b.length&&(t.subAgents=e.subAgents.map(G6)),t}function Rme(e){return`# VeADK Agent 结构配置 +# 可在「创建 Agent」页通过「导入 YAML」重新载入。 +`+Ime(G6(e))}function Lme(e){const t=Cme(e);return h_(t)}const Mme=[{kind:"custom",icon:sz,title:"自定义",desc:"分步配置模型、工具、记忆、知识库等组件。"},{kind:"intelligent",icon:zH,title:"智能模式",desc:"敬请期待",disabled:!0},{kind:"template",icon:FH,title:"从模板新建",desc:"敬请期待",disabled:!0},{kind:"workflow",icon:iz,title:"工作流",desc:"敬请期待",disabled:!0}];function jme({onSelect:e,onImport:t}){const n=w.useRef(null),[r,s]=w.useState(""),i=Mme.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 c=(u=o.target.files)==null?void 0:u[0];if(o.target.value="",!!c)try{const d=await c.text();t(Lme(d))}catch(d){s(`导入失败:${d instanceof Error?d.message:String(d)}`)}};return l.jsx(Q4,{title:"从 0 快速创建",sub:"选择一种方式开始",cards:i,footer:l.jsxs("div",{style:{display:"flex",flexDirection:"column",alignItems:"center",gap:8},children:[l.jsxs("button",{className:"stk-import",onClick:()=>{var o;return(o=n.current)==null?void 0:o.click()},children:[l.jsx(nz,{}),"导入 YAML 配置"]}),r&&l.jsx("span",{style:{fontSize:12,color:"hsl(var(--destructive))"},children:r}),l.jsx("input",{ref:n,type:"file",accept:".yaml,.yml,text/yaml",style:{display:"none"},onChange:a})]})})}const Dme="modulepreload",Pme=function(e){return"/"+e},XA={},lc=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(c=>{if(c=Pme(c),c in XA)return;XA[c]=!0;const u=c.endsWith(".css"),d=u?'[rel="stylesheet"]':"";if(document.querySelector(`link[href="${c}"]${d}`))return;const f=document.createElement("link");if(f.rel=u?"stylesheet":Dme,u||(f.as="script"),f.crossOrigin="",f.href=c,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 ${c}`)))})}))}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 W6(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 Bme(e,t){return W6([{env:e}]).specs.map(r=>({...r,value:t[r.key]??""}))}function q6(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 QA(e,t){return e.find(n=>{var r;return n.required&&!((r=t[n.key])!=null&&r.trim())})}const Fme="data:image/svg+xml,%3csvg%20xmlns='http://www.w3.org/2000/svg'%20viewBox='0%200%2048%2048'%3e%3cimage%20width='48'%20height='48'%20href='data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAADAAAAAwCAYAAABXAvmHAAAAAXNSR0IArs4c6QAAAERlWElmTU0AKgAAAAgAAYdpAAQAAAABAAAAGgAAAAAAA6ABAAMAAAABAAEAAKACAAQAAAABAAAAMKADAAQAAAABAAAAMAAAAADbN2wMAAAH7UlEQVRoBdVZWWwbVRQ9492Onc1xTfaWLukq9oSqLKnYBZRSNgn6AagsAgmJRfzxg4SEEDtiER8IBKKAChK0FS1tKYWW0lZQKKV0gxCVJm3ikDiO17EdzrUzSdw4jj1OpeQqNzO237vvnHfvu/e9GWVwcBBDYue1mrqE2kI1UqeSJAnmIHUzNUCNUmGiKtQy6oPUR6geqnw/FSVOUH9R36KupfaDHnBQn6MGqEnqVJcEAfZTBbNL4b+lZPI1VbwwnaSfYO8z8N+TVMd0Qj6EVdbs3eIBP29cVFkL00kk+wSEwHAamgh9bDAJSQWTITZFnF+85J1tBPyOUC9OqqnsVdTIRkVBi70Msy125uriHJ8XAXFRfzKBTQM+rO0/hc54cSQE8iyzAx/XLcEltjIU44uCQijOaHvPfxIv97TjWCzEcMo7+sZ4TGa+2V6KT2rPQ73ZptsPBZE30fVrymvxTvUCtDoqYC0ijhMk/3MkgDd62xFheOqVggjIIAbOVaujEh/ULsaNzioUsxhVAv/A34GD0YBubxZMQJupWpMNr58zHytcHth1ekICsDcRx4u+fxBK6vOCbgKyEIXEK975WOmaoZuErKv1QR8ORQd0eUE3Ac0TNSYrXvI24fZSLxwGfebiDKW3e08gln9J0oYvKoMNG6kmiRdmzMOtTi8sOsJJJfANA93oiseGbeZ7k1EHZAKCEcApu4wCxUsSz3rm4HQiim3B/wpOsBJA2yP/4cZIJYIBFcGwCjWeSKEwm4wosZtR7rKizGXJQJZRB1TuttftAprnAbOrM9rl9UHqwg+s1o+eOow/GNN5CaPOklSgdKq4us+Ji7pt6Dw1AF9vBOGImjJht5lRVWFDY7UL58/3wOt2YPEcN2xWVpPRe6EQC+y9rwINPNKsuRaYX5cXhIxGkks+Y7V+6vQRdLBi5yx1bGwicFebivj+ARgOhZGMJMFyQyWpoV2GRIa2ZXOX2bDyqnPxzEPNKC+1Zj957eDBTbz34PXAwvoMfBN+kGV8Bxf00VgQz/vaEB6nSCnRQVj2h2DZG4TyZwQWlSils3m8RDDEhk2uaqlHaYklVb3Ha42dh4B3eMzZ//eEmMc0kGL3cEU9WksqU4XvzAYKZ9n6fQCOz3thORCGkhgCf2bDMz4bjQpW39yE65Y1QO5FxiUgP+76E3hzI7D1VyBcwP5NTFcZzXjaPRMNZmvGPkfA23YMwLHRD0Mf3ZwTgaBIi8GgYMGsSjx2z3kEP9Jp5E5rOeoqQH75C3htPfDpD4CskXxFvHC5vQKPVjSwPqQfcKTAfxuA/Ws/lBAXwEhUTGjWSAL3r1qYykSju+UkIFbZDx09wPvb0iH1W9uEYw03MHAV3ltew1CqgDkyCNtWgt/cnwY/3GriG5n9hbMrccNljRmzLz0nJCCNJBsEwsCH24E3NgDr96brhfyWS2Sm3EYLVsOL0i0DsG8h+LDkqcLExHhfc9siVDDrjJ59sZJRyHKZFRKybiSkTtIjR08CrXwEdtGcXL2A4+192LOuDeatfqg6wMvsL5lbhWuWysIdO995E9BgSkh19THX7wQOtANXLgKWLQSaarUWI9dNP7bjo68OY9uef6GqhcW8ZkViX2a/nBWYQ4+RggmIBfFGnHgOcD0c7wD2HgOW0xuXk0xN5SDaOwL4cnsb1m05joPHejKK0hgEOb4Q8Muba3H1pXUwZZl96aqLgHSU2RCbEe6/9hzh875OYPdhYF5NDLt/Oohd+46gNxBjm2zzJhZyi/RyV5TggdsvRJnTOm5j3QQ0i9ra6OHj1u9+B/YdNcLXVQdDmYNPy9oZ971IcIPHjUHadVrHHFfZNphtTtx508W4eJEHsg7Gk6IJaIZlDEn3EdUEl7sBg4la2MtqkYgNIOz/F9FgF6IhX6p5mozcjgbGasw/xWCCs7IeN7U24b4VddwZj26jjTZynTQCmknxSBqIETanh7ceWEpmpIiokT7E6JFosBvxaD/iJCeNDQYzTFYnzHY3SsobmfM9eOyucjTO0KyOf510AqOHkl2kiMlSQoAlsPLAk4hHSCaIJMMqmUgfYBQeggxGK4xmOxprXHh8lYK51em+E/0/qwQyBh8iY+Q52pjlOZD8XFcFPHELcGlT3stlbBaymtOROTReBoZJ+0DjZ9pv4SFq9fL0YWqcjJl1+AwP8OSGS+amq6y4P/fyyWqvoC9lDAG7ainPEJcBs7xMBGOLbU6bGQTMJHAnDUlG2biPFZevEM4GCZl9sSsnPgG+bAHfa+l8vZJxpNSo+oPp/c4XP6bPBN0kog2qtdFz1WzIkfXmZuAKVm6JewlbvZKVgGZMilMPwW9ngdr5B3CEG7iEbCY5ffl6RgPtYDGdybS4ogW4YDbgLefTD5s2kv5rTgKaWdlKi1fau4BDJ3jM5I70NDd0J7grzfZEUMg5CM5Tmg4TiW3ZtVYxTKpcgM2iWS7+mhcBbRiZ/TBTd4jPjtSEVF3AxxdUPgkxTrUUMTcBykKUmLZwhQlYPhWBeCBV5DRjk3QtiEC2McUDsjPVCEhWEQ8Umk2y2c7nOyEwrV/ySdbdQo3nw3aKtRHM3wiBtVQu02knISJ+SQh8Q32TyqTJJ6xTXyQzyzb2LeoBWQOy5pjwcDf1YSqzNIooLex99kTCppsq4N+l+oUArylhoku9sb+O18VU8c5UEiZu7KGyrKKTmgr7/wGxhy03aZIycwAAAABJRU5ErkJggg=='%20/%3e%3c/svg%3e",Ume=(()=>{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 $me(e){let t=4294967295;for(let n=0;n>>8;return(t^4294967295)>>>0}function cn(e,t){e.push(t&255,t>>>8&255)}function Gr(e,t){e.push(t&255,t>>>8&255,t>>>16&255,t>>>24&255)}const ZA=2048,hb=20,JA=0;function Hme(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),E=$me(y),g=y.length,x=[];Gr(x,67324752),cn(x,hb),cn(x,ZA),cn(x,JA),cn(x,0),cn(x,0),Gr(x,E),Gr(x,g),Gr(x,g),cn(x,m.length),cn(x,0);const b=Uint8Array.from(x);n.push(b,m,y),r.push({nameBytes:m,dataBytes:y,crc:E,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=[];Gr(m,33639248),cn(m,hb),cn(m,hb),cn(m,ZA),cn(m,JA),cn(m,0),cn(m,0),Gr(m,p.crc),Gr(m,p.size),Gr(m,p.size),cn(m,p.nameBytes.length),cn(m,0),cn(m,0),cn(m,0),cn(m,0),Gr(m,0),Gr(m,p.offset);const y=Uint8Array.from(m);a.push(y,p.nameBytes),o+=y.length+p.nameBytes.length}const c=[];Gr(c,101010256),cn(c,0),cn(c,0),cn(c,r.length),cn(c,r.length),Gr(c,o),Gr(c,i),cn(c,0);const u=[...n,...a,Uint8Array.from(c)],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 zme=w.lazy(()=>lc(()=>import("./CodeEditor-CXwnqSek.js"),[]));function Vme(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 Kme(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 X6({project:e,open:t,onClose:n,onChange:r}){var m;const[s,i]=w.useState(((m=e.files[0])==null?void 0:m.path)??null),[a,o]=w.useState(new Set),c=w.useRef(null),u=w.useMemo(()=>Vme(e.files),[e.files]),d=e.files.find(y=>y.path===s)??null;if(w.useEffect(()=>{var g;if(!t)return;const y=document.body.style.overflow;document.body.style.overflow="hidden",(g=c.current)==null||g.focus();const E=x=>{x.key==="Escape"&&n()};return window.addEventListener("keydown",E),()=>{document.body.style.overflow=y,window.removeEventListener("keydown",E)}},[n,t]),w.useEffect(()=>{d||e.files.length===0||i(e.files[0].path)},[e.files,d]),!t)return null;function f(y){o(E=>{const g=new Set(E);return g.has(y)?g.delete(y):g.add(y),g})}function h(y,E,g){return Kme(y).map(x=>{const b=g?`${g}/${x.name}`:x.name;if(!(x.children.size>0&&x.path===void 0)&&x.path)return l.jsxs("button",{type:"button",className:`code-browser-file${s===x.path?" is-active":""}`,style:{paddingLeft:`${12+E*16}px`},onClick:()=>i(x.path??null),title:x.path,children:[l.jsx(fS,{"aria-hidden":"true"}),l.jsx("span",{children:x.name})]},b);const k=a.has(b);return l.jsxs("div",{children:[l.jsxs("button",{type:"button",className:"code-browser-folder",style:{paddingLeft:`${10+E*16}px`},onClick:()=>f(b),"aria-expanded":!k,children:[l.jsx(xs,{className:k?"":"is-open","aria-hidden":"true"}),l.jsx(CL,{"aria-hidden":"true"}),l.jsx("span",{children:x.name})]}),!k&&h(x,E+1,b)]},b)})}function p(y){d&&r({...e,files:e.files.map(E=>E.path===d.path?{...E,content:y}:E)})}return Ns.createPortal(l.jsx("div",{className:"code-browser-backdrop",onMouseDown:y=>{y.target===y.currentTarget&&n()},children:l.jsxs("section",{className:"code-browser-dialog",role:"dialog","aria-modal":"true","aria-labelledby":"code-browser-title",children:[l.jsxs("header",{className:"code-browser-head",children:[l.jsxs("div",{className:"code-browser-title-wrap",children:[l.jsx("span",{className:"code-browser-title-icon","aria-hidden":"true",children:l.jsx(Iw,{})}),l.jsxs("div",{children:[l.jsx("h2",{id:"code-browser-title",children:"项目代码"}),l.jsx("p",{children:e.name||"Agent 项目"})]})]}),l.jsx("button",{ref:c,type:"button",className:"code-browser-close",onClick:n,"aria-label":"关闭代码浏览器",children:l.jsx(Hr,{"aria-hidden":"true"})})]}),l.jsxs("div",{className:"code-browser-workspace",children:[l.jsxs("aside",{className:"code-browser-sidebar","aria-label":"项目文件",children:[l.jsxs("div",{className:"code-browser-sidebar-head",children:["文件 ",l.jsx("span",{children:e.files.length})]}),l.jsx("div",{className:"code-browser-tree",children:e.files.length>0?h(u,0,""):l.jsx("div",{className:"code-browser-empty",children:"暂无项目文件"})})]}),l.jsxs("main",{className:"code-browser-main",children:[l.jsxs("div",{className:"code-browser-path",children:[l.jsx(fS,{"aria-hidden":"true"}),l.jsx("span",{children:(d==null?void 0:d.path)??"未选择文件"})]}),l.jsx("div",{className:"code-browser-editor",children:d?l.jsx(w.Suspense,{fallback:l.jsx("div",{className:"code-browser-empty",children:"正在加载编辑器…"}),children:l.jsx(zme,{value:d.content,path:d.path,onChange:p})}):l.jsx("div",{className:"code-browser-empty",children:"从左侧选择文件以查看代码"})})]})]})]})}),document.body)}function Yme({project:e,onChange:t,className:n=""}){const[r,s]=w.useState(!1);return l.jsxs(l.Fragment,{children:[l.jsxs("button",{type:"button",className:`code-browser-trigger ${n}`.trim(),onClick:()=>s(!0),"aria-label":"查看和编辑项目源码",title:"查看源码",children:[l.jsx(Iw,{"aria-hidden":"true"}),l.jsx("span",{children:"查看源码"})]}),l.jsx(X6,{project:e,open:r,onClose:()=>s(!1),onChange:t})]})}function sg({message:e,className:t="",onRetry:n,retryLabel:r="重试部署"}){const[s,i]=w.useState(!1),[a,o]=w.useState(!1),[c,u]=w.useState(!1),d=async()=>{try{await navigator.clipboard.writeText(e),o(!0),setTimeout(()=>o(!1),1500)}catch{o(!1)}},f=async()=>{if(!(!n||c)){u(!0);try{await n()}finally{u(!1)}}};return l.jsxs("div",{className:`deploy-error-message${s?" is-expanded":""}${t?` ${t}`:""}`,children:[l.jsx("p",{className:"deploy-error-message-text",children:e}),l.jsxs("div",{className:"deploy-error-message-actions",children:[n&&l.jsxs("button",{type:"button",className:"deploy-error-retry",disabled:c,onClick:()=>void f(),children:[c?l.jsx(Mt,{className:"spin"}):l.jsx(QH,{}),c?"重试中…":r]}),l.jsx("button",{type:"button",title:s?"收起错误信息":"展开完整错误信息","aria-label":s?"收起错误信息":"展开完整错误信息",onClick:()=>i(h=>!h),children:s?l.jsx(KH,{}):l.jsx(tc,{})}),l.jsx("button",{type:"button",title:a?"已复制":"复制完整错误信息","aria-label":a?"已复制":"复制完整错误信息",onClick:()=>void d(),children:a?l.jsx(Js,{}):l.jsx(Ow,{})})]})]})}$r.registerLanguage("python",aj);$r.registerLanguage("typescript",bj);$r.registerLanguage("javascript",ej);$r.registerLanguage("json",tj);$r.registerLanguage("yaml",Ej);$r.registerLanguage("markdown",ij);$r.registerLanguage("bash",W3);$r.registerLanguage("ini",q3);$r.registerLanguage("dockerfile",UQ);$r.registerLanguage("makefile",sj);const Gme=w.lazy(()=>lc(()=>import("./CodeEditor-CXwnqSek.js"),[])),ha=()=>{};function Wme({open:e,isUpdate:t,onCancel:n,onConfirm:r}){const s=w.useRef(null);return w.useEffect(()=>{var o;if(!e)return;const i=document.body.style.overflow;document.body.style.overflow="hidden",(o=s.current)==null||o.focus();const a=c=>{c.key==="Escape"&&n()};return window.addEventListener("keydown",a),()=>{document.body.style.overflow=i,window.removeEventListener("keydown",a)}},[n,e]),e?Ns.createPortal(l.jsx("div",{className:"code-browser-backdrop pp-confirm-backdrop",onMouseDown:i=>{i.target===i.currentTarget&&n()},children:l.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:[l.jsxs("header",{className:"code-browser-head pp-confirm-head",children:[l.jsxs("div",{className:"code-browser-title-wrap",children:[l.jsx("span",{className:"code-browser-title-icon pp-confirm-icon","aria-hidden":"true",children:l.jsx(tz,{})}),l.jsx("h2",{id:"pp-confirm-title",children:t?"确认更新":"确认部署"})]}),l.jsx("button",{type:"button",className:"code-browser-close",onClick:n,"aria-label":"关闭部署确认",children:l.jsx(Hr,{"aria-hidden":"true"})})]}),l.jsx("div",{className:"pp-confirm-body",children:l.jsx("p",{id:"pp-confirm-description",children:t?"将更新并发布到当前云端 Runtime,过程可能需要几分钟。确定继续吗?":"将创建新的云端 Runtime,部署过程可能需要几分钟。确定继续吗?"})}),l.jsxs("footer",{className:"pp-confirm-actions",children:[l.jsx("button",{ref:s,type:"button",onClick:n,children:"取消"}),l.jsx("button",{type:"button",className:"is-primary",onClick:r,children:t?"确定更新":"确定部署"})]})]})}),document.body):null}const qme={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"},eC={dockerfile:"dockerfile","requirements.txt":"plaintext","requirements-dev.txt":"plaintext",".env":"ini",".gitignore":"plaintext",makefile:"makefile"};function tC(e){return e.replace(/&/g,"&").replace(//g,">")}function Xme(e){const n=(e.split("/").pop()??e).toLowerCase();if(eC[n])return eC[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 qme[s]??null}function Qme(e,t){try{const n=Xme(t);return n&&$r.getLanguage(n)?$r.highlight(e,{language:n,ignoreIllegals:!0}).value:n===null?$r.highlightAuto(e).value:tC(e)}catch{return tC(e)}}const Zme=[{phase:"build",label:"构建镜像"},{phase:"deploy",label:"部署"},{phase:"publish",label:"发布"}],Jme=[{phase:"upload",label:"上传代码包"},{phase:"build",label:"镜像打包"},{phase:"deploy",label:"创建 Runtime"},{phase:"publish",label:"发布服务"}];function ege(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 tge(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 nge(e="",t=""){return{id:`${Date.now().toString(36)}-${Math.random().toString(36).slice(2,8)}`,key:e,value:t}}function rge({left:e,right:t}){const[n,r]=w.useState(null);return w.useLayoutEffect(()=>{const s=document.getElementById("veadk-page-header-left"),i=document.getElementById("veadk-page-header-actions");s&&i&&r({left:s,right:i})},[]),n?l.jsxs(l.Fragment,{children:[Ns.createPortal(e,n.left),Ns.createPortal(t,n.right)]}):l.jsxs("header",{className:"pp-toolbar",children:[e,t]})}function w0({project:e,embedded:t=!1,deployDisabledReason:n,agentDraft:r,agentName:s,agentCount:i,releaseConfiguration:a,onChange:o,onDeploy:c,onAgentAdded:u,onDeploymentComplete:d,deploymentActionLabel:f="部署",deploymentRuntimeId:h,onDeploymentStarted:p,onDeploymentTaskChange:m,feishuEnabled:y=!1,onFeishuEnabledChange:E,deploymentEnv:g=[],deploymentEnvValues:x={},onDeploymentEnvChange:b,network:_,onNetworkChange:k,deployRegion:N="cn-beijing",onDeployRegionChange:C,onBack:S,backLabel:A="返回配置",onExportYaml:O,deploymentPrimaryPane:D,deployDisabled:F=!1}){var lt,Bt,it;const X=typeof o=="function",L=f.includes("更新"),j=D?Jme:Zme,[T,R]=w.useState(((Bt=(lt=e==null?void 0:e.files)==null?void 0:lt[0])==null?void 0:Bt.path)??null),[M,B]=w.useState(new Set),[I,V]=w.useState(!1),[G,P]=w.useState(""),[ie,q]=w.useState(!1),[ne,oe]=w.useState(!1),[ee,ce]=w.useState(!1),[re,pe]=w.useState(!1),[ye,J]=w.useState(null),[fe,Ee]=w.useState(null),[Te,Ge]=w.useState({}),[ke,rt]=w.useState(null),[ze,We]=w.useState(!1),[yt,at]=w.useState([]),[St,Tt]=w.useState(!1),[H,Z]=w.useState(!1),le=w.useRef(!0),be=Q=>l.jsxs("div",{className:"pp-network-region",onKeyDown:ve=>{ve.key==="Escape"&&Z(!1)},children:[Q&&l.jsx("span",{children:"发布区域"}),l.jsxs("button",{type:"button",className:"pp-region-trigger","aria-label":"部署区域","aria-haspopup":"listbox","aria-expanded":H,disabled:ie||L||!C,onClick:()=>Z(ve=>!ve),children:[l.jsx("span",{children:N==="cn-shanghai"?"华东 2(上海)":"华北 2(北京)"}),l.jsx(Cw,{className:`pp-region-chevron${H?" is-open":""}`})]}),H&&l.jsxs(l.Fragment,{children:[l.jsx("div",{className:"menu-scrim",onClick:()=>Z(!1)}),l.jsx("div",{className:"pp-region-menu",role:"listbox","aria-label":"部署区域",children:[{value:"cn-beijing",label:"华北 2(北京)"},{value:"cn-shanghai",label:"华东 2(上海)"}].map(ve=>{const xe=ve.value===N;return l.jsxs("button",{type:"button",role:"option","aria-selected":xe,className:`pp-region-option${xe?" is-selected":""}`,onClick:()=>{C==null||C(ve.value),Z(!1)},children:[l.jsx("span",{children:ve.label}),xe&&l.jsx(Js,{"aria-hidden":"true"})]},ve.value)})})]})]});w.useEffect(()=>(le.current=!0,()=>{le.current=!1}),[]),w.useEffect(()=>{if(!ee)return;const Q=document.body.style.overflow;document.body.style.overflow="hidden";const ve=xe=>{xe.key==="Escape"&&ce(!1)};return window.addEventListener("keydown",ve),()=>{document.body.style.overflow=Q,window.removeEventListener("keydown",ve)}},[ee]);const Le=w.useMemo(()=>!(e!=null&&e.files)||!Array.isArray(e.files)?{name:"",children:new Map}:ege(e.files),[e==null?void 0:e.files]);if(!e||!Array.isArray(e.files))return l.jsx("div",{className:"pp-error",children:"项目数据无效"});const Ke=e.files.find(Q=>Q.path===T)??null,Ot=(_==null?void 0:_.mode)??"public",He=Bme(y?[...g,...wu]:g,x),Ce=He.length+yt.length;function Ie(Q){B(ve=>{const xe=new Set(ve);return xe.has(Q)?xe.delete(Q):xe.add(Q),xe})}function wt(Q,ve){o&&(o({...e,files:Q}),ve!==void 0&&R(ve))}function Kt(Q){Ke&&wt(e.files.map(ve=>ve.path===Ke.path?{...ve,content:Q}:ve))}function Pt(){const Q=G.trim();if(V(!1),P(""),!!Q){if(e.files.some(ve=>ve.path===Q)){R(Q);return}wt([...e.files,{path:Q,content:""}],Q)}}function pn(){if(!Ke)return;const Q=window.prompt("重命名文件",Ke.path),ve=Q==null?void 0:Q.trim();!ve||ve===Ke.path||e.files.some(xe=>xe.path===ve)||wt(e.files.map(xe=>xe.path===Ke.path?{...xe,path:ve}:xe),ve)}function je(){var ve;if(!Ke)return;const Q=e.files.filter(xe=>xe.path!==Ke.path);wt(Q,((ve=Q[0])==null?void 0:ve.path)??null)}function st(Q,ve){at(xe=>xe.map(Xe=>Xe.id===Q?{...Xe,...ve}:Xe))}function It(Q){at(ve=>ve.filter(xe=>xe.id!==Q))}function At(){at(Q=>[...Q,nge()])}function me(Q){k&&k(Q==="public"?void 0:{..._??{mode:Q},mode:Q})}function Ve(Q){k==null||k({..._??{mode:"private"},...Q})}function nt(){const Q=new Map(yt.map(xe=>({key:xe.key.trim(),value:xe.value})).filter(xe=>xe.key.length>0).map(xe=>[xe.key,xe.value])),ve=y?[...g,...wu]:g;for(const xe of q6(ve,x))Q.set(xe.key,xe.value);return[...Q].map(([xe,Xe])=>({key:xe,value:Xe}))}async function Xt(){if(!(!E||ie||re)){J(null),pe(!0);try{await E(!y)}catch(Q){le.current&&J(`更新飞书配置失败:${Q instanceof Error?Q.message:String(Q)}`)}finally{le.current&&pe(!1)}}}async function mn(){var ve;if(!c||ie||F)return;if(Ot!=="public"&&!((ve=_==null?void 0:_.vpcId)!=null&&ve.trim())){J("使用 VPC 网络时,请填写 VPC ID。");return}const Q=QA(g,x);if(Q){const xe=g.find(Xe=>Xe.key===Q.key);J(`请返回配置页填写 ${(xe==null?void 0:xe.comment)||(xe==null?void 0:xe.key)}(${xe==null?void 0:xe.key})。`);return}if(y){const xe=QA(wu,x);if(xe){const Xe=wu.find(qe=>qe.key===xe.key);J(`启用飞书后,请填写${(Xe==null?void 0:Xe.comment)||(Xe==null?void 0:Xe.key)}。`);return}}oe(!0)}async function Qt(){if(!c||ie)return;oe(!1);const Q=nt();le.current&&(J(null),Ee(null),Ge({}),rt(null),q(!0));const ve=`${Date.now()}-${Math.random().toString(36).slice(2,8)}`;let xe=(s==null?void 0:s.trim())||e.name||"生成中…";const Xe=Date.now(),qe={id:ve,runtimeName:xe,runtimeId:h,region:N,startedAt:Xe,status:"running",phase:"prepare",label:"准备部署",agentDraft:r};m==null||m(qe),p==null||p(qe);try{const Je=await c(e,ct=>{var Rt;ct.runtimeName&&(xe=ct.runtimeName),le.current&&(Ge(Ft=>({...Ft,[ct.phase]:ct})),rt(ct.phase)),m==null||m({id:ve,runtimeName:xe,runtimeId:h,region:N,startedAt:Xe,status:"running",phase:ct.phase,label:((Rt=j.find(Ft=>Ft.phase===ct.phase))==null?void 0:Rt.label)??ct.phase,message:ct.message,pct:ct.pct})},y?{taskId:ve,im:{feishu:{enabled:!0}},envs:Q}:{taskId:ve,envs:Q});le.current&&(Ee(Je),rt(null)),await(d==null?void 0:d(Je)),m==null||m({id:ve,runtimeName:Je.agentName||xe,runtimeId:Je.runtimeId||h,region:Je.region||N,startedAt:Xe,status:"success",phase:"complete",label:"部署完成"})}catch(Je){const ct=Je instanceof Error?Je.message:String(Je);if(Je instanceof DOMException&&Je.name==="AbortError"){le.current&&(J(null),rt(null)),m==null||m({id:ve,runtimeName:xe,runtimeId:h,region:N,startedAt:Xe,status:"cancelled",label:"已取消",message:"部署已取消,相关 Runtime 资源已请求销毁。"});return}le.current&&J(ct),m==null||m({id:ve,runtimeName:xe,runtimeId:h,region:N,startedAt:Xe,status:"error",label:"部署失败",message:ct,retry:mn})}finally{le.current&&q(!1)}}function te(){oe(!1)}async function he(){if(!(!fe||ze)){We(!0),J(null);try{const{addConnection:Q,addRuntimeConnection:ve,remoteAppId:xe,loadConnections:Xe}=await lc(async()=>{const{addConnection:ct,addRuntimeConnection:Rt,remoteAppId:Ft,loadConnections:vn}=await Promise.resolve().then(()=>NS);return{addConnection:ct,addRuntimeConnection:Rt,remoteAppId:Ft,loadConnections:vn}},void 0),{probeRuntimeApps:qe}=await lc(async()=>{const{probeRuntimeApps:ct}=await Promise.resolve().then(()=>Az);return{probeRuntimeApps:ct}},void 0);let Je;if(fe.runtimeId){const ct=fe.region??"cn-beijing",Rt=await qe(fe.runtimeId,ct)??[];Je=ve(fe.runtimeId,fe.agentName,ct,Rt,Rt.length>0?{[Rt[0]]:fe.agentName}:void 0,fe.version)}else Je=await Q(fe.agentName,fe.url,fe.apikey,"");if(Je.apps.length===0)J("连接成功,但该地址未发现任何 Agent(/list-apps 为空)。");else{const ct={[Je.apps[0]]:fe.agentName},Rt={...Je,appLabels:{...Je.appLabels??{},...ct}},vn=Xe().map(Ut=>Ut.id===Je.id?Rt:Ut);localStorage.setItem("veadk_agentkit_connections",JSON.stringify(vn));const{registerConnections:_n}=await lc(async()=>{const{registerConnections:Ut}=await Promise.resolve().then(()=>NS);return{registerConnections:Ut}},void 0);if(_n(vn),u){const Ut=xe(Je.id,Je.apps[0]);u(Ut,fe.agentName)}else alert(`🎉 Agent "${fe.agentName}" 已添加到左上角下拉列表!`)}}catch(Q){J(`添加 Agent 失败:${Q instanceof Error?Q.message:String(Q)}`)}finally{We(!1)}}}function Oe(){const Q=Hme(e.files),ve=URL.createObjectURL(Q),xe=document.createElement("a");xe.href=ve,xe.download=`${e.name||"project"}.zip`,document.body.appendChild(xe),xe.click(),document.body.removeChild(xe),URL.revokeObjectURL(ve)}function De(Q,ve,xe){return tge(Q).map(Xe=>{const qe=xe?`${xe}/${Xe.name}`:Xe.name,Je=Xe.path!==void 0,ct={paddingLeft:8+ve*14};if(Je){const Ft=Xe.path===T;return l.jsxs("button",{type:"button",className:`pp-row pp-file${Ft?" pp-active":""}`,style:ct,onClick:()=>R(Xe.path),title:Xe.path,children:[l.jsx(OH,{className:"pp-ic"}),l.jsx("span",{className:"pp-label",children:Xe.name})]},qe)}const Rt=M.has(qe);return l.jsxs("div",{children:[l.jsxs("button",{type:"button",className:"pp-row pp-folder",style:ct,onClick:()=>Ie(qe),children:[l.jsx(xs,{className:`pp-ic pp-chevron${Rt?"":" pp-open"}`}),l.jsx(CL,{className:"pp-ic"}),l.jsx("span",{className:"pp-label",children:Xe.name})]}),!Rt&&De(Xe,ve+1,qe)]},qe)})}return l.jsxs("div",{className:`pp-root${c?" is-deploy":""}${t?" is-embedded":""}${D?" has-primary-pane":""}`,children:[c&&!t&&l.jsx(rge,{left:l.jsxs("div",{className:"pp-toolbar-left",children:[S&&l.jsxs("button",{type:"button",className:"pp-toolbar-back",onClick:S,children:[l.jsx(xL,{className:"pp-ic"}),A]}),l.jsxs("span",{className:"pp-toolbar-title",children:["部署 ",s||e.name||"未命名 Agent",i&&i>1?` 等 ${i} 个智能体`:""]})]}),right:null}),l.jsxs("div",{className:"pp-body",children:[c&&!D&&l.jsx("section",{className:"pp-release-overview","aria-label":"发布概览",children:l.jsxs("div",{className:"pp-release-preview",children:[l.jsxs("div",{className:"pp-flow-thumbnail",children:[r&&l.jsx(eg,{draft:r,direction:"horizontal",selectedPath:[],onSelect:ha,onAdd:ha,onInsert:ha,onDelete:ha,readOnly:!0,interactivePreview:!0}),l.jsx("button",{type:"button",className:"pp-flow-expand",onClick:()=>ce(!0),"aria-label":"放大查看执行流程",title:"放大查看",children:l.jsx(tc,{"aria-hidden":!0})})]}),l.jsxs("div",{className:"pp-release-info",children:[l.jsxs("div",{className:"pp-release-info-main",children:[l.jsx("h2",{children:s||e.name||"未命名 Agent"}),(r==null?void 0:r.description)&&l.jsx("p",{className:"pp-release-description",title:r.description,children:r.description}),l.jsxs("dl",{className:"pp-release-facts",children:[l.jsxs("div",{children:[l.jsx("dt",{children:"Agent 数量"}),l.jsx("dd",{children:i??1})]}),a&&l.jsxs(l.Fragment,{children:[l.jsxs("div",{children:[l.jsx("dt",{children:"模型"}),l.jsx("dd",{children:a.modelName})]}),l.jsxs("div",{children:[l.jsx("dt",{children:"描述"}),l.jsx("dd",{className:"pp-release-fact-long",children:a.description})]}),l.jsxs("div",{children:[l.jsx("dt",{children:"系统提示词"}),l.jsx("dd",{className:"pp-release-fact-long pp-release-prompt",children:a.instruction})]}),l.jsxs("div",{children:[l.jsx("dt",{children:"优化选项"}),l.jsx("dd",{children:a.optimizations.length>0?a.optimizations.join("、"):"未启用"})]})]})]})]}),l.jsxs("div",{className:"pp-artifact-actions",children:[O&&l.jsxs("button",{type:"button",className:"pp-secondary",onClick:O,children:[l.jsx(AH,{className:"pp-ic"}),"导出配置文件"]}),X&&o&&l.jsx(Yme,{project:e,onChange:o,className:"pp-artifact-source"}),e.files.length>0&&l.jsxs("button",{type:"button",className:"pp-secondary",onClick:Oe,children:[l.jsx(Rw,{className:"pp-ic"}),"导出源码"]})]})]})]})}),l.jsxs("div",{className:"pp-files-area",children:[l.jsxs("div",{className:"pp-sidebar",children:[l.jsxs("div",{className:"pp-sidebar-head",children:[l.jsx("span",{className:"pp-project-name",title:e.name,children:"文件预览"}),X&&l.jsx("button",{type:"button",className:"pp-icon-btn",title:"新建文件",onClick:()=>{V(!0),P("")},children:l.jsx(CH,{className:"pp-ic"})})]}),l.jsxs("div",{className:"pp-tree",children:[I&&l.jsx("input",{className:"pp-new-input",autoFocus:!0,placeholder:"path/to/file.py",value:G,onChange:Q=>P(Q.target.value),onBlur:Pt,onKeyDown:Q=>{Q.key==="Enter"&&Pt(),Q.key==="Escape"&&(V(!1),P(""))}}),e.files.length===0&&!I?l.jsx("div",{className:"pp-empty",children:"暂无文件"}):De(Le,0,"")]})]}),l.jsxs("div",{className:"pp-main",children:[l.jsxs("div",{className:"pp-main-head",children:[l.jsx("span",{className:"pp-path",title:Ke==null?void 0:Ke.path,children:(Ke==null?void 0:Ke.path)??"未选择文件"}),l.jsx("div",{className:"pp-actions",children:X&&Ke&&l.jsxs(l.Fragment,{children:[l.jsx("button",{type:"button",className:"pp-icon-btn",title:"重命名",onClick:pn,children:l.jsx(WH,{className:"pp-ic"})}),l.jsx("button",{type:"button",className:"pp-icon-btn pp-danger",title:"删除",onClick:je,children:l.jsx(ta,{className:"pp-ic"})})]})})]}),l.jsx("div",{className:"pp-content",children:Ke==null?l.jsx("div",{className:"pp-placeholder",children:"选择左侧文件以查看内容"}):X?l.jsx("div",{className:"pp-codemirror",children:l.jsx(w.Suspense,{fallback:l.jsx("div",{className:"pp-editor-loading",children:"加载编辑器…"}),children:l.jsx(Gme,{value:Ke.content,path:Ke.path,onChange:Kt})})}):l.jsx("pre",{className:"pp-pre hljs",dangerouslySetInnerHTML:{__html:Qme(Ke.content,Ke.path)}})})]})]}),c&&l.jsxs("aside",{className:"pp-config","aria-label":"部署配置",children:[l.jsx("div",{className:"pp-config-head",children:l.jsx("div",{className:"pp-config-title",children:"部署配置"})}),l.jsxs("div",{className:"pp-config-scroll",children:[D,!D&&l.jsxs("section",{className:"pp-config-section",children:[l.jsx("div",{className:"pp-config-label",children:"发布区域"}),be(!1)]}),!D&&l.jsxs("section",{className:"pp-config-section",children:[l.jsx("div",{className:"pp-config-label",children:"消息渠道"}),l.jsx("div",{className:`pp-channel-card${y?" is-flipped":""}`,children:l.jsxs("div",{className:"pp-channel-card-inner",children:[l.jsxs("button",{type:"button",className:"pp-channel-card-face pp-channel-card-front","aria-pressed":y,"aria-hidden":y,tabIndex:y?-1:0,onClick:()=>void Xt(),disabled:y||ie||re||!E,children:[l.jsx("span",{className:"pp-channel-logo",children:l.jsx("img",{src:Fme,alt:""})}),l.jsxs("span",{className:"pp-channel-card-copy",children:[l.jsx("strong",{children:"飞书"}),l.jsx("small",{children:re?"正在启用并更新配置…":"接收消息并通过飞书机器人回复"})]})]}),l.jsxs("div",{className:"pp-channel-card-face pp-channel-card-back","aria-hidden":!y,children:[l.jsxs("div",{className:"pp-channel-card-head",children:[l.jsx("strong",{children:"飞书配置"}),l.jsx("button",{type:"button",className:"pp-channel-remove",tabIndex:y?0:-1,onClick:()=>void Xt(),disabled:!y||ie||re||!E,children:re?"取消中…":"取消"})]}),l.jsx("div",{className:"pp-channel-fields",children:wu.map(Q=>l.jsxs("label",{children:[l.jsxs("span",{children:[Q.comment||Q.key,Q.required&&l.jsx("small",{children:"必填"})]}),l.jsx("input",{type:Q.key.includes("SECRET")?"password":"text",value:x[Q.key]??"",placeholder:Q.placeholder,tabIndex:y?0:-1,disabled:!y||ie||!b,autoComplete:"off",onChange:ve=>b==null?void 0:b(Q.key,ve.currentTarget.value)})]},Q.key))})]})]})})]}),l.jsxs("section",{className:"pp-config-section",children:[l.jsx("div",{className:"pp-config-label",children:"网络"}),D&&be(!0),L&&l.jsx("p",{className:"pp-config-note",children:"现有 Runtime 的区域与网络模式保持不变。"}),l.jsxs("div",{className:"pp-network-layout",children:[l.jsx("div",{className:"pp-network-modes",role:"radiogroup","aria-label":"网络模式",children:["public","private","both"].map(Q=>l.jsxs("label",{className:"pp-network-option",children:[l.jsx("input",{type:"radio",name:"deployment-network-mode",value:Q,checked:Ot===Q,onChange:()=>me(Q),disabled:ie||L||!k}),l.jsx("span",{children:Q==="public"?"公网":Q==="private"?"VPC":"公网 + VPC"})]},Q))}),Ot!=="public"&&l.jsxs("div",{className:"pp-network-fields",children:[l.jsxs("label",{children:[l.jsx("span",{children:"VPC ID"}),l.jsx("input",{value:(_==null?void 0:_.vpcId)??"",placeholder:"vpc-xxxxxxxx",disabled:ie||L,onChange:Q=>Ve({vpcId:Q.target.value})})]}),l.jsxs("label",{children:[l.jsxs("span",{children:["子网 ID ",l.jsx("small",{children:"可选,多个用逗号分隔"})]}),l.jsx("input",{value:(_==null?void 0:_.subnetIds)??"",placeholder:"subnet-xxx, subnet-yyy",disabled:ie||L,onChange:Q=>Ve({subnetIds:Q.target.value})})]}),l.jsxs("label",{className:"pp-network-check",children:[l.jsx("input",{type:"checkbox",checked:!!(_!=null&&_.enableSharedInternetAccess),disabled:ie||L,onChange:Q=>Ve({enableSharedInternetAccess:Q.target.checked})}),"VPC 内共享公网出口"]})]})]})]}),l.jsxs("section",{className:"pp-config-section pp-env-section",children:[l.jsxs("div",{className:"pp-env-head",children:[l.jsxs("div",{children:[l.jsxs("div",{className:"pp-config-label",children:["环境变量",l.jsxs("span",{className:"pp-agent-child-count pp-env-count",children:[Ce," 项"]})]}),l.jsx("div",{className:"pp-env-sub",children:"组件配置会自动同步到这里,部署前可核对最终值。"})]}),l.jsx("button",{type:"button",className:"pp-icon-btn",title:St?"隐藏值":"显示值",onClick:()=>Tt(Q=>!Q),children:St?l.jsx(SH,{className:"pp-ic"}):l.jsx(SL,{className:"pp-ic"})})]}),l.jsxs("button",{type:"button",className:"pp-env-add",onClick:At,disabled:ie,children:[l.jsx(sr,{className:"pp-ic"}),"添加变量"]}),(He.length>0||yt.length>0)&&l.jsxs("div",{className:"pp-env-table",children:[He.length>0&&l.jsxs("div",{className:"pp-env-group",children:[l.jsxs("div",{className:"pp-env-group-head",children:[l.jsx("span",{children:"组件自动生成"}),l.jsxs("small",{children:[He.length," 项"]})]}),He.map(Q=>{const ve=Q.key.startsWith("ENABLE_");return l.jsxs("div",{className:"pp-env-row pp-env-row-derived",children:[l.jsx("input",{className:"pp-env-key-fixed",value:Q.key,readOnly:!0,disabled:ie,"aria-label":`${Q.key} 环境变量名`}),l.jsx("input",{type:ve||St?"text":"password",value:Q.value,placeholder:Q.required?"必填,尚未填写":"可选,尚未填写",readOnly:ve,disabled:ie||!ve&&!b,autoComplete:"off","aria-label":`${Q.key} 环境变量值`,onChange:xe=>b==null?void 0:b(Q.key,xe.currentTarget.value)}),l.jsx("span",{className:"pp-env-source",children:ve?"自动":"同步"})]},Q.key)})]}),yt.length>0&&l.jsxs("div",{className:"pp-env-group-head pp-env-group-head-custom",children:[l.jsx("span",{children:"自定义变量"}),l.jsxs("small",{children:[yt.length," 项"]})]}),yt.map(Q=>l.jsxs("div",{className:"pp-env-row",children:[l.jsx("input",{value:Q.key,placeholder:"名称",disabled:ie,autoComplete:"off",onChange:ve=>st(Q.id,{key:ve.currentTarget.value})}),l.jsx("input",{type:St?"text":"password",value:Q.value,placeholder:"值",disabled:ie,autoComplete:"off",onChange:ve=>st(Q.id,{value:ve.currentTarget.value})}),l.jsx("button",{type:"button",className:"pp-icon-btn pp-env-remove",title:"删除变量",disabled:ie,onClick:()=>It(Q.id),children:l.jsx(Hr,{className:"pp-ic"})})]},Q.id))]})]}),(ie||fe||Object.keys(Te).length>0)&&l.jsxs("section",{className:"pp-config-section pp-progress-section",children:[l.jsx("div",{className:"pp-config-label",children:"部署进度"}),l.jsx("ol",{className:"pp-steps",children:j.map((Q,ve)=>{const xe=ke?j.findIndex(ct=>ct.phase===ke):-1,Xe=!!ye&&(xe===-1?ve===0:ve===xe);let qe;fe?qe="done":Xe?qe="failed":xe===-1?qe=ie?"active":"pending":veQ.phase===ke))==null?void 0:it.label)??ke}阶段):`:""}${ye}`,onRetry:mn,retryLabel:L?"重试更新":"重试部署"}),fe&&l.jsxs("section",{className:"pp-deploy-result",children:[l.jsx("div",{className:"pp-deploy-result-header",children:L?"更新成功":"部署成功"}),l.jsxs("div",{className:"pp-deploy-result-body",children:[fe.region&&l.jsxs("div",{className:"pp-deploy-result-field",children:[l.jsx("label",{children:"区域"}),l.jsx("code",{children:fe.region==="cn-shanghai"?"上海 (cn-shanghai)":"北京 (cn-beijing)"})]}),l.jsxs("div",{className:"pp-deploy-result-field",children:[l.jsx("label",{children:"Agent 名称"}),l.jsx("code",{children:fe.agentName})]}),l.jsxs("div",{className:"pp-deploy-result-field",children:[l.jsx("label",{children:"API 端点"}),l.jsx("code",{className:"pp-deploy-result-url",children:fe.url})]})]}),l.jsxs("div",{className:"pp-deploy-result-actions",children:[l.jsxs("button",{type:"button",className:"pp-deploy-result-btn",onClick:he,disabled:ze,children:[ze?l.jsx(Mt,{className:"pp-ic spin"}):l.jsx(LL,{className:"pp-ic"}),ze?"连接中…":"立即对话"]}),fe.consoleUrl&&l.jsxs("a",{href:fe.consoleUrl,target:"_blank",rel:"noopener noreferrer",className:"pp-console-link pp-console-link-btn",children:[l.jsx(Lw,{className:"pp-ic"}),"控制台"]})]})]})]}),l.jsx("div",{className:"pp-config-actions",children:l.jsx("button",{type:"button",className:"pp-deploy studio-update-action",onClick:mn,disabled:ie||re||F||!!n,title:n,children:ie?`${f}中…`:ye?`重试${f}`:f})})]})]}),ee&&r&&Ns.createPortal(l.jsx("div",{className:"pp-flow-backdrop",onMouseDown:Q=>{Q.target===Q.currentTarget&&ce(!1)},children:l.jsxs("section",{className:"pp-flow-dialog",role:"dialog","aria-modal":"true","aria-label":"执行流程预览",children:[l.jsxs("header",{children:[l.jsxs("div",{children:[l.jsx("strong",{children:"执行流程"}),l.jsx("span",{children:"只读预览,可缩放与拖动画布"})]}),l.jsx("button",{type:"button",onClick:()=>ce(!1),"aria-label":"关闭执行流程预览",children:l.jsx(Hr,{"aria-hidden":!0})})]}),l.jsx("div",{className:"pp-flow-dialog-canvas",children:l.jsx(eg,{draft:r,direction:"horizontal",selectedPath:[],onSelect:ha,onAdd:ha,onInsert:ha,onDelete:ha,readOnly:!0,interactivePreview:!0})})]})}),document.body),l.jsx(Wme,{open:ne,isUpdate:L,onCancel:te,onConfirm:()=>void Qt()})]})}const nC="dogfooding",pb="dogfooding",mb="dogfooding_b";let sge=0;const gb=()=>++sge;function rC(e){return e.blocks.filter(t=>t.kind==="text").map(t=>t.text).join("")}function ige(e){const t=e.trim(),n=t.match(/^```(?:json)?\s*\n?([\s\S]*?)\n?```$/i);return(n?n[1]:t).trim()}async function sC(e){const t=[],n=ige(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 Kw(h_(a))}catch{}return null}function age({userId:e,onBack:t,onCreate:n,onAgentAdded:r,onDeploymentTaskChange:s}){const[i,a]=w.useState([{id:gb(),role:"assistant",text:"你好,我是 VeADK 的智能构建助手。用自然语言描述你想要的 Agent,我会直接帮你生成一个可运行的 VeADK 项目,并在右侧实时预览。"}]),[o,c]=w.useState(""),[u,d]=w.useState(!1),[f,h]=w.useState(null),[p,m]=w.useState(null),[y,E]=w.useState(!1),[g,x]=w.useState(null),[b,_]=w.useState(null),[k,N]=w.useState(!1),[C,S]=w.useState(!1),[A,O]=w.useState({}),D=w.useRef(null),F=w.useRef(null),X=w.useRef(null),L=w.useRef(null),j=w.useRef(null);w.useEffect(()=>{const q=L.current;q&&q.scrollTo({top:q.scrollHeight,behavior:"smooth"})},[i,u]),w.useEffect(()=>{const q=j.current;q&&(q.style.height="auto",q.style.height=Math.min(q.scrollHeight,160)+"px")},[o]);const T=q=>a(ne=>[...ne,{id:gb(),role:"assistant",text:q}]);async function R(){if(D.current)return D.current;const q=await Sm(nC,e);return D.current=q,q}async function M(q,ne){if(ne.current)return ne.current;const oe=await Sm(q,e);return ne.current=oe,oe}async function B(q,ne){if(!A[q])try{const oe=await zw(ne);O(ee=>({...ee,[q]:oe.model||ne}))}catch{O(oe=>({...oe,[q]:ne}))}}async function I(q,ne,oe){const ee=await M(q,ne);let ce=zs();for await(const pe of Xd({appName:q,userId:e,sessionId:ee,text:oe}))ce=xc(ce,pe);const re=rC(ce).trim();return{project:await sC(re),finalText:re}}const V=async(q,ne,oe)=>Dg(q.name,q.files,{region:"cn-beijing",projectName:"default"},{...oe,onStage:ne}),G=async()=>{const q=o.trim();if(!(!q||u)){if(a(ne=>[...ne,{id:gb(),role:"user",text:q}]),c(""),h(null),d(!0),y){x(null),_(null),N(!0),S(!0),B("a",pb),B("b",mb);const ne=I(pb,F,q).then(({project:ee})=>(x(ee),ee)).catch(ee=>{const ce=ee instanceof Error?ee.message:String(ee);return h(ce),null}).finally(()=>N(!1)),oe=I(mb,X,q).then(({project:ee})=>(_(ee),ee)).catch(ee=>{const ce=ee instanceof Error?ee.message:String(ee);return h(ce),null}).finally(()=>S(!1));try{const[ee,ce]=await Promise.all([ne,oe]),re=[ee?`方案 A:${ee.name}`:null,ce?`方案 B:${ce.name}`:null].filter(Boolean);re.length?T(`已生成两个方案(${re.join(",")}),请在右侧对比后采用其一。`):T("(两个方案都没有返回可用的项目,请再描述一下你的需求。)")}finally{d(!1)}return}try{const ne=await R();let oe=zs();for await(const re of Xd({appName:nC,userId:e,sessionId:ne,text:q}))oe=xc(oe,re);const ee=rC(oe).trim(),ce=await sC(ee);ce?(m(ce),T(`已生成项目:${ce.name}(${ce.files.length} 个文件),可在右侧预览和编辑。`)):T(ee||"(助手没有返回内容,请再描述一下你的需求。)")}catch(ne){const oe=ne instanceof Error?ne.message:String(ne);h(oe),T(`抱歉,调用智能构建助手失败:${oe}`)}finally{d(!1)}}},P=q=>{const ne=q==="a"?g:b;if(!ne)return;m(ne),E(!1),x(null),_(null),N(!1),S(!1);const oe=q==="a"?"A":"B",ee=q==="a"?A.a:A.b;T(`已采用方案 ${oe}(${ee??(q==="a"?pb:mb)}),可继续编辑。`)},ie=q=>{q.key==="Enter"&&!q.shiftKey&&!q.nativeEvent.isComposing&&(q.preventDefault(),G())};return l.jsx("div",{className:"ic-root",children:l.jsxs("div",{className:"ic-body",children:[l.jsxs("div",{className:"ic-chat",children:[l.jsxs("div",{className:"ic-transcript",ref:L,children:[l.jsx($s,{initial:!1,children:i.map(q=>l.jsxs(Dt.div,{className:`ic-turn ic-turn--${q.role}`,initial:{opacity:0,y:8},animate:{opacity:1,y:0},transition:{duration:.22,ease:"easeOut"},children:[q.role==="assistant"&&l.jsx("div",{className:"ic-avatar",children:l.jsx(Ro,{className:"ic-avatar-icon"})}),l.jsx("div",{className:"ic-bubble",children:q.role==="assistant"?l.jsx(Pf,{text:q.text}):q.text})]},q.id))}),u&&l.jsxs(Dt.div,{className:"ic-turn ic-turn--assistant",initial:{opacity:0,y:8},animate:{opacity:1,y:0},children:[l.jsx("div",{className:"ic-avatar",children:l.jsx(Ro,{className:"ic-avatar-icon"})}),l.jsxs("div",{className:"ic-bubble ic-bubble--typing",children:[l.jsx("span",{className:"ic-dot"}),l.jsx("span",{className:"ic-dot"}),l.jsx("span",{className:"ic-dot"})]})]})]}),f&&l.jsxs("div",{className:"ic-error",children:[l.jsx(Rg,{className:"ic-error-icon"}),f]}),l.jsxs("div",{className:"ic-composer",children:[l.jsxs("div",{className:"ic-composer-box",children:[l.jsx("textarea",{ref:j,className:"ic-input",rows:1,placeholder:"描述你想要的 Agent,例如「一个帮我整理周报的写作助手」…",value:o,onChange:q=>c(q.target.value),onKeyDown:ie,disabled:u}),l.jsx("button",{className:"ic-send",onClick:()=>void G(),disabled:!o.trim()||u,title:"发送 (Enter)",children:l.jsx(ZH,{className:"ic-send-icon"})})]}),l.jsxs("div",{className:"ic-composer-foot",children:[l.jsxs("label",{className:"ic-ab-toggle",title:"同时用两个模型生成方案进行对比",children:[l.jsx("input",{type:"checkbox",className:"ic-ab-checkbox",checked:y,disabled:u,onChange:q=>E(q.target.checked)}),l.jsx("span",{className:"ic-ab-track",children:l.jsx("span",{className:"ic-ab-thumb"})}),l.jsx("span",{className:"ic-ab-label",children:"A/B 对比"})]}),l.jsx("div",{className:"ic-composer-hint",children:"Enter 发送 · Shift+Enter 换行"})]})]})]}),l.jsx("aside",{className:"ic-preview",children:y?l.jsxs("div",{className:"ic-compare",children:[l.jsx(iC,{side:"a",project:g,loading:k,model:A.a,onAdopt:()=>P("a")}),l.jsx("div",{className:"ic-compare-divider"}),l.jsx(iC,{side:"b",project:b,loading:C,model:A.b,onAdopt:()=>P("b")})]}):p?l.jsx(w0,{project:p,onChange:m,onDeploy:V,onAgentAdded:r,onDeploymentTaskChange:s}):l.jsxs("div",{className:"ic-preview-empty",children:[l.jsxs("div",{className:"ic-preview-empty-icon",children:[l.jsx(LH,{className:"ic-preview-empty-glyph"}),l.jsx(Lo,{className:"ic-preview-empty-spark"})]}),l.jsx("div",{className:"ic-preview-empty-title",children:"还没有项目"}),l.jsx("div",{className:"ic-preview-empty-sub",children:"描述你的需求,我会帮你生成 VeADK 项目"})]})})]})})}function iC({side:e,project:t,loading:n,model:r,onAdopt:s}){const i=e==="a"?"方案 A":"方案 B";return l.jsxs("div",{className:"ic-pane",children:[l.jsxs("div",{className:"ic-pane-head",children:[l.jsxs("div",{className:"ic-pane-title",children:[l.jsx("span",{className:`ic-pane-tag ic-pane-tag--${e}`,children:i}),r&&l.jsx("span",{className:"ic-pane-model",children:r})]}),l.jsxs("button",{className:"ic-adopt",onClick:s,disabled:!t||n,title:`采用${i}`,children:["采用",e==="a"?"方案 A":"方案 B"]})]}),l.jsx("div",{className:"ic-pane-body",children:n?l.jsxs("div",{className:"ic-pane-loading",children:[l.jsx(Mt,{className:"ic-pane-spinner"}),l.jsx("span",{children:"正在生成…"})]}):t?l.jsx(w0,{project:t}):l.jsx("div",{className:"ic-pane-empty",children:"该方案未返回可用项目"})})]})}const oge=/^[A-Za-z_][A-Za-z0-9_]*$/;function cc(e){return e.trim().length===0?"名称为必填项":e==="user"?"user 是 Google ADK 保留名称,请使用其他名称":oge.test(e)?null:"名称须以英文字母或下划线开头,且只能包含英文字母、数字和下划线"}function Q6(e){const t=new Set,n=new Set,r=s=>{cc(s.name)===null&&(t.has(s.name)?n.add(s.name):t.add(s.name)),s.subAgents.forEach(r)};return r(e),n}function lge({className:e,...t}){return l.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:[l.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"}),l.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 Ru={llm:{id:"llm",label:"LLM 智能体",desc:"大模型驱动,自主完成任务",icon:lge},sequential:{id:"sequential",label:"顺序型智能体",desc:"子 Agent 按顺序依次执行",icon:MH},parallel:{id:"parallel",label:"并行型智能体",desc:"子 Agent 并行执行后汇总",icon:ez},loop:{id:"loop",label:"循环型智能体",desc:"子 Agent 循环执行到满足条件",icon:jw},a2a:{id:"a2a",label:"远程智能体",desc:"通过 A2A 协议调用远程 Agent",icon:Lg}},cge=[Ru.llm,Ru.sequential,Ru.parallel,Ru.loop,Ru.a2a],Z6=e=>e==="sequential"||e==="parallel"||e==="loop",v0=e=>e==="a2a";function Ts(e){return e.trimEnd().replace(/[。.]+$/,"")}function ig(e,t){const n=e.trim().toLocaleLowerCase();return n?t.some(r=>r==null?void 0:r.toLocaleLowerCase().includes(n)):!0}function eo(e,t){return e[t]|e[t+1]<<8}function gl(e,t){return(e[t]|e[t+1]<<8|e[t+2]<<16|e[t+3]<<24)>>>0}async function uge(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 J6(e,t={}){let r=-1;for(let u=e.length-22;u>=0&&u>e.length-65557;u--)if(gl(e,u)===101010256){r=u;break}if(r<0)throw new Error("无效的 zip:找不到 EOCD");const s=eo(e,r+10);if(t.maxEntries!==void 0&&s>t.maxEntries)throw new Error(`zip 文件数不能超过 ${t.maxEntries} 个`);let i=gl(e,r+16);const a=new TextDecoder("utf-8"),o=[];let c=0;for(let u=0;ut.maxUncompressedBytes)throw new Error("zip 解压后的内容过大");const x=eo(e,E+26),b=eo(e,E+28),_=E+30+x+b,k=e.subarray(_,_+f);let N;if(d===0)N=k;else if(d===8)N=await uge(k);else{i+=46+p+m+y;continue}o.push({name:g,text:a.decode(N)}),i+=46+p+m+y}return o}const dge="/skillhub/v1/skills";async function fge(e,t="public"){const n=e.trim(),r=`${dge}?query=${encodeURIComponent(n)}&namespace=${encodeURIComponent(t)}`,s=await fetch(r,{headers:{accept:"application/json"},signal:Ws(void 0,Gc)});if(!s.ok)throw new Error(`搜索失败 (${s.status})`);return((await s.json()).Skills??[]).map(a=>{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 hge({selected:e,onChange:t}){const[n,r]=w.useState(""),[s,i]=w.useState([]),[a,o]=w.useState(!1),[c,u]=w.useState(null),[d,f]=w.useState(!1),h=y=>e.some(E=>E.source==="skillhub"&&E.slug===y),p=y=>{y.slug&&(h(y.slug)?t(e.filter(E=>!(E.source==="skillhub"&&E.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 E=await fge(y);i(E)}catch(E){u(E instanceof Error?E.message:"搜索失败,请稍后重试。"),i([])}finally{o(!1)}};return w.useEffect(()=>{const y=n.trim();if(!y){i([]),f(!1),u(null);return}const E=setTimeout(()=>m(y),300);return()=>clearTimeout(E)},[n]),l.jsxs("div",{className:"cw-skillhub",children:[l.jsxs("div",{className:"cw-skill-searchrow",children:[l.jsxs("div",{className:"cw-skill-searchbox",children:[l.jsx(Wd,{className:"cw-i cw-skill-searchicon","aria-hidden":!0}),l.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))}})]}),l.jsxs("button",{type:"button",className:"cw-btn cw-btn-soft",onClick:()=>n.trim()&&m(n),disabled:!n.trim()||a,children:[a?l.jsx(Mt,{className:"cw-i cw-spin"}):l.jsx(Wd,{className:"cw-i"}),"搜索"]})]}),c&&l.jsxs("div",{className:"cw-banner",children:[l.jsx(Ya,{className:"cw-i"}),l.jsx("span",{children:c})]}),a&&s.length===0?l.jsx("p",{className:"cw-empty-line",children:"正在搜索…"}):s.length>0?l.jsx("div",{className:"cw-skill-results",children:s.map(y=>{const E=h(y.slug||"");return l.jsxs("button",{type:"button",className:`cw-skill-result ${E?"is-on":""}`,onClick:()=>p(y),"aria-pressed":E,children:[l.jsx("span",{className:"cw-skill-result-icon","aria-hidden":!0,children:E?l.jsx(Js,{className:"cw-i cw-i-sm"}):l.jsx(sr,{className:"cw-i cw-i-sm"})}),l.jsxs("span",{className:"cw-skill-result-meta",children:[l.jsx("span",{className:"cw-skill-result-name",children:y.name}),y.description&&l.jsx("span",{className:"cw-skill-result-desc",children:Ts(y.description)}),y.sourceRepo&&l.jsx("span",{className:"cw-skill-result-repo",children:y.sourceRepo})]})]},y.id||y.slug)})}):d&&!c?l.jsx("p",{className:"cw-empty-line",children:"没有找到匹配的技能,换个关键词试试。"}):!d&&l.jsx("p",{className:"cw-empty-line",children:"输入关键词搜索火山 Find Skill 技能广场,所选技能会在生成项目时下载到 skills/ 目录。"})]})}const XE=/(^|\/)skill\.md$/i;function pge(e){const t=(e??"").replace(/\r\n?/g,` +`).split(` +`);if(!t.length||t[0].trim()!=="---")return{name:"",description:""};let n=-1;for(let s=1;s=2&&(e.startsWith('"')&&e.endsWith('"')||e.startsWith("'")&&e.endsWith("'"))}function gge(...e){var t;for(const n of e){const r=(t=n.trim().replace(/\\/g,"/").split("/").filter(Boolean).pop())==null?void 0:t.replace(/[^A-Za-z0-9_-]+/g,"-").replace(/^-+|-+$/g,"");if(r)return r.slice(0,64)}return"local-skill"}function yge(e,t){return t.trim()||e}function e5(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 bge(e){const t=new Map,n=new Set;for(const r of e)if(XE.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=XE.test("/"+r.path);if(!i&&!a&&!n.has("")||!n.has(i)&&!a)continue;const o=i?r.path.slice(i.length+1):r.path,c=t.get(i)||[];c.push({path:o,text:r.text}),t.set(i,c)}return t}function Ege(e,t,n){const r=`${n}${e?"/"+e:""}`,s=t.find(c=>XE.test("/"+c.path));if(!s)return{hit:null,error:`${r} 缺少 SKILL.md`};const i=pge(s.text),a=gge(i.name,e,n.replace(/\.[^.]+$/,"")),o=[];for(const c of t){if(c.path.split("/").some(f=>f===".."))return{hit:null,error:`${r} 包含非法路径(..):${c.path}`};const d=`skills/${a}/${c.path}`;if(!d.startsWith(`skills/${a}/`))return{hit:null,error:`${r} 包含非法路径:${c.path}`};o.push({path:d,content:c.text})}return{hit:{source:"local",id:`local:${a}:${t.length}`,name:yge(a,i.name),description:i.description||"本地 Skill",folder:a,localFiles:o},error:null}}async function xge(e){const t=new Uint8Array(await e.arrayBuffer()),r=(await J6(t)).map(s=>({path:s.name,text:s.text}));return t5(e5(r),e.name)}async function wge(e,t=new Map){const n=[];for(let r=0;re.file(t,n))}async function _ge(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 n5(e,t=""){const n=t?`${t}/${e.name}`:e.name;if(e.isFile)return[{file:await vge(e),path:n}];if(!e.isDirectory)return[];const r=await _ge(e);return(await Promise.all(r.map(s=>n5(s,n)))).flat()}function kge({selected:e,onChange:t}){const[n,r]=w.useState([]),[s,i]=w.useState([]),[a,o]=w.useState(!1),[c,u]=w.useState(!1),d=w.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=w.useRef([]),m=w.useRef(e);w.useEffect(()=>{p.current=s},[s]),w.useEffect(()=>{m.current=e},[e]);const y=b=>{const _=new Set([...p.current.map(S=>S.folder||S.name),...m.current.filter(S=>S.source==="local").map(S=>S.folder)]),k=[],N=[];for(const S of b.hits){const A=S.folder||S.name;if(_.has(A)){k.push(S.name);continue}_.add(A),N.push(S)}i(S=>[...S,...N]);const C=[...b.errors];if(k.length>0&&C.push(`已跳过重复技能:${k.join("、")}`),r(C),N.length===1&&b.errors.length===0&&k.length===0){const S=N[0];S.localFiles&&t([...m.current,{source:"local",folder:S.folder||S.name,name:S.name,description:S.description,localFiles:S.localFiles}])}},E=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)},x=async b=>{if(b.preventDefault(),d.current=0,u(!1),a)return;const _=Array.from(b.dataTransfer.items).map(k=>{var N;return(N=k.webkitGetAsEntry)==null?void 0:N.call(k)}).filter(k=>k!==null);if(_.length===0){r(["请拖入包含 SKILL.md 的文件夹或一个 .zip 文件"]);return}o(!0);try{const k=(await Promise.all(_.map(S=>n5(S)))).flat(),N=_.some(S=>S.isDirectory);if(!N&&k.length===1&&k[0].file.name.toLowerCase().endsWith(".zip")){y(await xge(k[0].file));return}if(!N){r(["请拖入包含 SKILL.md 的文件夹或一个 .zip 文件"]);return}const C=new Map(k.map(({file:S,path:A})=>[S,A]));y(await wge(k.map(({file:S})=>S),C))}catch(k){r([`读取失败:${k instanceof Error?k.message:String(k)}`])}finally{o(!1)}};return l.jsxs("div",{className:"cw-local",children:[l.jsxs("div",{className:`cw-local-dropzone ${c?"is-dragging":""}`,role:"group","aria-label":"拖入文件夹或 ZIP,自动识别 Skill",onDragEnter:E,onDragOver:b=>b.preventDefault(),onDragLeave:g,onDrop:b=>void x(b),children:[l.jsx(Mw,{className:"cw-local-drop-icon","aria-hidden":!0}),l.jsx("p",{className:"cw-local-drop-hint",children:"拖入文件夹或 ZIP,自动识别 Skill"})]}),l.jsx("p",{className:"cw-local-hint",children:"每个技能需包含 SKILL.md。支持包含多个技能的目录。"}),a&&l.jsx("p",{className:"cw-empty-line",children:"正在读取文件…"}),n.length>0&&l.jsxs("div",{className:"cw-banner",children:[l.jsx(Ya,{className:"cw-i"}),l.jsx("span",{children:n.join(";")})]}),s.length>0&&l.jsx("div",{className:"cw-skill-results",children:s.map(b=>{var k;const _=f(b.folder||b.name);return l.jsxs("button",{type:"button",className:`cw-skill-result ${_?"is-on":""}`,onClick:()=>h(b),"aria-pressed":_,children:[l.jsx("span",{className:"cw-skill-result-icon","aria-hidden":!0,children:_?l.jsx(Js,{className:"cw-i cw-i-sm"}):l.jsx(sr,{className:"cw-i cw-i-sm"})}),l.jsxs("span",{className:"cw-skill-result-meta",children:[l.jsx("span",{className:"cw-skill-result-name",children:b.name}),b.description&&l.jsx("span",{className:"cw-skill-result-desc",children:Ts(b.description)}),l.jsxs("span",{className:"cw-skill-result-repo",children:["本地 · ",((k=b.localFiles)==null?void 0:k.length)??0," 个文件"]})]})]},b.id)})})]})}function Nge({selected:e,onChange:t}){const[n,r]=w.useState([]),[s,i]=w.useState([]),[a,o]=w.useState(""),[c,u]=w.useState(!0),[d,f]=w.useState(!1),[h,p]=w.useState(null);w.useEffect(()=>{let g=!1;return(async()=>{u(!0),p(null);try{const x=await TM();g||(r(x),x.length>0&&o(x[0].id))}catch(x){g||p(x instanceof Error?x.message:"加载失败")}finally{g||u(!1)}})(),()=>{g=!0}},[]),w.useEffect(()=>{if(!a){i([]);return}const g=n.find(b=>b.id===a);let x=!1;return(async()=>{f(!0),p(null);try{const b=await AM(a,g==null?void 0:g.region);x||i(b)}catch(b){x||p(b instanceof Error?b.message:"加载失败")}finally{x||f(!1)}})(),()=>{x=!0}},[a,n]);const m=n.find(g=>g.id===a),y=(g,x)=>e.some(b=>b.source==="skillspace"&&b.skillId===g&&(b.version||"")===x),E=g=>{if(m)if(y(g.skillId,g.version))t(e.filter(x=>!(x.source==="skillspace"&&x.skillId===g.skillId&&(x.version||"")===g.version)));else{const x=_V(m,g);t([...e,{source:"skillspace",folder:x.folder||g.skillName,name:x.name,description:x.description,skillSpaceId:x.skillSpaceId,skillSpaceName:x.skillSpaceName,skillSpaceRegion:x.skillSpaceRegion,skillId:x.skillId,version:x.version}])}};return l.jsx("div",{className:"cw-skillspace",children:c?l.jsxs("p",{className:"cw-empty-line",children:[l.jsx(Mt,{className:"cw-i cw-spin"})," 正在加载 AgentKit Skills 中心…"]}):h?l.jsxs("div",{className:"cw-banner",children:[l.jsx(Ya,{className:"cw-i"}),l.jsx("span",{children:h})]}):n.length===0?l.jsx("p",{className:"cw-empty-line",children:"此账号下没有 AgentKit Skills 中心。"}):l.jsxs(l.Fragment,{children:[l.jsxs("div",{className:"cw-skillspace-header",children:[l.jsx("select",{className:"cw-input cw-skillspace-select",value:a,onChange:g=>o(g.target.value),"aria-label":"选择 AgentKit Skills 中心",children:n.map(g=>l.jsxs("option",{value:g.id,children:[g.name||g.id,g.region?` [${g.region}]`:"",g.description?` — ${Ts(g.description)}`:""]},g.id))}),m&&l.jsx("a",{href:kV(m.id,m.region),target:"_blank",rel:"noopener noreferrer",className:"cw-button cw-button-secondary cw-skillspace-console-link",title:"在火山引擎控制台打开",children:l.jsx(Lw,{className:"cw-i cw-i-sm"})})]}),d?l.jsxs("p",{className:"cw-empty-line",children:[l.jsx(Mt,{className:"cw-i cw-spin"})," 正在加载技能列表…"]}):s.length===0?l.jsx("p",{className:"cw-empty-line",children:"此 AgentKit Skills 中心暂无技能。"}):l.jsx("div",{className:"cw-skill-results",children:s.map(g=>{const x=y(g.skillId,g.version);return l.jsxs("button",{type:"button",className:`cw-skill-result ${x?"is-on":""}`,onClick:()=>E(g),"aria-pressed":x,children:[l.jsx("span",{className:"cw-skill-result-icon","aria-hidden":!0,children:x?l.jsx(Js,{className:"cw-i cw-i-sm"}):l.jsx(sr,{className:"cw-i cw-i-sm"})}),l.jsxs("span",{className:"cw-skill-result-meta",children:[l.jsxs("span",{className:"cw-skill-result-name",children:[g.skillName,g.version&&l.jsxs("span",{className:"cw-skill-result-version",children:[" ","v",g.version]})]}),g.skillDescription&&l.jsx("span",{className:"cw-skill-result-desc",children:Ts(g.skillDescription)}),l.jsxs("span",{className:"cw-skill-result-repo",children:[l.jsx(vH,{className:"cw-i cw-i-sm"})," ",(m==null?void 0:m.name)||a]})]})]},`${g.skillId}/${g.version}`)})})]})})}async function Sge(e){const t=await fetch(e,{headers:{accept:"application/json"},signal:Ws(void 0,Gc)});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 Tge(e={}){const t=new URLSearchParams({region:e.region||"cn-beijing",page_size:String(e.pageSize??100),project:e.project||"default"});return(await Sge(`/web/a2a-spaces?${t.toString()}`)).items||[]}async function Age(e){const t=await fetch(e,{headers:{accept:"application/json"},signal:Ws(void 0,Gc)});if(t.status===409)throw new Error("服务端未配置 Volcengine AK/SK,无法访问 VikingDB 知识库");if(t.status===401)throw new Error("请先登录以访问 VikingDB 知识库");if(!t.ok){let n="";try{n=(await t.json()).detail||""}catch{}throw new Error(`请求失败 (${t.status})${n?": "+n:""}`)}return t.json()}async function Cge(e={}){const t=new URLSearchParams({region:e.region||"cn-beijing",project:e.project||"default"});return(await Age(`/web/viking-knowledgebases?${t.toString()}`)).items||[]}const Ige=w.lazy(()=>lc(()=>import("./MarkdownPromptEditor-CP3T8Ti1.js"),__vite__mapDeps([0,1])));function Oge(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 aC=[{id:"type",label:"Agent 类型",hint:"选择 Agent 类型",icon:JH,required:!0},{id:"basic",label:"基本信息",hint:"名称、描述与系统提示词",icon:Ya,required:!0},{id:"model",label:"模型配置",hint:"模型与服务(可选)",icon:kH},{id:"tools",label:"工具",hint:"可调用的能力",icon:jL},{id:"skills",label:"技能",hint:"声明式技能",icon:Lo},{id:"knowledge",label:"知识库",hint:"外部知识检索",icon:Tp},{id:"advanced",label:"进阶配置",hint:"记忆与观测",icon:OL},{id:"subagents",label:"子 Agent",hint:"嵌套协作",icon:kL},{id:"review",label:"完成",hint:"预览并创建",icon:XH}];function Rge({className:e}){return l.jsxs("svg",{className:e,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"1.8",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",children:[l.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"}),l.jsx("path",{d:"M5.75 8.25v7.5",opacity:"0.8"}),l.jsx("path",{d:"M3 10v4",opacity:"0.45"}),l.jsx("path",{d:"M17.9 5.25v2.2M19 6.35h-2.2",strokeWidth:"1.55"})]})}function r5({className:e}){return l.jsx("svg",{className:e,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",children:l.jsx("path",{d:"m7 9 5 5 5-5"})})}function s5({className:e}){return l.jsxs("svg",{className:e,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"1.75",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",children:[l.jsx("path",{d:"M18.25 8.2A7.1 7.1 0 0 0 6.1 6.65L4.5 8.25"}),l.jsx("path",{d:"M4.5 4.75v3.5H8"}),l.jsx("path",{d:"M5.75 15.8A7.1 7.1 0 0 0 17.9 17.35l1.6-1.6"}),l.jsx("path",{d:"M19.5 19.25v-3.5H16"})]})}const Lge={llm:"智能体",sequential:"分步协作",parallel:"同时处理",loop:"循环执行",a2a:"远程智能体"},oC={llm:"理解任务并完成一个具体工作",sequential:"内部步骤按照顺序依次执行",parallel:"内部步骤同时工作,完成后统一汇总",loop:"重复执行内部步骤,直到满足停止条件",a2a:"调用已经存在的远程 Agent"},lC={REGISTRY_SPACE_ID:"registrySpaceId",REGISTRY_TOP_K:"registryTopK",REGISTRY_REGION:"registryRegion",REGISTRY_ENDPOINT:"registryEndpoint"},i5="REGISTRY_SPACE_ID",Mge=CM.filter(e=>e.key!==i5);function a5(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())||qs.topK,n.REGISTRY_REGION=((s=e.registryRegion)==null?void 0:s.trim())||qs.region,n.REGISTRY_ENDPOINT=((i=e.registryEndpoint)==null?void 0:i.trim())||qs.endpoint):(n.REGISTRY_TOP_K=e.registryTopK??"",n.REGISTRY_REGION=e.registryRegion??"",n.REGISTRY_ENDPOINT=e.registryEndpoint??""),n}function cC({items:e,selected:t,onToggle:n,scrollRows:r}){return l.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 l.jsxs("button",{type:"button",className:`cw-check ${i?"is-on":""}`,onClick:()=>n(s.id),"aria-pressed":i,children:[l.jsx("span",{className:"cw-check-box","aria-hidden":!0,children:i&&l.jsx(Js,{className:"cw-i cw-i-sm"})}),l.jsxs("span",{className:"cw-check-text",children:[l.jsx("span",{className:"cw-check-title",children:s.label}),l.jsx("span",{className:"cw-check-desc",children:Ts(s.desc)})]})]},s.id)})})}function yb({options:e,value:t,onChange:n}){return l.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 l.jsxs("button",{type:"button",className:`cw-seg ${s?"is-on":""}`,onClick:()=>n(r.id),"aria-pressed":s,title:Ts(r.desc),children:[l.jsx("span",{className:"cw-seg-title",children:r.label}),l.jsx("span",{className:"cw-seg-desc",children:Ts(r.desc)})]},r.id)})})}function jge(e){return/(SECRET|PASSWORD|KEY|TOKEN)$/.test(e)}function yl({env:e,values:t,onChange:n}){return e.length===0?l.jsx("p",{className:"cw-env-empty",children:"此后端无需额外运行参数。"}):l.jsx("div",{className:"cw-env-fields",children:e.map(r=>l.jsxs("label",{className:"cw-env-field",children:[l.jsxs("span",{className:"cw-env-field-head",children:[l.jsxs("span",{className:"cw-env-field-label",children:[r.comment||r.key,r.required&&l.jsx("span",{className:"cw-req",children:"*"})]}),r.comment&&l.jsx("code",{title:r.key,children:r.key})]}),l.jsx("input",{className:"cw-input",type:jge(r.key)?"password":"text",value:t[r.key]??"",placeholder:r.placeholder||"请输入参数值",autoComplete:"off",onChange:s=>n(r.key,s.currentTarget.value)})]},r.key))})}function bb(e){return e.name.trim()||"未命名智能体中心"}function Eb(e){return e.name.trim()||e.id||"未命名知识库"}function Dge({value:e,region:t,invalid:n,onChange:r}){const s=t.trim()||qs.region,[i,a]=w.useState([]),[o,c]=w.useState(!1),[u,d]=w.useState(null),[f,h]=w.useState(0),[p,m]=w.useState(!1),[y,E]=w.useState(""),g=w.useRef(null);w.useEffect(()=>{let A=!1;return c(!0),d(null),Tge({region:s}).then(O=>{A||a(O)}).catch(O=>{A||(a([]),d(O instanceof Error?O.message:"加载失败"))}).finally(()=>{A||c(!1)}),()=>{A=!0}},[s,f]);const x=!e||i.some(A=>A.id===e.trim()),b=i.find(A=>A.id===e.trim()),_=b?bb(b):e&&!x?"已选择的智能体中心":"请选择智能体中心",k=o&&i.length===0,N=w.useMemo(()=>i.filter(A=>ig(y,[bb(A),A.id,A.projectName])),[y,i]),C=!!(e&&!x&&ig(y,["已选择的智能体中心",e]));w.useEffect(()=>{if(!p)return;const A=D=>{const F=D.target;F instanceof Node&&g.current&&!g.current.contains(F)&&m(!1)},O=D=>{D.key==="Escape"&&m(!1)};return window.addEventListener("pointerdown",A),window.addEventListener("keydown",O),()=>{window.removeEventListener("pointerdown",A),window.removeEventListener("keydown",O)}},[p]);const S=A=>{r(A),m(!1)};return l.jsxs("div",{className:"cw-a2a-space-picker",ref:g,children:[l.jsxs("div",{className:"cw-a2a-space-row",children:[l.jsxs("div",{className:"cw-a2a-space-select-wrap",children:[l.jsxs("button",{type:"button",className:`cw-a2a-space-trigger ${n?"is-error":""}`,disabled:k,"aria-haspopup":"listbox","aria-expanded":p,"aria-label":"选择 AgentKit 智能体中心",onClick:()=>{E(""),m(A=>!A)},children:[l.jsx("span",{className:e?void 0:"is-placeholder",children:_}),l.jsx(r5,{className:"cw-a2a-space-trigger-icon"})]}),p&&l.jsxs("div",{className:"cw-a2a-space-menu",children:[l.jsx("div",{className:"cw-picker-search",children:l.jsx("input",{className:"cw-picker-search-input",type:"search",value:y,autoFocus:!0,autoComplete:"off","aria-label":"搜索 AgentKit 智能体中心",placeholder:"搜索名称或 ID",onChange:A=>E(A.currentTarget.value)})}),l.jsxs("div",{className:"cw-picker-options",role:"listbox","aria-label":"AgentKit 智能体中心",children:[C&&l.jsx("button",{type:"button",role:"option","aria-selected":!0,className:"cw-a2a-space-option is-selected",onClick:()=>S(e),children:"已选择的智能体中心"}),N.map(A=>{const O=bb(A),D=A.id===e;return l.jsx("button",{type:"button",role:"option","aria-selected":D,className:`cw-a2a-space-option ${D?"is-selected":""}`,title:`${O} (${A.id})`,onClick:()=>S(A.id),children:O},A.id)}),!C&&N.length===0&&l.jsx("div",{className:"cw-picker-empty",children:"未找到匹配的智能体中心"})]})]})]}),l.jsx("button",{type:"button",className:"cw-icon-btn cw-a2a-space-refresh",title:"刷新智能体中心列表","aria-label":"刷新智能体中心列表",disabled:o,onClick:()=>h(A=>A+1),children:o?l.jsx(Mt,{className:"cw-i cw-i-sm cw-spin"}):l.jsx(s5,{className:"cw-i cw-i-sm"})})]}),u?l.jsxs("div",{className:"cw-banner cw-a2a-space-error",children:[l.jsx(Ya,{className:"cw-i"}),l.jsx("span",{children:u})]}):o?l.jsxs("span",{className:"cw-help cw-a2a-space-status",children:[l.jsx(Mt,{className:"cw-i cw-i-sm cw-spin"}),"正在加载 AgentKit 智能体中心…"]}):i.length===0?l.jsx("span",{className:"cw-help",children:"此账号下暂无 AgentKit 智能体中心。"}):l.jsxs("span",{className:"cw-help",children:["已加载 ",i.length," 个智能体中心,列表仅展示中心名称。"]})]})}function Pge({value:e,onChange:t}){const[n,r]=w.useState([]),[s,i]=w.useState(!1),[a,o]=w.useState(null),[c,u]=w.useState(0),[d,f]=w.useState(!1),[h,p]=w.useState(""),m=w.useRef(null);w.useEffect(()=>{let N=!1;return i(!0),o(null),Cge().then(C=>{N||r(C)}).catch(C=>{N||(r([]),o(C instanceof Error?C.message:"加载失败"))}).finally(()=>{N||i(!1)}),()=>{N=!0}},[c]);const y=!e||n.some(N=>N.id===e.trim()),E=n.find(N=>N.id===e.trim()),g=E?Eb(E):e&&!y?e:"请选择 VikingDB 知识库",x=s&&n.length===0,b=w.useMemo(()=>n.filter(N=>ig(h,[Eb(N),N.id,N.description,N.projectName])),[n,h]),_=!!(e&&!y&&ig(h,[e]));w.useEffect(()=>{if(!d)return;const N=S=>{const A=S.target;A instanceof Node&&m.current&&!m.current.contains(A)&&f(!1)},C=S=>{S.key==="Escape"&&f(!1)};return window.addEventListener("pointerdown",N),window.addEventListener("keydown",C),()=>{window.removeEventListener("pointerdown",N),window.removeEventListener("keydown",C)}},[d]);const k=N=>{t(N),f(!1)};return l.jsxs("div",{className:"cw-a2a-space-picker cw-viking-kb-picker",ref:m,children:[l.jsxs("div",{className:"cw-a2a-space-row",children:[l.jsxs("div",{className:"cw-a2a-space-select-wrap",children:[l.jsxs("button",{type:"button",className:"cw-a2a-space-trigger",disabled:x,"aria-haspopup":"listbox","aria-expanded":d,"aria-label":"选择 VikingDB 知识库",onClick:()=>{p(""),f(N=>!N)},children:[l.jsx("span",{className:e?void 0:"is-placeholder",children:g}),l.jsx(r5,{className:"cw-a2a-space-trigger-icon"})]}),d&&l.jsxs("div",{className:"cw-a2a-space-menu cw-viking-kb-menu",children:[l.jsx("div",{className:"cw-picker-search",children:l.jsx("input",{className:"cw-picker-search-input",type:"search",value:h,autoFocus:!0,autoComplete:"off","aria-label":"搜索 VikingDB 知识库",placeholder:"搜索名称或 ID",onChange:N=>p(N.currentTarget.value)})}),l.jsxs("div",{className:"cw-picker-options",role:"listbox","aria-label":"VikingDB 知识库",children:[_&&l.jsx("button",{type:"button",role:"option","aria-selected":!0,className:"cw-a2a-space-option is-selected",onClick:()=>k(e),children:e}),b.map(N=>{const C=Eb(N),S=N.id===e;return l.jsx("button",{type:"button",role:"option","aria-selected":S,className:`cw-a2a-space-option ${S?"is-selected":""}`,title:`${C} (${N.id})`,onClick:()=>k(N.id),children:C},N.id)}),!_&&b.length===0&&l.jsx("div",{className:"cw-picker-empty",children:"未找到匹配的知识库"})]})]})]}),l.jsx("button",{type:"button",className:"cw-icon-btn cw-a2a-space-refresh cw-viking-kb-refresh",title:"刷新知识库列表","aria-label":"刷新知识库列表",disabled:s,onClick:()=>u(N=>N+1),children:s?l.jsx(Mt,{className:"cw-i cw-i-sm cw-spin"}):l.jsx(s5,{className:"cw-i cw-i-sm"})})]}),a?l.jsxs("div",{className:"cw-banner cw-a2a-space-error",children:[l.jsx(Ya,{className:"cw-i"}),l.jsx("span",{children:a})]}):s?l.jsxs("span",{className:"cw-help cw-a2a-space-status",children:[l.jsx(Mt,{className:"cw-i cw-i-sm cw-spin"}),"正在加载 VikingDB 知识库…"]}):n.length===0?l.jsx("span",{className:"cw-help",children:"此账号下暂无 VikingDB 知识库。"}):l.jsxs("span",{className:"cw-help",children:["已加载 ",n.length," 个知识库,选择的知识库会用于当前 Agent。"]})]})}function Bge({tools:e,onChange:t}){const n=(i,a)=>t(e.map((o,c)=>c===i?{...o,...a}:o)),r=i=>t(e.filter((a,o)=>o!==i)),s=()=>t([...e,{name:"",transport:"http",url:""}]);return l.jsxs("div",{className:"cw-mcp",children:[e.length>0&&l.jsx("div",{className:"cw-mcp-list",children:l.jsx($s,{initial:!1,children:e.map((i,a)=>l.jsxs(Dt.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:[l.jsxs("div",{className:"cw-mcp-rowhead",children:[l.jsxs("div",{className:"cw-mcp-transport",children:[l.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:l.jsx("span",{className:"cw-seg-title",children:"HTTP"})}),l.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:l.jsx("span",{className:"cw-seg-title",children:"stdio"})})]}),l.jsx("button",{type:"button",className:"cw-icon-btn cw-icon-danger",onClick:()=>r(a),"aria-label":"移除 MCP 工具",children:l.jsx(ta,{className:"cw-i cw-i-sm"})})]}),l.jsx("input",{className:"cw-input",value:i.name,placeholder:"名称(用于命名,可留空)",onChange:o=>n(a,{name:o.target.value})}),i.transport==="http"?l.jsxs(l.Fragment,{children:[l.jsx("input",{className:"cw-input",value:i.url??"",placeholder:"MCP 服务地址(StreamableHTTP)",onChange:o=>n(a,{url:o.target.value})}),l.jsx("input",{className:"cw-input",value:i.authToken??"",placeholder:"Bearer Token(可选)",onChange:o=>n(a,{authToken:o.target.value})})]}):l.jsxs(l.Fragment,{children:[l.jsx("input",{className:"cw-input",value:i.command??"",placeholder:"启动命令,例如 npx",onChange:o=>n(a,{command:o.target.value})}),l.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)})}),l.jsx("p",{className:"cw-mcp-note",children:"stdio MCP 暂不参与调试运行;点击“去部署”时会完整保留这项配置并生成对应代码。"})]})]},a))})}),l.jsxs("button",{type:"button",className:"cw-add-sub",onClick:s,children:[l.jsx(sr,{className:"cw-i"}),"添加 MCP 工具"]}),e.length===0&&l.jsx("p",{className:"cw-empty-line",children:"暂无 MCP 工具,点击「添加 MCP 工具」连接外部 MCP 服务。"})]})}function o5({className:e}){return l.jsxs("svg",{className:e,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"1.7",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":!0,children:[l.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"}),l.jsx("path",{d:"M7 4.75h9.5a2 2 0 0 1 2 2",opacity:".58"}),l.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"}),l.jsx("path",{d:"M19.25 11.25h1.5M20 10.5V12",opacity:".72"})]})}function Fge({s:e,onRemove:t}){let n=Lo,r="火山 Find Skill 技能广场";return e.source==="local"?(n=Mw,r="本地"):e.source==="skillspace"&&(n=o5,r="AgentKit Skills 中心"),l.jsxs(Dt.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:[l.jsx("span",{className:"cw-selected-skill-icon","aria-hidden":!0,children:l.jsx(n,{className:"cw-i cw-i-sm"})}),l.jsxs("span",{className:"cw-selected-skill-meta",children:[l.jsx("span",{className:"cw-selected-skill-name",children:e.name}),l.jsxs("span",{className:"cw-selected-skill-detail",children:[r,e.description?` · ${Ts(e.description)}`:""]})]}),l.jsx("button",{type:"button",className:"cw-selected-skill-remove",onClick:t,"aria-label":`移除 ${e.name}`,title:`移除 ${e.name}`,children:l.jsx(Hr,{className:"cw-i cw-i-sm"})})]},`${e.source}:${e.folder}:${e.skillId||e.slug||""}:${e.version||""}`)}const xb=[{id:"local",label:"本地文件",icon:Mw},{id:"skillspace",label:"AgentKit Skills 中心",icon:o5},{id:"skillhub",label:"火山 Find Skill 技能广场",icon:Lg}];function Uge({selected:e,onChange:t}){const[n,r]=w.useState("local"),[s,i]=w.useState(!1),a=xb.findIndex(c=>c.id===n),o=c=>t(e.filter(u=>wb(u)!==c));return w.useEffect(()=>{if(!s)return;const c=u=>{u.key==="Escape"&&i(!1)};return window.addEventListener("keydown",c),()=>window.removeEventListener("keydown",c)},[s]),l.jsxs("div",{className:"cw-skillspane",children:[l.jsxs("button",{type:"button",className:"cw-skill-add","aria-haspopup":"dialog",onClick:()=>i(!0),children:[l.jsx("span",{className:"cw-skill-add-icon","aria-hidden":!0,children:l.jsx(sr,{className:"cw-i"})}),l.jsx("span",{children:"添加 Skill"})]}),e.length>0&&l.jsxs("div",{className:"cw-skill-selected",children:[l.jsxs("span",{className:"cw-skill-selected-label",children:["已加入技能 · ",e.length]}),l.jsx("div",{className:"cw-selected-skill-list",children:l.jsx($s,{initial:!1,children:e.map(c=>l.jsx(Fge,{s:c,onRemove:()=>o(wb(c))},wb(c)))})})]}),l.jsx($s,{children:s&&l.jsx(Dt.div,{className:"cw-skill-dialog-backdrop",initial:{opacity:0},animate:{opacity:1},exit:{opacity:0},transition:{duration:.16},onMouseDown:c=>{c.target===c.currentTarget&&i(!1)},children:l.jsxs(Dt.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:[l.jsxs("div",{className:"cw-skill-dialog-head",children:[l.jsx("h3",{id:"cw-skill-dialog-title",children:"添加 Skill"}),l.jsx("button",{type:"button",className:"cw-skill-dialog-close","aria-label":"关闭添加 Skill",onClick:()=>i(!1),children:l.jsx(Hr,{className:"cw-i"})})]}),l.jsxs("div",{className:"cw-skill-dialog-body",children:[l.jsxs("div",{className:"cw-skill-sourcetabs",role:"tablist",style:{"--cw-skill-tab-slider-width":`calc((100% - 16px) / ${xb.length})`,"--cw-active-skill-tab-offset":`calc(${a*100}% + ${a*4}px)`},children:[l.jsx("span",{className:"cw-skill-tab-slider","aria-hidden":!0}),xb.map(({id:c,label:u,icon:d})=>l.jsxs("button",{type:"button",role:"tab",id:`cw-skill-tab-${c}`,"aria-controls":"cw-skill-tabpanel","aria-selected":n===c,className:`cw-skill-pickertab ${n===c?"is-on":""}`,onClick:()=>r(c),children:[l.jsx(d,{className:"cw-i cw-i-sm"}),u]},c))]}),l.jsxs("div",{id:"cw-skill-tabpanel",className:"cw-skill-tabbody",role:"tabpanel","aria-labelledby":`cw-skill-tab-${n}`,children:[n==="skillhub"&&l.jsx(hge,{selected:e,onChange:t}),n==="local"&&l.jsx(kge,{selected:e,onChange:t}),n==="skillspace"&&l.jsx(Nge,{selected:e,onChange:t})]})]})]})})})]})}function wb(e){return e.source==="skillhub"?`hub:${e.namespace}/${e.slug}`:e.source==="local"?`local:${e.folder}`:`ss:${e.skillSpaceId}/${e.skillId}/${e.version||""}`}function Lu({checked:e,onChange:t,title:n,desc:r,icon:s}){return l.jsxs("button",{type:"button",className:`cw-toggle ${e?"is-on":""}`,onClick:()=>t(!e),"aria-pressed":e,children:[l.jsx("span",{className:"cw-toggle-icon",children:l.jsx(s,{className:"cw-i"})}),l.jsxs("span",{className:"cw-toggle-text",children:[l.jsx("span",{className:"cw-toggle-title",children:n}),l.jsx("span",{className:"cw-toggle-desc",children:Ts(r)})]}),l.jsx("span",{className:"cw-switch","aria-hidden":!0,children:l.jsx(Dt.span,{className:"cw-switch-knob",layout:!0,transition:{type:"spring",stiffness:520,damping:34}})})]})}function $ge(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 cp(e,t){let n=e;for(const r of t)n=n.subAgents[r];return n}function Qf(e,t,n){if(t.length===0)return n(e);const[r,...s]=t,i=e.subAgents.slice();return i[r]=Qf(i[r],s,n),{...e,subAgents:i}}function Hge(e,t){return Qf(e,t,n=>({...n,subAgents:[...n.subAgents,Nr()]}))}function zge(e,t,n){return Qf(e,t,r=>{const s=r.subAgents.slice();return s.splice(n,0,Nr()),{...r,subAgents:s}})}function Vge(e,t){if(t.length===0)return e;const n=t.slice(0,-1),r=t[t.length-1];return Qf(e,n,s=>({...s,subAgents:s.subAgents.filter((i,a)=>a!==r)}))}const QE=e=>!v0(e.agentType),uC=3;function Kge(e,t,n=!1){var s;if(v0(e.agentType))return n?"远程 Agent 只能作为子 Agent":(s=e.a2aRegistry)!=null&&s.registrySpaceId.trim()?null:"缺少 AgentKit 智能体中心";const r=cc(e.name);return r||(t.has(e.name)?"Agent 名称在当前结构中必须唯一":e.description.trim().length===0?"缺少描述":Z6(e.agentType)?e.subAgents.length===0?"缺少子 Agent":null:e.instruction.trim().length===0?"缺少系统提示词":null)}function l5(e,t,n=[]){const r=[],s=v0(e.agentType),i=Kge(e,t,n.length===0);return i&&r.push({path:n,name:s?"远程 Agent":e.name.trim()||"未命名",problem:i}),QE(e)&&e.subAgents.forEach((a,o)=>r.push(...l5(a,t,[...n,o]))),r}function c5(e){return 1+e.subAgents.reduce((t,n)=>t+c5(n),0)}function u5(e){const t=[],n={},r=i=>{var a,o,c,u;for(const d of i.builtinTools??[]){const f=_c.find(h=>h.id===d);f&&t.push({env:f.env})}if((a=i.a2aRegistry)!=null&&a.enabled&&(t.push({env:CM}),Object.assign(n,a5(i.a2aRegistry,{includeDefaults:!0}))),i.memory.shortTerm&&t.push({env:((o=eE.find(d=>d.id===(i.shortTermBackend??"local")))==null?void 0:o.env)??[]}),i.memory.longTerm&&t.push({env:((c=tE.find(d=>d.id===(i.longTermBackend??"local")))==null?void 0:c.env)??[]}),i.knowledgebase&&t.push({env:((u=nE.find(d=>d.id===(i.knowledgebaseBackend??kc)))==null?void 0:u.env)??[]}),i.tracing)for(const d of i.tracingExporters??[]){const f=rE.find(h=>h.id===d);f&&t.push({env:f.env,enableFlag:f.enableFlag})}i.subAgents.forEach(r)};r(e);const s=W6(t);return{specs:s.specs,fixedValues:{...s.fixedValues,...n}}}function d5(e){var t;return{...e,deployment:{feishuEnabled:!!((t=e.deployment)!=null&&t.feishuEnabled)}}}function Yge(e){var n;const t=e.name.trim();return t||(e.agentType!=="sequential"?"":((n=e.subAgents.find(r=>r.name.trim()))==null?void 0:n.name.trim())??"")}function f5(e){var r,s;const t=u5(e),n={...((r=e.deployment)==null?void 0:r.envValues)??{},...t.fixedValues};return{...d5(e),deployment:{feishuEnabled:!!((s=e.deployment)!=null&&s.feishuEnabled),envValues:Object.fromEntries(q6(t.specs,n).map(({key:i,value:a})=>[i,a]))}}}function Gge(e){return JSON.stringify(f5(e))}function ag(e,t){return JSON.stringify({draftSnapshot:e,modelName:t.modelName,description:t.description,instruction:t.instruction,optimizations:t.optimizations})}function Wl(e){return JSON.stringify({modelName:e.modelName.trim(),description:e.description.trim(),instruction:e.instruction.trim(),optimizations:e.optimizations})}function Wge({enabled:e,disabledReason:t,variants:n,draftSnapshot:r,input:s,onInput:i,onSend:a,onStartVariant:o,onDeployVariant:c,onAddVariant:u,onRemoveVariant:d,onToggleConfig:f,onCompleteConfig:h,onConfigChange:p}){const m=n.filter(g=>g.phase!=="ready"?!1:g.runtimeSnapshot===ag(r,g)),y=n.some(g=>g.phase==="sending"),E=m.length>0&&!y;return l.jsxs("section",{className:"cw-ab-workspace","aria-label":"A/B 调试工作台",children:[l.jsx("div",{className:"cw-ab-stage",children:e?l.jsxs("div",{className:"cw-ab-grid",children:[n.map((g,x)=>{const b=g.modelName.trim(),_=g.description.trim(),k=g.instruction.trim(),N=Wl(g),C=!!(b&&_&&k&&n.findIndex(T=>Wl(T)===N)!==x),S=!b||!_||!k||C,A=!!(g.runtimeSnapshot&&g.runtimeSnapshot!==ag(r,g)),O=g.phase==="starting",D=g.phase==="ready"&&!A,F=O||g.phase==="sending",X=F||g.configOpen||S,L=b?_?k?C?"该配置与已有测试组相同":"":"请填写系统提示词":"请填写描述":"请先选择模型",j=O?"正在启动":A?"应用配置并重启":D||g.phase==="error"?"重新启动环境":"启动环境";return l.jsx("article",{className:"cw-ab-card",children:l.jsxs("div",{className:`cw-ab-card-inner${g.configOpen?" is-flipped":""}`,children:[l.jsxs("section",{className:"cw-ab-card-face cw-ab-card-front","aria-hidden":g.configOpen,children:[l.jsxs("header",{className:"cw-ab-card-head",children:[l.jsxs("div",{className:"cw-ab-card-title",children:[l.jsx("strong",{children:g.name}),l.jsx("span",{children:g.modelName||"默认模型"})]}),l.jsxs("div",{className:"cw-ab-card-actions",children:[l.jsx("button",{type:"button",className:"cw-ab-config-trigger",disabled:g.configOpen||F,onClick:()=>f(g.id),children:"测试配置"}),g.id!=="baseline"&&l.jsx("button",{type:"button",className:"cw-ab-remove","aria-label":`删除${g.name}`,disabled:g.configOpen||F,onClick:()=>d(g.id),children:l.jsx(ta,{className:"cw-i"})})]})]}),l.jsx("div",{className:"cw-ab-conversation",children:g.error?l.jsx(sg,{message:g.error,className:"cw-debug-error-detail",onRetry:async()=>{await o(g.id)}}):O?l.jsxs("div",{className:"cw-ab-empty cw-ab-starting",children:[l.jsx(Mt,{className:"cw-i cw-spin"}),l.jsx("span",{children:"正在创建独立测试环境"})]}):A?l.jsxs("div",{className:"cw-ab-empty cw-ab-launch",children:[l.jsx("span",{children:"配置已变更,请重新启动此环境"}),l.jsxs("button",{type:"button",className:"cw-ab-start",disabled:X,onClick:()=>o(g.id),children:[l.jsx(K1,{className:"cw-i"}),j]})]}):g.messages.length===0?l.jsxs("div",{className:"cw-ab-empty cw-ab-launch",children:[l.jsxs("button",{type:"button",className:"cw-ab-start",disabled:X,title:L||void 0,onClick:()=>o(g.id),children:[D?l.jsx(K1,{className:"cw-i"}):l.jsx(Rge,{className:"cw-i cw-debug-run-icon"}),j]}),L?l.jsx("span",{className:"cw-ab-launch-hint",children:L}):D?l.jsx("span",{className:"cw-ab-launch-hint",children:"等待测试输入"}):null]}):g.messages.map((T,R)=>l.jsx("div",{className:`cw-debug-msg cw-debug-msg-${T.role}`,children:l.jsx("div",{className:"cw-debug-content",children:T.role==="user"?T.content:T.error?l.jsx(sg,{message:T.error,className:"cw-debug-msg-error"}):T.blocks&&T.blocks.length>0?l.jsx(Xv,{blocks:T.blocks,onAction:()=>{}}):T.content?T.content:R===g.messages.length-1&&g.phase==="sending"?l.jsx(q4,{}):null})},R))}),l.jsx("footer",{className:"cw-ab-deploy-footer",children:l.jsx("button",{type:"button",className:"cw-ab-deploy",disabled:F||!b,onClick:()=>c(g.id),children:"部署该配置"})})]}),l.jsxs("section",{className:"cw-ab-card-face cw-ab-card-back","aria-hidden":!g.configOpen,children:[l.jsxs("header",{className:"cw-ab-config-head",children:[l.jsxs("div",{children:[l.jsx("strong",{children:"测试配置"}),l.jsx("span",{children:g.name})]}),l.jsxs("span",{className:`cw-ab-config-done-wrap${L?" is-disabled":""}`,tabIndex:L?0:void 0,children:[l.jsx("button",{type:"button",className:"cw-ab-config-done",disabled:!g.configOpen||S,onClick:()=>h(g.id),children:g.id==="baseline"?"完成配置":"完成并启动"}),L&&l.jsx("span",{className:"cw-ab-config-done-tip",role:"tooltip",children:L})]})]}),l.jsxs("div",{className:"cw-ab-config",children:[l.jsxs("label",{children:[l.jsx("span",{children:"模型"}),l.jsx("input",{value:g.modelName,placeholder:"使用 Agent 当前模型",disabled:!g.configOpen,onChange:T=>p(g.id,"modelName",T.target.value)})]}),l.jsxs("label",{children:[l.jsx("span",{children:"描述"}),l.jsx("textarea",{rows:2,value:g.description,disabled:!g.configOpen,onChange:T=>p(g.id,"description",T.target.value)})]}),l.jsxs("label",{children:[l.jsx("span",{children:"系统提示词"}),l.jsx("textarea",{rows:5,value:g.instruction,disabled:!g.configOpen,onChange:T=>p(g.id,"instruction",T.target.value)})]}),l.jsxs("fieldset",{className:"cw-ab-optimizations-disabled",children:[l.jsxs("legend",{children:[l.jsx("span",{children:"优化选项"}),l.jsx("em",{children:"待开放"})]}),l.jsx("div",{className:"cw-ab-optimization-list",children:h5.map(T=>l.jsxs("label",{children:[l.jsx("input",{type:"checkbox",checked:g.optimizations.includes(T.id),disabled:!0}),l.jsx("span",{children:T.label})]},T.id))})]}),l.jsx("p",{children:"设置完成后返回正面,再启动当前测试环境。"})]})]})]})},g.id)}),n.length<3&&l.jsxs("button",{type:"button",className:"cw-ab-add",onClick:u,children:[l.jsx(sr,{className:"cw-i"}),l.jsx("strong",{children:"添加对照组"}),l.jsx("span",{children:"最多同时创建 3 个测试组"})]})]}):l.jsx("div",{className:"cw-debug-empty",children:t})}),l.jsx("div",{className:"cw-ab-composer",children:l.jsxs("div",{className:"cw-debug-composerbox",children:[l.jsx("textarea",{className:"cw-debug-input",rows:1,value:s,placeholder:E?"输入测试消息,将发送到所有已启动测试组...":"请先启动至少一个测试组",disabled:!E,onChange:g=>i(g.target.value),onKeyDown:g=>{X4(g.nativeEvent)||g.key==="Enter"&&!g.shiftKey&&(g.preventDefault(),a())}}),l.jsx("button",{type:"button",className:"cw-debug-send",title:"发送",disabled:!E||!s.trim(),onClick:a,children:y?l.jsx(Mt,{className:"cw-i cw-spin"}):l.jsx(vL,{className:"cw-i"})})]})})]})}const dC=[{id:"build",label:"构建"},{id:"validate",label:"调试"},{id:"publish",label:"发布"}],h5=[{id:"context",label:"上下文优化",description:"压缩历史对话,保留与当前任务相关的信息"},{id:"grounding",label:"幻觉抑制",description:"对不确定内容要求依据,并明确表达未知"},{id:"tools",label:"工具调用优化",description:"减少重复调用,优先复用可信的工具结果"},{id:"latency",label:"响应加速",description:"缓存稳定上下文,降低重复推理开销"}];function qge({mode:e,agentName:t,busy:n,onChange:r,onDiscard:s}){const i=dC.findIndex(a=>a.id===e);return l.jsxs("header",{className:"cw-workspace-header",children:[l.jsx("div",{className:"cw-workspace-identity",children:l.jsx("strong",{title:t,children:t||"未命名 Agent"})}),l.jsx("nav",{className:"cw-workspace-stepper","aria-label":"Agent 创建步骤",children:dC.map((a,o)=>{const c=a.id===e,u=or(a.id),children:l.jsx("strong",{children:a.label})},a.id)})}),s&&l.jsx("div",{className:"cw-workspace-actions",children:l.jsx("button",{type:"button",className:"cw-discard-edit",disabled:n,onClick:s,children:"放弃编辑"})})]})}function Xge({onBack:e,onCreate:t,onAgentAdded:n,initialDraft:r,features:s,onDeploymentTaskChange:i,deploymentTarget:a,onDeploymentComplete:o,onDeploymentStarted:c,onDraftChange:u,onDiscard:d}){var Jf,eh,tl,nl,rl,th,ou,Ai,_t,lu,qa,sl,nh,rh,sh;const[f,h]=w.useState(()=>r??Nr()),[p,m]=w.useState(""),[y,E]=w.useState(!1),[g,x]=w.useState(!1),[b,_]=w.useState(null),k=w.useRef(JSON.stringify(f)),N=w.useRef(k.current),C=JSON.stringify(f),S=C!==k.current,A=w.useRef(u);w.useEffect(()=>{A.current=u},[u]),w.useEffect(()=>{var W;C!==N.current&&(N.current=C,(W=A.current)==null||W.call(A,f,S))},[f,S,C]);const[O,D]=w.useState("build"),[F,X]=w.useState(!1),[L,j]=w.useState(!1),[T,R]=w.useState(0),[M,B]=w.useState(null),[I,V]=w.useState(!1),[G,P]=w.useState((a==null?void 0:a.region)??"cn-beijing"),ie=(s==null?void 0:s.generatedAgentTestRun)===!0,q=(s==null?void 0:s.generatedAgentTestRunDisabledReason)||"当前后端暂不支持生成 Agent 调试运行。",[ne,oe]=w.useState(()=>[{id:"baseline",name:"基准组",modelName:(r??Nr()).modelName??"",description:(r??Nr()).description,instruction:(r??Nr()).instruction,optimizations:[],configOpen:!1,phase:"idle",runtimeSnapshot:"",messages:[],error:null}]),[ee,ce]=w.useState("baseline"),re=w.useRef(1),pe=w.useRef(new Map),[ye,J]=w.useState(0),[fe,Ee]=w.useState(""),[Te,Ge]=w.useState("basic"),[ke,rt]=w.useState(""),[ze,We]=w.useState(!1),[yt,at]=w.useState(!1),[St,Tt]=w.useState(!1),[H,Z]=w.useState(!1),[le,be]=w.useState([]),Le=w.useRef(null),Ke=w.useRef({});w.useEffect(()=>()=>{for(const{run:W}of pe.current.values())Hu(W.runId).catch(de=>console.warn("清理调试运行失败",de));pe.current.clear()},[]);const Ot=w.useRef(null);Ot.current||(Ot.current=({meta:W,children:de})=>l.jsxs("section",{ref:Ue=>{Ke.current[W.id]=Ue},id:`cw-sec-${W.id}`,"data-step-id":W.id,className:"cw-section",children:[l.jsx("header",{className:"cw-sec-head",children:l.jsxs("h2",{className:"cw-sec-title",children:[W.label,W.required&&l.jsx("span",{className:"cw-sec-required",children:"必填"})]})}),de]}));const He=$ge(f,le)?le:[],Ce=cp(f,He),Ie=He.length===0,wt=`cw-model-advanced-${He.join("-")||"root"}`,Kt=`cw-a2a-registry-advanced-${He.join("-")||"root"}`,Pt=`cw-more-tool-types-${He.join("-")||"root"}`,pn=`cw-advanced-config-${He.join("-")||"root"}`,je=W=>h(de=>Qf(de,He,Ue=>({...Ue,...W}))),st=(W,de)=>h(Ue=>{var Ye;return{...Ue,deployment:{...Ue.deployment??{feishuEnabled:!1},envValues:{...((Ye=Ue.deployment)==null?void 0:Ye.envValues)??{},[W]:de}}}}),It=W=>je({a2aRegistry:{...Ce.a2aRegistry??{enabled:!1,registrySpaceId:"",registryTopK:"",registryRegion:"",registryEndpoint:""},...W}}),At=(W,de)=>{if(!(W in lC))return;const Ue=lC[W];It({[Ue]:de}),st(W,de)},me=W=>{if(!(Ie&&W==="a2a")){if(W==="a2a"){je({agentType:W,a2aRegistry:{...Ce.a2aRegistry??{registrySpaceId:"",registryTopK:"",registryRegion:"",registryEndpoint:""},enabled:!0}});return}je({agentType:W,a2aRegistry:Ce.a2aRegistry?{...Ce.a2aRegistry,enabled:!1}:void 0})}},Ve=(W,de)=>{h(W),de&&be(de)},nt=async()=>{const W=p.trim();if(!(!W||y)&&!(S&&!window.confirm("生成的新配置会替换当前画布和属性,确定继续吗?"))){E(!0),x(!1),_(null),rt("");try{const de=await hM(W);h(h_(de.draft)),be([]),B(null),j(!1),rt(""),x(!0)}catch(de){_(de instanceof Error?de.message:"生成 Agent 配置失败")}finally{E(!1)}}},Xt=W=>{const de=cp(f,W);if(!QE(de)||W.length>=uC)return;const Ue=Hge(f,W),Ye=cp(Ue,W).subAgents.length-1;Ve(Ue,[...W,Ye])},mn=(W,de)=>{const Ue=cp(f,W);if(!QE(Ue)||W.length>=uC)return;const Ye=Math.max(0,Math.min(de,Ue.subAgents.length)),Yt=zge(f,W,Ye);Ve(Yt,[...W,Ye])},Qt=()=>{window.confirm("清空根 Agent 的全部配置和子 Agent?此操作无法撤销。")&&(h(Nr()),be([]),j(!1),Z(!1))},te=W=>{if(W.length===0){Qt();return}Ve(Vge(f,W),W.slice(0,-1))},he=Ce.builtinTools??[],Oe=Ce.mcpTools??[],De=Ce.tracingExporters??[],lt=Ce.selectedSkills??[],Bt=[Ce.memory.shortTerm,Ce.memory.longTerm,Ce.tracing].filter(Boolean).length,it=W=>je({builtinTools:he.includes(W)?he.filter(de=>de!==W):[...he,W]}),Q=W=>{const de=De.includes(W)?De.filter(Ue=>Ue!==W):[...De,W];je({tracingExporters:de,tracing:de.length>0?!0:Ce.tracing})},ve=Z6(Ce.agentType),xe=v0(Ce.agentType),Xe=w.useMemo(()=>Q6(f),[f]),qe=xe?null:cc(Ce.name)??(Xe.has(Ce.name)?"Agent 名称在当前结构中必须唯一":null),Je=qe!==null,ct=!xe&&Ce.description.trim().length===0,Rt=Ce.instruction.trim().length===0,Ft=xe&&!((Jf=Ce.a2aRegistry)!=null&&Jf.registrySpaceId.trim()),vn=W=>L&&W?`is-error cw-error-shake-${T%2}`:"",_n=w.useMemo(()=>l5(f,Xe),[f,Xe]),Ut=_n.length===0,Ir=w.useMemo(()=>Gge(f),[f]),Dn=ne.find(W=>W.id===ee)??ne[0],or=w.useMemo(()=>u5(f),[f]),Or=w.useMemo(()=>{var W,de,Ue,Ye;return{type:!0,basic:xe?!Ft:!Je&&(ve||!Rt),model:!!((W=Ce.modelName)!=null&&W.trim()||(de=Ce.modelProvider)!=null&&de.trim()||(Ue=Ce.modelApiBase)!=null&&Ue.trim()),tools:he.length>0||Oe.length>0,skills:lt.length>0,knowledge:Ce.knowledgebase,advanced:Ce.memory.shortTerm||Ce.memory.longTerm||Ce.tracing,subagents:(((Ye=Ce.subAgents)==null?void 0:Ye.length)??0)>0,review:Ut}},[Ce,Je,Rt,ve,xe,Ut,he,Oe,lt]),lr=ve||xe?["type","basic"]:["type","basic","model","tools","skills","knowledge",...Ie?["advanced"]:[]],kn=aC.filter(W=>lr.includes(W.id)),Zt=lr.join("|"),Nn=He.join("."),Vn=kn.findIndex(W=>W.id===Te),Zn=W=>{var de;(de=Ke.current[W])==null||de.scrollIntoView({behavior:"smooth",block:"start"})};w.useEffect(()=>{if(M)return;const W=Le.current;if(!W)return;const de=Zt.split("|");let Ue=0;const Ye=()=>{Ue=0;const mt=de[de.length-1];let gn=de[0];if(W.scrollTop+W.clientHeight>=W.scrollHeight-2)gn=mt;else{const kt=W.getBoundingClientRect().top+24;for(const Sn of de){const Jt=Ke.current[Sn];if(!Jt||Jt.getBoundingClientRect().top>kt)break;gn=Sn}}gn&&Ge(kt=>kt===gn?kt:gn)},Yt=()=>{Ue||(Ue=window.requestAnimationFrame(Ye))};return Ye(),W.addEventListener("scroll",Yt,{passive:!0}),window.addEventListener("resize",Yt),()=>{W.removeEventListener("scroll",Yt),window.removeEventListener("resize",Yt),Ue&&window.cancelAnimationFrame(Ue)}},[M,Zt,Nn]);const on=()=>Ut?!0:(j(!0),R(W=>W+1),_n[0]&&(be(_n[0].path),window.requestAnimationFrame(()=>Zn("basic"))),!1),as=async()=>{const W=[...pe.current.values()];pe.current.clear(),J(0),oe(de=>de.map(Ue=>({...Ue,phase:"idle",runtimeSnapshot:"",messages:[],error:null}))),await Promise.all(W.map(async({run:de})=>{try{await Hu(de.runId)}catch(Ue){console.warn("清理调试运行失败",Ue)}}))},Kn=async W=>{const de=pe.current.get(W);if(de){pe.current.delete(W),J(pe.current.size);try{await Hu(de.run.runId)}catch(Ue){console.warn("清理调试运行失败",Ue)}}},Pn=async()=>O!=="validate"||ye===0?!0:window.confirm("离开调试页面后,当前环境将被清理。您可以通过重新启动环境进行新的测试。")?(await as(),!0):!1,Jn=async W=>{if(await Pn()){if(rt(""),!on()){D("build");return}V(!0);try{const de=W?ne.find(Yt=>Yt.id===W):Dn;de&&ce(de.id);const Ue=de?{...f,modelName:de.modelName||f.modelName,description:de.description,instruction:de.instruction}:f,Ye=await Kw(d5(Ue));Ue!==f&&h(Ue),B(Ye),D("publish")}catch(de){rt(de instanceof Error?de.message:String(de))}finally{V(!1)}}},os=async W=>{if(!ie||I||!on())return;const de=ne.find(yn=>yn.id===W);if(!de||de.phase==="starting"||de.phase==="sending")return;const Ue=de.modelName.trim(),Ye=de.description.trim(),Yt=de.instruction.trim(),mt=Wl(de),gn=ne.findIndex(yn=>yn.id===W),kt=ne.findIndex(yn=>Wl(yn)===mt);if(!Ue||!Ye||!Yt||kt!==gn)return;const Sn=ag(Ir,de);oe(yn=>yn.map(Bn=>Bn.id===W?{...Bn,configOpen:!1,phase:"starting",messages:[],error:null}:Bn)),Ee("");let Jt=null;try{await Kn(W);const yn={...f,modelName:de.modelName||f.modelName,description:de.description,instruction:de.instruction};Jt=await pM(f5(yn));const Bn=await mM(Jt.runId,"test_user");pe.current.set(W,{run:Jt,sessionId:Bn}),J(pe.current.size),oe(en=>en.map(xr=>xr.id===W?{...xr,phase:"ready",runtimeSnapshot:Sn}:xr))}catch(yn){if(Jt)try{await Hu(Jt.runId)}catch(Bn){console.warn("清理调试运行失败",Bn)}oe(Bn=>Bn.map(en=>en.id===W?{...en,phase:"error",runtimeSnapshot:"",error:yn instanceof Error?yn.message:String(yn)}:en))}},Si=async()=>{const W=fe.trim(),de=ne.filter(Ye=>Ye.phase==="ready"&&Ye.runtimeSnapshot===ag(Ir,Ye)&&pe.current.has(Ye.id));if(!W||de.length===0)return;Ee("");const Ue=new Set(de.map(Ye=>Ye.id));oe(Ye=>Ye.map(Yt=>Ue.has(Yt.id)?{...Yt,phase:"sending",messages:[...Yt.messages,{role:"user",content:W},{role:"assistant",content:"",blocks:[]}]}:Yt)),await Promise.all(de.map(async Ye=>{const Yt=pe.current.get(Ye.id);if(Yt)try{let mt=zs();for await(const gn of gM({runId:Yt.run.runId,userId:"test_user",sessionId:Yt.sessionId,text:W})){const kt=gn.error||gn.errorMessage||gn.error_message;if(oe(Sn=>Sn.map(Jt=>{if(Jt.id!==Ye.id)return Jt;const yn=[...Jt.messages],Bn={...yn[yn.length-1]};return kt?Bn.error=String(kt):(mt=xc(mt,gn),Bn.content=mt.blocks.filter(en=>en.kind==="text").map(en=>en.text).join(""),Bn.blocks=mt.blocks),yn[yn.length-1]=Bn,{...Jt,messages:yn}})),kt)break}}catch(mt){oe(gn=>gn.map(kt=>{if(kt.id!==Ye.id)return kt;const Sn=[...kt.messages],Jt={...Sn[Sn.length-1]};return Jt.error=mt instanceof Error?mt.message:String(mt),Sn[Sn.length-1]=Jt,{...kt,messages:Sn}}))}finally{oe(mt=>mt.map(gn=>gn.id===Ye.id?{...gn,phase:"ready"}:gn))}}))},ri=()=>{oe(W=>{if(W.length>=3)return W;const de=re.current++,Ue=`variant-${de}`;return[...W,{id:Ue,name:`对照组 ${de}`,modelName:f.modelName??"",description:f.description,instruction:f.instruction,optimizations:[],configOpen:!0,phase:"idle",runtimeSnapshot:"",messages:[],error:null}]})},Cs=async W=>{await Kn(W),oe(de=>de.filter(Ue=>Ue.id!==W)),ee===W&&ce("baseline")},Rr=(W,de)=>oe(Ue=>Ue.map(Ye=>Ye.id===W?{...Ye,...de}:Ye)),Zo=(W,de,Ue)=>{Rr(W,{[de]:Ue}),!(ee!==W||W==="baseline")&&ce("baseline")},Jo=W=>{const de=ne.find(Sn=>Sn.id===W);if(!de)return;const Ue=de.modelName.trim(),Ye=de.description.trim(),Yt=de.instruction.trim(),mt=Wl(de),gn=ne.findIndex(Sn=>Sn.id===W),kt=ne.findIndex(Sn=>Wl(Sn)===mt);if(!(!Ue||!Ye||!Yt||kt!==gn)){if(W==="baseline"){Rr(W,{configOpen:!1});return}os(W)}},el=async(W,de,Ue)=>{var mt;const Ye=(mt=f.deployment)==null?void 0:mt.network,Yt=Ye&&Ye.mode&&Ye.mode!=="public"?{mode:Ye.mode,vpc_id:Ye.vpcId,subnet_ids:Ye.subnetIds,enable_shared_internet_access:Ye.enableSharedInternetAccess}:void 0;return Dg(W.name,W.files,{region:(a==null?void 0:a.region)??G,projectName:"default",network:Yt},{...Ue,onStage:de,runtimeId:a==null?void 0:a.runtimeId,description:f.description})},Ti=()=>{on()&&(oe(W=>W.map(de=>de.id==="baseline"&&!pe.current.has(de.id)?{...de,modelName:f.modelName??"",description:f.description,instruction:f.instruction}:de)),D("validate"))},er=async W=>{if(W==="publish"){M?D("publish"):Jn();return}if(W==="validate"){Ti();return}await Pn()&&D(W)},Is=Ot.current,Vr=W=>aC.find(de=>de.id===W);return l.jsxs("div",{className:"cw-root",children:[l.jsx(qge,{mode:O,agentName:Yge(f),busy:I,onChange:er,onDiscard:d?()=>{S?X(!0):d()}:void 0}),ke&&l.jsx("div",{className:"cw-workspace-alert",role:"alert",children:ke}),l.jsxs("main",{className:"cw-workspace-main",id:"cw-workspace-main",children:[O==="build"&&l.jsxs("div",{className:"cw-build-workspace",children:[l.jsx("section",{className:`cw-ai-compose${y?" is-generating":""}${g?" is-success":""}`,"aria-label":"AI 自动填写 Agent 配置",children:l.jsx($s,{initial:!1,mode:"wait",children:g?l.jsxs(Dt.div,{className:"cw-ai-compose-success",role:"status",initial:{opacity:0,scale:.98},animate:{opacity:1,scale:1},exit:{opacity:0,scale:.98},transition:{duration:.22,ease:[.22,1,.36,1]},children:[l.jsx("span",{className:"cw-ai-success-check","aria-hidden":!0}),l.jsx("strong",{children:"生成成功"}),l.jsx("button",{type:"button",className:"cw-ai-regenerate",onClick:()=>x(!1),children:"重新生成"})]},"success"):l.jsxs(Dt.div,{className:"cw-ai-compose-entry",initial:{opacity:0,scale:.98},animate:{opacity:1,scale:1},exit:{opacity:0,scale:.98},transition:{duration:.2,ease:[.22,1,.36,1]},children:[l.jsxs("form",{className:"cw-ai-compose-form",onSubmit:W=>{W.preventDefault(),nt()},children:[l.jsx("input",{type:"text",value:p,maxLength:8e3,disabled:y,placeholder:"输入您的目标",onChange:W=>m(W.target.value),onKeyDown:W=>{W.key==="Enter"&&(W.preventDefault(),nt())}}),l.jsx("button",{type:"submit",disabled:y||!p.trim(),"aria-label":y?"正在智能生成":"智能生成",children:y?l.jsx("span",{className:"cw-ai-orb","aria-hidden":!0,children:l.jsx("span",{})}):"智能生成"})]}),l.jsx("p",{className:"cw-ai-compose-note",children:"使用 doubao-seed-2-0-lite-260428 模型生成,将会产生 Token 消耗"})]},"compose")})}),l.jsxs("div",{className:"cw-editor",children:[l.jsx(eg,{draft:f,direction:"vertical",selectedPath:He,onSelect:be,onAdd:Xt,onInsert:mn,onDelete:te}),l.jsxs("div",{className:"cw-detail",children:[l.jsx("div",{className:"cw-detail-scroll",ref:Le,children:l.jsx("div",{className:"cw-detail-inner",children:l.jsxs("div",{className:"cw-lower",children:[l.jsxs("div",{className:"cw-form-col",children:[l.jsx(Is,{meta:Vr("type"),children:l.jsx("div",{className:"cw-agent-type-options",role:"radiogroup","aria-label":"Agent 类型",children:cge.map(W=>{const de=(Ce.agentType??"llm")===W.id,Ue=Ie&&W.id==="a2a",Ye=Ue?"cw-remote-agent-disabled-hint":void 0;return l.jsxs("label",{"data-agent-type":W.id,className:`cw-agent-type-option ${de?"is-on":""} ${Ue?"is-disabled":""}`,title:Ue?void 0:oC[W.id],tabIndex:Ue?0:void 0,"aria-describedby":Ye,children:[l.jsx("input",{type:"radio",name:"agentType",className:"cw-agent-type-radio",checked:de,disabled:Ue,onChange:()=>me(W.id)}),l.jsxs("span",{className:"cw-agent-type-copy",children:[l.jsx("strong",{children:Lge[W.id]}),l.jsx("small",{children:oC[W.id]})]}),Ue&&l.jsx("span",{id:Ye,className:"cw-agent-type-disabled-hint",role:"tooltip",children:"远程智能体只能作为子步骤使用"})]},W.id)})})}),l.jsx(Is,{meta:Vr("basic"),children:l.jsxs("div",{className:"cw-form",children:[!xe&&l.jsxs(l.Fragment,{children:[l.jsxs("div",{className:"cw-field",children:[l.jsxs("label",{className:"cw-label",children:[Ie?"Agent 名称":"步骤名称",l.jsx("span",{className:"cw-req",children:"*"})]}),l.jsx("input",{className:`cw-input ${vn(Je)}`,value:Ce.name,placeholder:"customer_service",onChange:W=>je({name:W.target.value})}),L&&qe?l.jsx("span",{className:"cw-error-text",children:qe}):l.jsx("span",{className:"cw-help",children:"遵循 Google ADK 命名规则,且在执行流程中保持唯一。"})]}),l.jsxs("div",{className:"cw-field",children:[l.jsxs("label",{className:"cw-label",children:[Ie?"描述":"任务说明",l.jsx("span",{className:"cw-req",children:"*"})]}),l.jsx("textarea",{className:`cw-textarea cw-textarea-sm ${vn(ct)}`,value:Ce.description,placeholder:"简要描述这个 Agent 的用途,便于团队识别…",onChange:W=>je({description:W.target.value})}),L&&ct?l.jsx("span",{className:"cw-error-text",children:"描述为必填项"}):l.jsx("span",{className:"cw-help",children:"描述会显示在 Agent 列表与选择器中。"})]})]}),ve?l.jsxs(l.Fragment,{children:[l.jsx("p",{className:"cw-section-desc",children:"这是一个协作容器,本身不生成回答。请在左侧画布中 添加任务步骤,并通过拖拽调整它们的位置。"}),Ce.agentType==="loop"&&l.jsxs("div",{className:"cw-field",children:[l.jsx("label",{className:"cw-label",children:"最大轮次"}),l.jsx("input",{className:"cw-input",type:"number",min:1,value:Ce.maxIterations??3,onChange:W=>je({maxIterations:Math.max(1,Number(W.target.value)||1)})}),l.jsx("span",{className:"cw-help",children:"循环编排反复执行子 Agent,直到满足条件或达到该轮次上限。"})]})]}):xe?l.jsxs("div",{className:"cw-field cw-remote-center-fields",children:[l.jsxs("div",{className:"cw-remote-center-head",children:[l.jsxs("div",{className:"cw-label",children:["AgentKit 智能体中心",l.jsx("span",{className:"cw-req",children:"*"})]}),l.jsx("p",{className:"cw-help cw-remote-center-description",children:"远程 Agent 的名称、描述和能力来自中心返回的 Agent Card。 系统会根据每轮任务动态发现并挂载匹配的 Agent。"})]}),l.jsx(Dge,{value:((eh=Ce.a2aRegistry)==null?void 0:eh.registrySpaceId)??"",region:((tl=Ce.a2aRegistry)==null?void 0:tl.registryRegion)||qs.region,invalid:L&&Ft,onChange:W=>At(i5,W)}),l.jsxs("button",{type:"button",className:"cw-more-options","aria-expanded":yt,"aria-controls":Kt,onClick:()=>at(W=>!W),children:[l.jsx("span",{children:"更多选项"}),l.jsx(xs,{className:`cw-more-options-chevron ${yt?"is-open":""}`,"aria-hidden":!0})]}),l.jsx($s,{initial:!1,children:yt&&l.jsx(Dt.div,{id:Kt,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:l.jsx(yl,{env:Mge,values:a5(Ce.a2aRegistry,{includeDefaults:!1}),onChange:At})})}),L&&Ft&&l.jsx("span",{className:"cw-error-text",children:"请选择 AgentKit 智能体中心"})]}):l.jsxs("div",{className:"cw-field",children:[l.jsxs("label",{className:"cw-label",children:["系统提示词",l.jsx("span",{className:"cw-req",children:"*"})]}),l.jsx(w.Suspense,{fallback:l.jsx("div",{className:"cw-markdown-loading",role:"status",children:"正在加载 Markdown 编辑器…"}),children:l.jsx(Ige,{value:Ce.instruction,invalid:Rt,onChange:W=>je({instruction:W})})}),L&&Rt?l.jsx("span",{className:"cw-error-text",children:"系统提示词为必填项"}):l.jsx("span",{className:"cw-help",children:"支持 Markdown 快捷输入,例如键入 ## 加空格创建二级标题。"})]})]})}),!ve&&!xe&&l.jsxs(l.Fragment,{children:[l.jsx(Is,{meta:Vr("model"),children:l.jsxs("div",{className:"cw-form",children:[l.jsxs("div",{className:"cw-field",children:[l.jsx("label",{className:"cw-label",children:"模型名称"}),l.jsx("input",{className:"cw-input",value:Ce.modelName??"",placeholder:"doubao-seed-2-1-pro-260628",onChange:W=>je({modelName:W.target.value})})]}),l.jsxs("button",{type:"button",className:"cw-more-options","aria-expanded":ze,"aria-controls":wt,onClick:()=>We(W=>!W),children:[l.jsx("span",{children:"更多选项"}),l.jsx(xs,{className:`cw-more-options-chevron ${ze?"is-open":""}`,"aria-hidden":!0})]}),l.jsx($s,{initial:!1,children:ze&&l.jsxs(Dt.div,{id:wt,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:[l.jsxs("div",{className:"cw-field",children:[l.jsx("label",{className:"cw-label",children:"服务商 Provider"}),l.jsx("input",{className:"cw-input",value:Ce.modelProvider??"",placeholder:"openai",onChange:W=>je({modelProvider:W.target.value})})]}),l.jsxs("div",{className:"cw-field",children:[l.jsx("label",{className:"cw-label",children:"API Base"}),l.jsx("input",{className:"cw-input",value:Ce.modelApiBase??"",placeholder:"https://ark.cn-beijing.volces.com/api/v3/",onChange:W=>je({modelApiBase:W.target.value})}),l.jsx("span",{className:"cw-help",children:"留空则使用 VeADK 默认模型配置;Ark API Key 会由 Studio 服务端凭据自动获取。其他服务商的 Key 可在部署页添加。"})]})]})})]})}),l.jsx(Is,{meta:Vr("tools"),children:l.jsxs("div",{className:"cw-form",children:[l.jsxs("div",{className:"cw-field",children:[l.jsx("label",{className:"cw-label",children:"内置工具"}),l.jsx("span",{className:"cw-help",children:"勾选 VeADK 提供的内置能力,生成时会自动补全 import 与所需环境变量。"}),l.jsx("div",{className:"cw-tools-list-shell",children:l.jsx(cC,{items:_c,selected:he,onToggle:it,scrollRows:6})}),l.jsx($s,{initial:!1,children:he.includes("run_code")&&l.jsxs(Dt.div,{className:"cw-tool-config",initial:{opacity:0,y:-4},animate:{opacity:1,y:0},exit:{opacity:0,y:-4},transition:{duration:.16,ease:"easeOut"},children:[l.jsxs("div",{className:"cw-tool-config-head",children:[l.jsx("span",{className:"cw-label",children:"代码执行配置"}),l.jsx("span",{className:"cw-help",children:"指定 AgentKit 代码执行沙箱。"})]}),l.jsx(yl,{env:((nl=_c.find(W=>W.id==="run_code"))==null?void 0:nl.env)??[],values:((rl=f.deployment)==null?void 0:rl.envValues)??{},onChange:st})]})})]}),l.jsxs("button",{type:"button",className:"cw-more-options","aria-expanded":St,"aria-controls":Pt,onClick:()=>Tt(W=>!W),children:[l.jsx("span",{children:"更多类型工具"}),Oe.length>0&&l.jsxs("span",{className:"cw-more-options-count",children:["已配置 ",Oe.length]}),l.jsx(xs,{className:`cw-more-options-chevron ${St?"is-open":""}`,"aria-hidden":!0})]}),l.jsx($s,{initial:!1,children:St&&l.jsx(Dt.div,{id:Pt,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:l.jsxs("div",{className:"cw-field",children:[l.jsx("label",{className:"cw-label",children:"MCP 工具"}),l.jsx("span",{className:"cw-help",children:"连接外部 MCP 服务,生成时会为每个条目创建对应的 MCPToolset。"}),l.jsx(Bge,{tools:Oe,onChange:W=>je({mcpTools:W})})]})})})]})}),l.jsx(Is,{meta:Vr("skills"),children:l.jsx("div",{className:"cw-form",children:l.jsx(Uge,{selected:lt,onChange:W=>je({selectedSkills:W})})})}),l.jsx(Is,{meta:Vr("knowledge"),children:l.jsxs("div",{className:"cw-form cw-toggle-stack",children:[l.jsx(Lu,{checked:Ce.knowledgebase,onChange:W=>je({knowledgebase:W}),title:"知识库",desc:"启用外部知识检索(RAG),让 Agent 基于你的资料作答。",icon:Tp}),Ce.knowledgebase&&l.jsxs("div",{className:"cw-field cw-subfield",children:[l.jsx("label",{className:"cw-label",children:"知识库后端"}),l.jsx(yb,{options:nE,value:Ce.knowledgebaseBackend,onChange:W=>je({knowledgebaseBackend:W,knowledgebaseIndex:W==="viking"?Ce.knowledgebaseIndex:""})}),(Ce.knowledgebaseBackend??kc)==="viking"&&l.jsxs("div",{className:"cw-field cw-subfield",children:[l.jsx("label",{className:"cw-label",children:"VikingDB 知识库"}),l.jsx(Pge,{value:Ce.knowledgebaseIndex??"",onChange:W=>je({knowledgebaseIndex:W})})]}),l.jsx(yl,{env:((th=nE.find(W=>W.id===(Ce.knowledgebaseBackend??kc)))==null?void 0:th.env)??[],values:((ou=f.deployment)==null?void 0:ou.envValues)??{},onChange:st})]})]})}),Ie&&l.jsxs("section",{ref:W=>{Ke.current.advanced=W},id:"cw-sec-advanced","data-step-id":"advanced",className:"cw-section cw-advanced-section",children:[l.jsxs("button",{type:"button",className:"cw-advanced-disclosure","aria-expanded":H,"aria-controls":pn,onClick:()=>Z(W=>!W),children:[l.jsx("span",{className:"cw-advanced-disclosure-title",children:"进阶配置"}),l.jsx(xs,{className:`cw-advanced-disclosure-chevron ${H?"is-open":""}`,"aria-hidden":!0}),Bt>0&&l.jsxs("span",{className:"cw-more-options-count",children:["已启用 ",Bt]})]}),l.jsx($s,{initial:!1,children:H&&l.jsxs(Dt.div,{id:pn,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:[l.jsxs("div",{className:"cw-advanced-group",children:[l.jsx("div",{className:"cw-advanced-group-head",children:l.jsx("span",{children:"记忆"})}),l.jsxs("div",{className:"cw-form cw-toggle-stack",children:[l.jsx(Lu,{checked:Ce.memory.shortTerm,onChange:W=>je({memory:{...Ce.memory,shortTerm:W}}),title:"短期记忆",desc:"在单次会话内保留上下文,跨轮次记住对话内容。",icon:OL}),Ce.memory.shortTerm&&l.jsxs("div",{className:"cw-field cw-subfield",children:[l.jsx("label",{className:"cw-label",children:"短期记忆后端"}),l.jsx(yb,{options:eE,value:Ce.shortTermBackend,onChange:W=>je({shortTermBackend:W})}),l.jsx(yl,{env:((Ai=eE.find(W=>W.id===(Ce.shortTermBackend??"local")))==null?void 0:Ai.env)??[],values:((_t=f.deployment)==null?void 0:_t.envValues)??{},onChange:st})]}),l.jsx(Lu,{checked:Ce.memory.longTerm,onChange:W=>je({memory:{...Ce.memory,longTerm:W}}),title:"长期记忆",desc:"跨会话持久化关键信息,让 Agent 记住历史偏好。",icon:Tp}),Ce.memory.longTerm&&l.jsxs("div",{className:"cw-field cw-subfield",children:[l.jsx("label",{className:"cw-label",children:"长期记忆后端"}),l.jsx(yb,{options:tE,value:Ce.longTermBackend,onChange:W=>je({longTermBackend:W})}),l.jsx(yl,{env:((lu=tE.find(W=>W.id===(Ce.longTermBackend??"local")))==null?void 0:lu.env)??[],values:((qa=f.deployment)==null?void 0:qa.envValues)??{},onChange:st}),l.jsx(Lu,{checked:!!Ce.autoSaveSession,onChange:W=>je({autoSaveSession:W}),title:"自动保存会话到长期记忆",desc:"会话结束时自动把内容写入长期记忆,无需手动调用。",icon:Tp})]})]})]}),l.jsxs("div",{className:"cw-advanced-group",children:[l.jsx("div",{className:"cw-advanced-group-head",children:l.jsx("span",{children:"观测"})}),l.jsxs("div",{className:"cw-form cw-toggle-stack",children:[l.jsx(Lu,{checked:Ce.tracing,onChange:W=>je({tracing:W}),title:"观测 / Tracing",desc:"记录每一步的调用链路与耗时,便于调试与性能分析。",icon:SL}),Ce.tracing&&l.jsxs("div",{className:"cw-field cw-subfield",children:[l.jsx("label",{className:"cw-label",children:"Tracing 导出器"}),l.jsx("span",{className:"cw-help",children:"选择一个或多个观测平台,生成时会写入对应的 ENABLE_* 开关与环境变量。"}),l.jsx(cC,{items:rE,selected:De,onToggle:Q}),l.jsx(yl,{env:rE.filter(W=>De.includes(W.id)).flatMap(W=>W.env),values:((sl=f.deployment)==null?void 0:sl.envValues)??{},onChange:st})]})]})]})]})})]})]})]}),l.jsx("nav",{className:"cw-rail","aria-label":"步骤导航",children:l.jsxs("ol",{className:"cw-steps",children:[l.jsx("div",{className:"cw-rail-track","aria-hidden":!0,children:l.jsx(Dt.div,{className:"cw-rail-fill",animate:{height:`${Math.max(Vn,0)/Math.max(kn.length-1,1)*100}%`},transition:{type:"spring",stiffness:260,damping:32}})}),kn.map(W=>{const de=W.id===Te,Ue=Or[W.id];return l.jsx("li",{children:l.jsxs("button",{type:"button",className:`cw-step ${de?"is-active":""} ${Ue?"is-done":""}`,onClick:()=>Zn(W.id),"aria-current":de?"step":void 0,"aria-label":W.label,children:[l.jsx("span",{className:"cw-step-marker","aria-hidden":!0,children:de?l.jsx("span",{className:"cw-dot"}):Ue?l.jsx(Js,{className:"cw-step-check"}):l.jsx("span",{className:"cw-dot"})}),l.jsx("span",{className:"cw-step-tooltip","aria-hidden":!0,children:W.label})]})},W.id)})]})})]})})}),l.jsx("button",{type:"button",className:"cw-build-next studio-update-action",onClick:Ti,children:l.jsx("span",{children:"开始调试"})})]})]})]}),O==="validate"&&l.jsx("div",{className:"cw-validation-workspace",children:l.jsx("div",{className:"cw-validation-content",children:l.jsx(Wge,{enabled:ie,disabledReason:q,variants:ne,draftSnapshot:Ir,input:fe,onInput:Ee,onSend:Si,onStartVariant:os,onDeployVariant:W=>void Jn(W),onAddVariant:ri,onRemoveVariant:Cs,onToggleConfig:W=>{const de=ne.find(Ue=>Ue.id===W);de&&Rr(W,{configOpen:!de.configOpen})},onCompleteConfig:Jo,onConfigChange:Zo})})}),O==="publish"&&l.jsx("div",{className:"cw-preview-body",children:M?l.jsx(w0,{embedded:!0,project:M,agentDraft:f,agentName:f.name||"未命名 Agent",agentCount:c5(f),releaseConfiguration:Dn?{modelName:Dn.modelName||f.modelName||"默认模型",description:Dn.description,instruction:Dn.instruction,optimizations:Dn.optimizations.flatMap(W=>{const de=h5.find(Ue=>Ue.id===W);return de?[de.label]:[]})}:void 0,onChange:B,onDeploy:el,onAgentAdded:n,onDeploymentTaskChange:i,deploymentActionLabel:a?"更新并发布":"部署",deploymentRuntimeId:a==null?void 0:a.runtimeId,onDeploymentStarted:c,onDeploymentComplete:o,feishuEnabled:!!((nh=f.deployment)!=null&&nh.feishuEnabled),onFeishuEnabledChange:W=>{const de={...f,deployment:{...f.deployment??{feishuEnabled:!1},feishuEnabled:W}};h(de)},deploymentEnv:or.specs,deploymentEnvValues:{...(rh=f.deployment)==null?void 0:rh.envValues,...or.fixedValues},onDeploymentEnvChange:st,network:(sh=f.deployment)==null?void 0:sh.network,onNetworkChange:W=>h(de=>({...de,deployment:{...de.deployment??{feishuEnabled:!1},network:W}})),deployRegion:G,onDeployRegionChange:P,onExportYaml:()=>Oge(`${f.name||"agent"}.yaml`,Rme(f),"text/yaml")}):l.jsxs("div",{className:"cw-publish-loading",role:"status",children:[l.jsx(Mt,{className:"cw-i cw-spin"}),l.jsx("strong",{children:"正在生成发布配置"}),l.jsx("span",{children:"校验 Agent 结构并准备部署快照…"})]})})]}),F&&l.jsx("div",{className:"confirm-scrim",onClick:()=>X(!1),children:l.jsxs("div",{className:"confirm-box",role:"dialog","aria-modal":"true","aria-labelledby":"discard-edit-title",onClick:W=>W.stopPropagation(),children:[l.jsx("div",{className:"confirm-title",id:"discard-edit-title",children:"放弃本次编辑?"}),l.jsx("div",{className:"confirm-text",children:"本次修改将不会保留,智能体会恢复到进入编辑前的状态。"}),l.jsxs("div",{className:"confirm-actions",children:[l.jsx("button",{type:"button",className:"confirm-btn",onClick:()=>X(!1),children:"继续编辑"}),l.jsx("button",{type:"button",className:"confirm-btn confirm-btn--danger",onClick:()=>{X(!1),d==null||d()},children:"放弃编辑"})]})]})}),b&&l.jsx("div",{className:"confirm-scrim",onClick:()=>_(null),children:l.jsxs("div",{className:"confirm-box cw-ai-error-dialog",role:"alertdialog","aria-modal":"true","aria-labelledby":"ai-generate-error-title","aria-describedby":"ai-generate-error-message",onClick:W=>W.stopPropagation(),children:[l.jsx("div",{className:"confirm-title",id:"ai-generate-error-title",children:"智能生成失败"}),l.jsx("div",{className:"cw-ai-error-message",id:"ai-generate-error-message",children:b}),l.jsx("div",{className:"confirm-actions",children:l.jsx("button",{type:"button",className:"confirm-btn cw-ai-error-close",onClick:()=>_(null),children:"关闭"})})]})})]})}function Di(e){return{...Nr(),...e}}const Qge=[{id:"support",icon:PH,draft:Di({name:"客服助手",description:"7×24 在线答疑,结合知识库与历史对话,稳定、礼貌地解决用户问题。",instruction:"你是一名专业、耐心的客服助手。请始终保持礼貌、友好的语气,优先依据知识库中的资料回答用户问题;当资料不足以确定答案时,如实告知用户并主动引导其提供更多信息,切勿编造。回答尽量简洁、分点清晰,必要时给出操作步骤。",model:"doubao-1.5-pro-32k",knowledgebase:!0,memory:{shortTerm:!0,longTerm:!0}})},{id:"analyst",icon:xH,draft:Di({name:"数据分析师",description:"运行代码完成统计与可视化,开启链路追踪,分析过程可观测、可复现。",instruction:"你是一名严谨的数据分析师。面对数据问题时,先厘清分析目标与口径,再通过编写并运行代码完成清洗、统计与可视化。每一步都要说明你的假设与方法,给出结论时附上关键数据支撑,并指出潜在的偏差与局限。",model:"doubao-1.5-pro-32k",tools:["code_runner"],tracing:!0})},{id:"translator",icon:BH,draft:Di({name:"翻译助手",description:"中英互译,忠实、通顺、地道,保留原文语气与专业术语。",instruction:"你是一名专业的翻译助手,精通中英互译。请在忠实于原文含义的前提下,使译文自然、地道、符合目标语言表达习惯;保留专有名词与专业术语的准确性,并尽量贴合原文的语气与风格。仅输出译文,除非用户额外要求解释。",model:"doubao-1.5-pro-32k"})},{id:"coder",icon:Iw,draft:Di({name:"代码助手",description:"编写、调试与重构代码,可运行代码验证结果,给出清晰可维护的实现。",instruction:"你是一名资深软件工程师。请根据需求编写正确、清晰、可维护的代码,遵循目标语言的惯用风格与最佳实践。在不确定时通过运行代码验证你的实现,给出关键的边界条件与测试思路,并对复杂逻辑附上简要注释。",model:"doubao-1.5-pro-32k",tools:["code_runner","file_reader"],tracing:!0})},{id:"researcher",icon:VH,draft:Di({name:"研究员",description:"联网检索一手资料,结合知识库与长期记忆,输出有据可查的研究结论。",instruction:"你是一名严谨的研究员。面对研究问题时,先拆解关键子问题,再通过联网检索收集多个一手、可信的来源,交叉验证后再下结论。结论需注明出处与不确定性,区分事实与推断,避免以偏概全。",model:"doubao-1.5-pro-32k",tools:["web_search"],knowledgebase:!0,memory:{shortTerm:!0,longTerm:!0}})},{id:"research-team",icon:rz,draft:Di({name:"多智能体研究团队",description:"由检索员、分析员、撰写员协作的研究编排,分工完成端到端调研报告。",instruction:"你是一支研究团队的总协调者。负责拆解用户的研究任务,将检索、分析、撰写分别委派给对应的子 Agent,汇总各子 Agent 的产出,把控整体质量,最终输出结构清晰、有据可查的研究报告。",model:"doubao-1.5-pro-32k",tracing:!0,memory:{shortTerm:!0,longTerm:!0},subAgents:[Di({name:"检索员",description:"联网搜集与课题相关的一手资料与数据。",instruction:"你是研究团队中的检索员。根据课题联网检索多个可信来源,整理出关键事实、数据与原文出处,交付给分析员,不做主观结论。",tools:["web_search"]}),Di({name:"分析员",description:"对检索到的材料做交叉验证与归纳分析。",instruction:"你是研究团队中的分析员。对检索员提供的材料做交叉验证、归纳与对比,提炼洞见、识别矛盾与不确定性,形成结构化的分析要点。",tools:["code_runner"]}),Di({name:"撰写员",description:"将分析结论组织为结构清晰、引用规范的报告。",instruction:"你是研究团队中的撰写员。把分析员的要点组织成结构清晰、语言通顺、引用规范的研究报告,确保每个结论都能追溯到来源。"})]})}];function Zge(e){const t=[];return e.tools.length&&t.push({icon:jL,label:"工具"}),(e.memory.shortTerm||e.memory.longTerm)&&t.push({icon:EH,label:"记忆"}),e.knowledgebase&&t.push({icon:bH,label:"知识库"}),e.tracing&&t.push({icon:yH,label:"观测"}),e.subAgents.length&&t.push({icon:ML,label:`子Agent ${e.subAgents.length}`}),t}function Jge({onBack:e,onCreate:t}){const[n,r]=w.useState(null);return l.jsx("div",{className:"tpl-root",children:n?l.jsx(t0e,{template:n,onBack:()=>r(null),onCreate:t}):l.jsx(e0e,{onPick:r})})}function e0e({onPick:e}){return l.jsxs("div",{className:"tpl-scroll",children:[l.jsxs("div",{className:"tpl-head",children:[l.jsx("h1",{className:"tpl-title",children:"从模板新建"}),l.jsx("p",{className:"tpl-sub",children:"选择一个预制 agent 模板,按需微调后即可创建。"})]}),l.jsx("div",{className:"tpl-grid",children:Qge.map((t,n)=>l.jsxs(Dt.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:[l.jsx("span",{className:"tpl-card-icon",children:l.jsx(t.icon,{className:"icon"})}),l.jsx("span",{className:"tpl-card-name",children:t.draft.name}),l.jsx("span",{className:"tpl-card-desc",children:Ts(t.draft.description)})]},t.id))})]})}function t0e({template:e,onBack:t,onCreate:n}){const[r,s]=w.useState(e.draft.name),i=e.icon,a=Zge(e.draft);function o(){const c=r.trim()||e.draft.name;n({...e.draft,name:c})}return l.jsxs("div",{className:"tpl-scroll tpl-scroll--detail",children:[l.jsxs("button",{className:"tpl-back",onClick:t,children:[l.jsx(xL,{className:"icon"})," 返回模板列表"]}),l.jsxs(Dt.div,{className:"tpl-detail",initial:{opacity:0,y:10},animate:{opacity:1,y:0},transition:{duration:.28,ease:[.22,1,.36,1]},children:[l.jsxs("div",{className:"tpl-detail-head",children:[l.jsx("span",{className:"tpl-detail-icon",children:l.jsx(i,{className:"icon"})}),l.jsxs("div",{className:"tpl-detail-headtext",children:[l.jsx("div",{className:"tpl-detail-name",children:e.draft.name}),l.jsx("div",{className:"tpl-detail-desc",children:Ts(e.draft.description)})]})]}),a.length>0&&l.jsx("div",{className:"tpl-tags tpl-tags--detail",children:a.map(c=>l.jsxs("span",{className:"tpl-tag",children:[l.jsx(c.icon,{className:"tpl-tag-icon"})," ",c.label]},c.label))}),l.jsxs("label",{className:"tpl-field",children:[l.jsx("span",{className:"tpl-field-label",children:"名称"}),l.jsx("input",{className:"tpl-input",value:r,onChange:c=>s(c.target.value),placeholder:e.draft.name})]}),l.jsxs("div",{className:"tpl-field",children:[l.jsx("span",{className:"tpl-field-label",children:"系统提示词"}),l.jsx("p",{className:"tpl-instruction",children:e.draft.instruction})]}),l.jsxs("div",{className:"tpl-meta-grid",children:[e.draft.model&&l.jsxs("div",{className:"tpl-meta",children:[l.jsx("span",{className:"tpl-meta-key",children:"模型"}),l.jsx("span",{className:"tpl-meta-val tpl-mono",children:e.draft.model})]}),l.jsxs("div",{className:"tpl-meta",children:[l.jsx("span",{className:"tpl-meta-key",children:"工具"}),l.jsx("span",{className:"tpl-meta-val",children:e.draft.tools.length?e.draft.tools.join("、"):"无"})]}),l.jsxs("div",{className:"tpl-meta",children:[l.jsx("span",{className:"tpl-meta-key",children:"记忆"}),l.jsx("span",{className:"tpl-meta-val",children:n0e(e.draft)})]}),l.jsxs("div",{className:"tpl-meta",children:[l.jsx("span",{className:"tpl-meta-key",children:"知识库"}),l.jsx("span",{className:"tpl-meta-val",children:e.draft.knowledgebase?"已开启":"关闭"})]}),l.jsxs("div",{className:"tpl-meta",children:[l.jsx("span",{className:"tpl-meta-key",children:"观测追踪"}),l.jsx("span",{className:"tpl-meta-val",children:e.draft.tracing?"已开启":"关闭"})]})]}),e.draft.subAgents.length>0&&l.jsxs("div",{className:"tpl-field",children:[l.jsxs("span",{className:"tpl-field-label",children:["子 Agent(",e.draft.subAgents.length,")"]}),l.jsx("div",{className:"tpl-subagents",children:e.draft.subAgents.map((c,u)=>l.jsxs("div",{className:"tpl-subagent",children:[l.jsxs("div",{className:"tpl-subagent-top",children:[l.jsx("span",{className:"tpl-subagent-name",children:c.name}),c.tools.length>0&&l.jsx("span",{className:"tpl-subagent-tools",children:c.tools.join("、")})]}),l.jsx("div",{className:"tpl-subagent-desc",children:Ts(c.description)})]},u))})]}),l.jsxs("button",{className:"tpl-create",onClick:o,children:["使用此模板创建 ",l.jsx(xs,{className:"icon"})]})]})]})}function n0e(e){const t=[];return e.memory.shortTerm&&t.push("短期"),e.memory.longTerm&&t.push("长期"),t.length?t.join(" + "):"关闭"}const r0e=[{type:"sequential",label:"顺序",desc:"节点依次执行",Icon:RL},{type:"parallel",label:"并行",desc:"节点同时执行",Icon:wL},{type:"loop",label:"循环",desc:"节点循环执行",Icon:jw}];let ZE=0;function vb(){return ZE+=1,`node_${ZE}`}function _b(e,t,n){const r=Nr();return{id:e,type:"agentNode",position:t,data:{agent:{...r,name:(n==null?void 0:n.name)??`agent_${e.replace("node_","")}`,...n}}}}function s0e({data:e,selected:t}){const n=e.agent;return l.jsxs("div",{className:`wfb-node ${t?"wfb-node--selected":""}`,children:[l.jsx(mr,{type:"target",position:Fe.Left,className:"wfb-handle"}),l.jsx("div",{className:"wfb-node-icon",children:l.jsx(Ro,{className:"icon"})}),l.jsxs("div",{className:"wfb-node-body",children:[l.jsx("div",{className:"wfb-node-name",children:n.name||"未命名节点"}),l.jsx("div",{className:"wfb-node-desc",children:n.instruction?n.instruction.slice(0,48):"点击编辑指令…"})]}),l.jsx(mr,{type:"source",position:Fe.Right,className:"wfb-handle"})]})}const i0e={agentNode:s0e},fC={type:"smoothstep",markerEnd:{type:Lc.ArrowClosed,width:16,height:16}};function a0e({onBack:e,onCreate:t}){const n=w.useRef(null),[r,s]=w.useState(""),[i,a]=w.useState(""),[o,c]=w.useState("sequential"),u=w.useMemo(()=>{ZE=0;const T=vb();return _b(T,{x:80,y:120},{name:"agent_1"})},[]),[d,f,h]=r4([u]),[p,m,y]=s4([]),[E,g]=w.useState(u.id),x=d.find(T=>T.id===E)??null,b=r.trim()||"workflow_agent",_=w.useMemo(()=>Q6({name:b,subAgents:d.map(T=>T.data.agent)}),[b,d]),k=cc(b)??(_.has(b)?"名称须与 Agent 节点名称保持唯一":null),N=x?cc(x.data.agent.name)??(_.has(x.data.agent.name)?"Agent 名称在当前工作流中必须唯一":null):null,C=d.length>0&&k===null&&d.every(T=>cc(T.data.agent.name)===null&&!_.has(T.data.agent.name)),S=w.useCallback(T=>m(R=>OP({...T,...fC},R)),[m]),A=w.useCallback(()=>{const T=vb(),R=d.length*28,M=_b(T,{x:80+R,y:120+R});f(B=>B.concat(M)),g(T)},[d.length,f]),O=T=>{T.dataTransfer.setData("application/wfb-node","agentNode"),T.dataTransfer.effectAllowed="move"},D=w.useCallback(T=>{T.preventDefault(),T.dataTransfer.dropEffect="move"},[]),F=w.useCallback(T=>{if(T.preventDefault(),T.dataTransfer.getData("application/wfb-node")!=="agentNode"||!n.current)return;const M=n.current.screenToFlowPosition({x:T.clientX,y:T.clientY}),B=vb(),I=_b(B,M);f(V=>V.concat(I)),g(B)},[f]),X=w.useCallback(T=>{E&&f(R=>R.map(M=>M.id===E?{...M,data:{...M.data,agent:{...M.data.agent,...T}}}:M))},[E,f]),L=w.useCallback(()=>{E&&(f(T=>T.filter(R=>R.id!==E)),m(T=>T.filter(R=>R.source!==E&&R.target!==E)),g(null))},[E,f,m]),j=w.useCallback(()=>{if(!C)return;const T=d.map(M=>M.data.agent),R={...Nr(),name:b,description:i.trim(),instruction:i.trim(),subAgents:T,workflow:{type:o,nodes:d.map(M=>({id:M.id,agent:M.data.agent})),edges:p.map(M=>({from:M.source,to:M.target}))}};t(R)},[C,d,p,b,i,o,t]);return l.jsx("div",{className:"wfb",children:l.jsxs("div",{className:"wfb-grid",children:[l.jsxs("aside",{className:"wfb-palette",children:[l.jsx("div",{className:"wfb-section-label",children:"工作流信息"}),l.jsxs("label",{className:"wfb-field",children:[l.jsx("span",{className:"wfb-field-label",children:"名称"}),l.jsx("input",{className:`wfb-input ${k?"wfb-input--error":""}`,value:r,onChange:T=>s(T.target.value),placeholder:"my_workflow"}),k&&l.jsx("span",{className:"wfb-field-error",children:k})]}),l.jsxs("label",{className:"wfb-field",children:[l.jsx("span",{className:"wfb-field-label",children:"描述"}),l.jsx("textarea",{className:"wfb-input wfb-textarea",value:i,onChange:T=>a(T.target.value),placeholder:"这个工作流做什么…",rows:2})]}),l.jsx("div",{className:"wfb-section-label",children:"执行方式"}),l.jsx("div",{className:"wfb-types",children:r0e.map(({type:T,label:R,desc:M,Icon:B})=>l.jsxs("button",{type:"button",className:`wfb-type ${o===T?"wfb-type--active":""}`,onClick:()=>c(T),children:[l.jsx(B,{className:"icon"}),l.jsxs("span",{className:"wfb-type-text",children:[l.jsx("span",{className:"wfb-type-name",children:R}),l.jsx("span",{className:"wfb-type-desc",children:M})]})]},T))}),l.jsx("div",{className:"wfb-section-label",children:"节点"}),l.jsxs("div",{className:"wfb-palette-item",draggable:!0,onDragStart:O,title:"拖拽到画布,或点击下方按钮添加",children:[l.jsx(DH,{className:"icon wfb-grip"}),l.jsx("span",{className:"wfb-node-icon wfb-node-icon--sm",children:l.jsx(Ro,{className:"icon"})}),l.jsx("span",{className:"wfb-palette-item-text",children:"Agent 节点"})]}),l.jsxs("button",{className:"wfb-add",type:"button",onClick:A,children:[l.jsx(sr,{className:"icon"}),"添加节点"]}),l.jsx("div",{className:"wfb-hint",children:"拖拽节点的圆点连线以表达执行顺序。"})]}),l.jsxs("div",{className:"wfb-canvas",children:[l.jsxs("button",{className:"wfb-create",onClick:j,disabled:!C,type:"button",children:[l.jsx(Lo,{className:"icon"}),"创建工作流"]}),l.jsxs(n4,{nodes:d,edges:p,onNodesChange:h,onEdgesChange:y,onConnect:S,onInit:T=>n.current=T,nodeTypes:i0e,defaultEdgeOptions:fC,onDrop:F,onDragOver:D,onNodeClick:(T,R)=>g(R.id),onPaneClick:()=>g(null),fitView:!0,fitViewOptions:{padding:.3,maxZoom:1},proOptions:{hideAttribution:!0},children:[l.jsx(a4,{gap:16,size:1,color:"hsl(240 5.9% 88%)"}),l.jsx(l4,{showInteractive:!1}),l.jsx(Mue,{pannable:!0,zoomable:!0,className:"wfb-minimap"})]})]}),l.jsx("aside",{className:"wfb-inspector",children:x?l.jsxs(l.Fragment,{children:[l.jsxs("div",{className:"wfb-inspector-head",children:[l.jsx("div",{className:"wfb-section-label",children:"节点配置"}),l.jsx("button",{className:"wfb-icon-btn",type:"button",onClick:L,title:"删除节点",children:l.jsx(ta,{className:"icon"})})]}),l.jsxs("label",{className:"wfb-field",children:[l.jsx("span",{className:"wfb-field-label",children:"名称"}),l.jsx("input",{className:`wfb-input ${N?"wfb-input--error":""}`,value:x.data.agent.name,onChange:T=>X({name:T.target.value}),placeholder:"agent_name"}),N?l.jsx("span",{className:"wfb-field-error",children:N}):l.jsx("span",{className:"wfb-field-help",children:"仅使用英文字母、数字和下划线,且名称保持唯一。"})]}),l.jsxs("label",{className:"wfb-field",children:[l.jsx("span",{className:"wfb-field-label",children:"描述"}),l.jsx("input",{className:"wfb-input",value:x.data.agent.description,onChange:T=>X({description:T.target.value}),placeholder:"这个 agent 做什么…"})]}),l.jsxs("label",{className:"wfb-field",children:[l.jsx("span",{className:"wfb-field-label",children:"指令 (instruction)"}),l.jsx("textarea",{className:"wfb-input wfb-textarea",value:x.data.agent.instruction,onChange:T=>X({instruction:T.target.value}),placeholder:"你是一个…",rows:6})]}),l.jsxs("label",{className:"wfb-field",children:[l.jsx("span",{className:"wfb-field-label",children:"工具 (逗号分隔)"}),l.jsx("input",{className:"wfb-input",value:x.data.agent.tools.join(", "),onChange:T=>X({tools:T.target.value.split(",").map(R=>R.trim()).filter(Boolean)}),placeholder:"web_search, calculator"})]}),l.jsxs("div",{className:"wfb-inspector-meta",children:[l.jsx("span",{className:"wfb-meta-key",children:"节点 ID"}),l.jsx("code",{className:"wfb-meta-val",children:x.id})]})]}):l.jsxs("div",{className:"wfb-inspector-empty",children:[l.jsx(Ro,{className:"wfb-empty-icon"}),l.jsx("p",{children:"选择一个节点以编辑其配置"}),l.jsxs("p",{className:"wfb-empty-sub",children:["共 ",d.length," 个节点 · ",p.length," 条连线"]})]})})]})})}function o0e(e){return l.jsx(Uv,{children:l.jsx(a0e,{...e})})}const hC=50*1024*1024,JE=800,l0e={name:"code_package",files:[]};function c0e(e){let n=e.replace(/\.zip$/i,"").trim().replace(/[^A-Za-z0-9_]+/g,"_").replace(/^_+|_+$/g,"");return n||(n="uploaded_agent"),/^[A-Za-z_]/.test(n)||(n=`agent_${n}`),n==="user"&&(n="uploaded_agent"),n.slice(0,64)}function u0e(e){const t=e.replace(/\\/g,"/").replace(/^\.\//,"");if(!t||t.endsWith("/"))return null;if(t.startsWith("/")||t.includes("\0"))throw new Error(`压缩包包含非法路径:${e}`);const n=t.split("/");if(n.some(r=>!r||r==="."||r===".."))throw new Error(`压缩包包含非法路径:${e}`);return n[0]==="__MACOSX"||n[n.length-1]===".DS_Store"?null:n.join("/")}function d0e(e){const t=e.flatMap(a=>{const o=u0e(a.name);return o?[{path:o,content:a.text}]:[]});if(t.length===0)throw new Error("压缩包中没有可部署的文件。");if(t.length>JE)throw new Error(`代码包文件数不能超过 ${JE} 个。`);const s=new Set(t.map(a=>a.path.split("/")[0])).size===1&&t.every(a=>a.path.includes("/"))?t.map(a=>({...a,path:a.path.split("/").slice(1).join("/")})):t,i=new Set;for(const a of s){if(i.has(a.path))throw new Error(`代码包包含重复文件:${a.path}`);i.add(a.path)}if(!i.has("app.py"))throw new Error("代码包根目录必须包含 app.py,作为 AgentKit 启动入口。");return s}function f0e({onBack:e,onAgentAdded:t,onDeploymentTaskChange:n}){const r=w.useRef(null),s=w.useRef(0),[i,a]=w.useState(null),[o,c]=w.useState(""),[u,d]=w.useState(!1),[f,h]=w.useState(!1),[p,m]=w.useState(!1),[y,E]=w.useState(""),[g,x]=w.useState("cn-beijing"),[b,_]=w.useState();w.useEffect(()=>()=>{s.current+=1},[]);async function k(A){const O=++s.current;if(E(""),!A.name.toLowerCase().endsWith(".zip")){E("请选择 .zip 格式的代码包。");return}if(A.size>hC){E("代码包不能超过 50 MB。");return}h(!0);try{const D=await J6(new Uint8Array(await A.arrayBuffer()),{maxEntries:JE,maxUncompressedBytes:hC}),F=d0e(D);if(O!==s.current)return;c(A.name),a({name:c0e(A.name),files:F})}catch(D){if(O!==s.current)return;c(""),a(null),E(D instanceof Error?D.message:String(D))}finally{O===s.current&&h(!1)}}function N(A){var D;const O=(D=A.currentTarget.files)==null?void 0:D[0];A.currentTarget.value="",O&&k(O)}function C(A){var D;A.preventDefault(),m(!1);const O=(D=A.dataTransfer.files)==null?void 0:D[0];O&&k(O)}async function S(A,O,D){const F=b&&b.mode!=="public"?{mode:b.mode,vpc_id:b.vpcId,subnet_ids:b.subnetIds,enable_shared_internet_access:b.enableSharedInternetAccess}:void 0;return Dg(A.name,A.files,{region:g,projectName:"default",network:F},{...D,onStage:O})}return l.jsxs("div",{className:"package-create package-create-preview",children:[l.jsx(w0,{project:i??l0e,agentName:(i==null?void 0:i.name)||"代码包",onChange:i?a:void 0,onDeploy:S,onAgentAdded:t,onDeploymentTaskChange:n,network:b,onNetworkChange:_,deployRegion:g,onDeployRegionChange:x,onBack:e,backLabel:"返回创建方式",deployDisabled:!i||f,deployDisabledReason:f?"正在读取代码包":i?void 0:"请先上传代码包",deploymentPrimaryPane:l.jsxs("section",{className:"package-source-pane","aria-label":"代码包上传",children:[l.jsx("div",{className:"package-source-label",children:"代码包"}),l.jsxs("div",{className:`package-dropzone${p?" is-dragging":""}${i?" is-ready":""}`,onDragEnter:A=>{A.preventDefault(),m(!0)},onDragOver:A=>A.preventDefault(),onDragLeave:A=>{A.currentTarget.contains(A.relatedTarget)||m(!1)},onDrop:C,onClick:()=>{var A;f||(A=r.current)==null||A.click()},onKeyDown:A=>{var O;!f&&(A.key==="Enter"||A.key===" ")&&(A.preventDefault(),(O=r.current)==null||O.click())},role:"button",tabIndex:f?-1:0,"aria-label":i?"重新上传代码包":"上传代码包","aria-disabled":f,children:[l.jsx("strong",{children:f?"正在读取代码包…":i?o:"请上传代码包"}),l.jsx("span",{children:i?`已识别 ${i.files.length} 个文件,点击区域可重新上传`:"点击或拖拽上传,支持 .zip 格式,最大 50 MB,根目录需包含 app.py"}),l.jsx("div",{className:"package-upload-actions",children:i&&l.jsx("button",{type:"button",className:"package-upload-secondary",onClick:A=>{A.stopPropagation(),d(!0)},onKeyDown:A=>A.stopPropagation(),children:"查看文件"})}),l.jsx("input",{ref:r,type:"file",accept:".zip,application/zip","aria-label":"选择代码包",onChange:N})]}),y&&l.jsx("div",{className:"package-create-error",role:"alert",children:y})]})}),i&&l.jsx(X6,{project:i,open:u,onClose:()=>d(!1),onChange:a})]})}const h0e=3*60*1e3,p0e=3e3,m0e=10*60*1e3,og="veadk.studio.pending-update",pC=[{id:"resolving",label:"读取目标版本信息"},{id:"downloading",label:"下载并校验完整更新包"},{id:"preparing",label:"准备 VeFaaS Function 代码"},{id:"submitting",label:"提交 Function 更新"},{id:"publishing",label:"发布新 Revision 并重启服务"}],g0e={resolving:"读取版本信息",downloading:"下载更新包",preparing:"准备 Function 代码",submitting:"提交 Function 更新",publishing:"发布 Revision",checking:"检查更新",unknown:"未知阶段"};function y0e(e){return e<60?`${e} 秒`:`${Math.floor(e/60)} 分 ${e%60} 秒`}function b0e(e,t){return e===t?!0:/^\d{14}$/.test(e)&&/^\d{14}$/.test(t)&&e>t}function E0e(){if(typeof window>"u")return null;const e=window.localStorage.getItem(og);if(!e)return null;try{const t=JSON.parse(e);if(typeof t.targetVersion=="string"&&typeof t.startedAt=="number")return{targetVersion:t.targetVersion,startedAt:t.startedAt}}catch{}return window.localStorage.removeItem(og),null}function kb(e,t){window.localStorage.setItem(og,JSON.stringify({targetVersion:e,startedAt:t}))}function up(){window.localStorage.removeItem(og)}function mC({className:e}){return l.jsxs("svg",{className:e,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"1.8",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":!0,children:[l.jsx("path",{d:"M19.2 8.3A8 8 0 1 0 20 13"}),l.jsx("path",{d:"M19.2 4.8v3.5h-3.5"}),l.jsx("path",{d:"M12 7.8v7.7"}),l.jsx("path",{d:"m9.2 12.7 2.8 2.8 2.8-2.8"})]})}function x0e(){return l.jsx("svg",{viewBox:"0 0 16 16",fill:"none","aria-hidden":!0,children:l.jsx("path",{d:"m4 6 4 4 4-4"})})}function w0e(){return l.jsx("svg",{viewBox:"0 0 16 16",fill:"none","aria-hidden":!0,children:l.jsx("path",{d:"m3.5 8.2 2.8 2.8 6.2-6"})})}function gC({lines:e,phase:t,copyState:n,onCopy:r}){const s=w.useRef(null),i=w.useRef(!0);return w.useEffect(()=>{const a=s.current;a&&i.current&&(a.scrollTop=a.scrollHeight)},[e]),l.jsxs("section",{className:"studio-update-live-log","aria-label":"VeFaaS 更新日志",children:[l.jsxs("div",{className:"studio-update-log-header",children:[l.jsxs("span",{children:[l.jsx("i",{className:`is-${t}`,"aria-hidden":!0}),"VeFaaS 更新日志",l.jsx("small",{children:t==="active"?"实时":t==="complete"?"已完成":"已停止"})]}),l.jsx("button",{type:"button",onClick:r,disabled:!e.length,children:n==="copied"?"已复制":n==="error"?"复制失败":"复制日志"})]}),l.jsx("div",{ref:s,className:"studio-update-log-lines",role:"log","aria-live":"off",tabIndex:0,onScroll:a=>{const o=a.currentTarget;i.current=o.scrollHeight-o.scrollTop-o.clientHeight<24},children:e.length?e.map((a,o)=>l.jsx("div",{children:a},`${o}-${a}`)):l.jsx("p",{children:t==="active"?"等待 VeFaaS 返回更新日志…":"本次更新未返回发布日志"})})]})}function v0e(){var X,L;const[e]=w.useState(E0e),[t,n]=w.useState(null),[r,s]=w.useState(e?"submitting":"idle"),[i,a]=w.useState(!1),[o,c]=w.useState(""),[u,d]=w.useState((e==null?void 0:e.targetVersion)??""),[f,h]=w.useState(!1),[p,m]=w.useState("idle"),[y,E]=w.useState(0),g=w.useRef(null),x=w.useRef((e==null?void 0:e.targetVersion)??""),b=w.useRef((e==null?void 0:e.startedAt)??0);w.useEffect(()=>{if(!f)return;const j=R=>{var M;R.target instanceof Node&&!((M=g.current)!=null&&M.contains(R.target))&&h(!1)},T=R=>{R.key==="Escape"&&h(!1)};return window.addEventListener("pointerdown",j),window.addEventListener("keydown",T),()=>{window.removeEventListener("pointerdown",j),window.removeEventListener("keydown",T)}},[f]);const _=w.useCallback(async()=>{const j=await cM(x.current||void 0,b.current||void 0);return n(j),j},[]);if(w.useEffect(()=>{let j=!0;const T=()=>{_().catch(()=>{j&&n(M=>M)})};T();const R=window.setInterval(T,h0e);return()=>{j=!1,window.clearInterval(R)}},[_]),w.useEffect(()=>{if(r!=="submitting")return;const j=window.setInterval(()=>{_().then(T=>{const R=x.current;if(R&&b0e(T.currentVersion,R)||!R&&!T.available&&T.latestVersion){window.clearInterval(j),up(),s("published"),c("Studio 已更新,刷新页面即可使用新版本");return}if(T.state==="error"){window.clearInterval(j),up(),s("error"),c(T.message||"Studio 更新失败");return}Date.now()-b.current>m0e&&(window.clearInterval(j),up(),s("error"),c("等待 VeFaaS 发布超时,请稍后重新检查版本"))}).catch(()=>{})},p0e);return()=>window.clearInterval(j)},[r,_]),w.useEffect(()=>{r!=="idle"||(t==null?void 0:t.state)!=="updating"||(x.current=t.targetVersion,b.current=t.startedAt||Date.now(),kb(t.targetVersion,b.current),d(t.targetVersion),s("submitting"))},[r,t]),w.useEffect(()=>{if(r!=="submitting"){E(0);return}const j=()=>{const R=b.current||Date.now();E(Math.max(0,Math.floor((Date.now()-R)/1e3)))};j();const T=window.setInterval(j,1e3);return()=>window.clearInterval(T)},[r]),!(t!=null&&t.enabled)||!(t.available||t.state==="updating"||r!=="idle"))return null;const N=t.releases??[],C=u||((X=N[0])==null?void 0:X.version)||t.latestVersion,S=N.find(j=>j.version===C),A=async()=>{x.current=C,b.current=Date.now(),kb(C,b.current),s("submitting"),c(""),m("idle");try{const j=await uM(C);x.current=j.version,kb(j.version,b.current),c("更新已提交,正在等待 VeFaaS 发布新版本")}catch(j){if(j instanceof TypeError){c("连接已切换,正在确认新版本状态");return}up(),s("error");const T=j instanceof Error?j.message:"Studio 更新失败";try{const R=await _();c(R.message||T)}catch{c(T)}}},O=(L=t.updateLogs)!=null&&L.length?t.updateLogs:(t.errorLog||t.progressMessage||o).split(` +`).filter(Boolean),D=async()=>{try{await navigator.clipboard.writeText(O.join(` +`)),m("copied")}catch{m("error")}},F=()=>{var j;h(!1),m("idle"),c(""),d(x.current||((j=N[0])==null?void 0:j.version)||""),s("confirm")};return l.jsxs(l.Fragment,{children:[l.jsxs("button",{type:"button",className:`studio-update-trigger is-${r}`,title:r==="submitting"?"正在更新 Studio":r==="published"?"Studio 已更新":`更新 Studio 至 ${t.latestVersion}`,onClick:()=>{var j;r==="published"?window.location.reload():(r==="submitting"||r==="error"||(d(((j=N[0])==null?void 0:j.version)||t.latestVersion),s("confirm")),a(!0))},children:[l.jsx(mC,{className:"studio-update-icon"}),r==="submitting"?l.jsx(na,{as:"span",children:"正在更新"}):r==="published"?l.jsx("span",{children:"刷新使用新版"}):r==="error"?l.jsx("span",{children:"更新失败"}):l.jsx("span",{children:"有新版更新"})]}),i&&r!=="idle"&&l.jsx("div",{className:"confirm-scrim",role:"presentation",children:l.jsxs("section",{className:"confirm-box studio-update-dialog",role:"dialog","aria-modal":"true","aria-labelledby":"studio-update-title",children:[l.jsx("div",{className:"studio-update-dialog-mark",children:l.jsx(mC,{})}),l.jsx("div",{id:"studio-update-title",className:"confirm-title",children:r==="error"?"Studio 更新失败":r==="submitting"?"正在更新 Studio":r==="published"?"Studio 更新完成":"发现新版本"}),r==="error"?l.jsxs("div",{className:"studio-update-error-panel",children:[l.jsx("p",{className:"confirm-text studio-update-error",children:o}),l.jsxs("dl",{className:"studio-update-error-meta",children:[l.jsxs("div",{children:[l.jsx("dt",{children:"失败阶段"}),l.jsx("dd",{children:g0e[t.errorStage]||t.errorStage||"未知阶段"})]}),l.jsxs("div",{children:[l.jsx("dt",{children:"错误 ID"}),l.jsx("dd",{children:t.errorId||"未生成"})]})]}),l.jsx(gC,{lines:O,phase:"error",copyState:p,onCopy:()=>void D()}),t.consoleUrl&&l.jsxs("a",{className:"studio-update-console-link",href:t.consoleUrl,target:"_blank",rel:"noreferrer",children:["前往 VeFaaS 控制台查看 Function 日志",l.jsx("span",{"aria-hidden":!0,children:"↗"})]})]}):r==="submitting"||r==="published"?l.jsxs(l.Fragment,{children:[l.jsxs("div",{className:"studio-update-progress-summary",children:[l.jsxs("div",{children:[l.jsx("span",{children:"目标版本"}),l.jsx("strong",{children:x.current||C})]}),l.jsxs("div",{children:[l.jsx("span",{children:r==="published"?"更新状态":"已用时"}),l.jsx("strong",{children:r==="published"?"已完成":y0e(y)})]})]}),l.jsx("ol",{className:"studio-update-progress","aria-label":"Studio 更新进度",children:pC.map((j,T)=>{const R=pC.findIndex(I=>I.id===t.progressStage),M=r==="published"||Tvoid D()}),l.jsx("p",{className:"studio-update-progress-note",children:"发布阶段会短暂中断连接;关闭此窗口不会停止更新,可随时点击右上角按钮重新查看。"})]}):l.jsxs(l.Fragment,{children:[l.jsx("p",{className:"confirm-text",children:"更新会重启 Studio 服务,预计约 3–5 分钟完成更新与发布。期间正在进行的对话、 流式响应或部署任务可能中断,登录态不会受到影响。"}),l.jsxs("div",{className:"studio-update-field",ref:g,children:[l.jsx("span",{children:"选择版本"}),l.jsxs("button",{type:"button",className:"studio-update-version-trigger","aria-label":"选择版本","aria-haspopup":"listbox","aria-expanded":f,onClick:()=>h(j=>!j),onKeyDown:j=>{(j.key==="ArrowDown"||j.key==="ArrowUp")&&(j.preventDefault(),h(!0))},children:[l.jsx("span",{children:C}),l.jsx(x0e,{})]}),f&&l.jsx("div",{className:"studio-update-version-menu",role:"listbox","aria-label":"选择版本",children:N.map(j=>{const T=j.version===C;return l.jsxs("button",{type:"button",role:"option","aria-selected":T,className:`studio-update-version-option${T?" is-selected":""}`,onClick:()=>{d(j.version),h(!1)},children:[l.jsx("span",{children:j.version}),T&&l.jsx(w0e,{})]},j.version)})})]}),l.jsxs("dl",{className:"studio-update-versions",children:[l.jsxs("div",{children:[l.jsx("dt",{children:"当前版本"}),l.jsx("dd",{children:t.currentVersion})]}),l.jsxs("div",{children:[l.jsx("dt",{children:"目标版本"}),l.jsx("dd",{children:C})]}),l.jsxs("div",{children:[l.jsx("dt",{children:"Commit"}),l.jsx("dd",{children:((S==null?void 0:S.gitSha)||t.latestGitSha).slice(0,8)})]})]}),l.jsxs("section",{className:"studio-update-changelog","aria-labelledby":"studio-update-changelog-title",children:[l.jsx("div",{id:"studio-update-changelog-title",children:"更新内容"}),S!=null&&S.changelog.length?l.jsx("ul",{children:S.changelog.map(j=>l.jsx("li",{children:j},j))}):l.jsx("p",{children:"暂无更新说明"})]})]}),l.jsxs("div",{className:"confirm-actions",children:[l.jsx("button",{type:"button",className:"confirm-btn",onClick:()=>{a(!1),h(!1),r==="confirm"&&(s("idle"),c(""))},children:r==="submitting"?"后台运行":r==="confirm"?"取消":"关闭"}),r==="confirm"&&l.jsx("button",{type:"button",className:"confirm-btn studio-update-confirm",onClick:()=>void A(),children:"立即更新"}),r==="error"&&l.jsx("button",{type:"button",className:"confirm-btn studio-update-confirm",onClick:F,children:"重新尝试"})]})]})})]})}const _0e="/web/skill-creator";class p_ extends Error{constructor(n,r){super(n);P_(this,"status");this.name="SkillCreatorApiError",this.status=r}}function Qo(e,t){if(!e||typeof e!="object"||Array.isArray(e))throw new Error(`${t} 格式错误`);return e}function nn(e,...t){for(const n of t){const r=e[n];if(typeof r=="string"&&r)return r}}function p5(e,...t){for(const n of t){const r=e[n];if(typeof r=="number"&&Number.isFinite(r))return r}}async function Zf(e,t){return fetch(xi(`${_0e}${e}`),{...t,headers:Mg({Accept:"application/json",...t!=null&&t.body?{"Content-Type":"application/json"}:{},...t==null?void 0:t.headers})})}async function m_(e,t){if((e.headers.get("content-type")??"").includes("application/json")){const s=Qo(await e.json(),"错误响应");return nn(s,"detail","message","error")??t}return(await e.text()).trim()||t}async function g_(e,t){if(!e.ok)throw new p_(await m_(e,t),e.status);if(!(e.headers.get("content-type")??"").includes("application/json"))throw new Error(`${t}:服务端返回了非 JSON 响应`);return e.json()}function k0e(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 N0e(e){if(e==="provisioning"||e==="generating"||e==="validating"||e==="packaging"||e==="completed"||e==="failed")return e;throw new Error(`未知的 Skill 生成阶段:${String(e)}`)}function S0e(e){return Array.isArray(e)?e.map((t,n)=>{const r=Qo(t,`文件 ${n+1}`),s=nn(r,"path");if(!s)throw new Error(`文件 ${n+1} 缺少 path`);const i=p5(r,"size");if(i===void 0)throw new Error(`文件 ${n+1} 缺少 size`);return{path:s,size:i}}):[]}function T0e(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 A0e(e){if(e===void 0)return[];if(!Array.isArray(e))throw new Error("Skill 生成活动记录格式错误");return e.map((t,n)=>{const r=Qo(t,`活动 ${n+1}`),s=nn(r,"id"),i=nn(r,"kind"),a=nn(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 c=nn(r,"name");if(!c)throw new Error(`活动 ${n+1} 缺少工具名称`);return{id:s,kind:i,name:c,args:r.input,response:r.output,status:a}}const o=nn(r,"text");if(!o)throw new Error(`活动 ${n+1} 缺少文本`);return{id:s,kind:i,text:o,status:a}})}function C0e(e,t){const n=Qo(e,`候选方案 ${t+1}`),r=nn(n,"id","candidate_id","candidateId"),s=nn(n,"model","model_id","modelId");if(!r||!s)throw new Error(`候选方案 ${t+1} 缺少 id 或 model`);return{id:r,model:s,modelLabel:nn(n,"modelLabel","model_label")??s,status:k0e(n.status),stage:N0e(n.stage),name:nn(n,"name","skill_name","skillName"),description:nn(n,"description"),skillMd:nn(n,"skillMd","skill_md"),files:S0e(n.files),activities:A0e(n.activities),validation:T0e(n.validation),durationMs:p5(n,"elapsedMs","elapsed_ms"),error:nn(n,"error","error_message","errorMessage"),published:n.published===!0,skillId:nn(n,"skill_id","skillId"),version:nn(n,"version")}}function ex(e,t=""){const n=Qo(e,"Skill 创建任务"),r=nn(n,"id","job_id","jobId");if(!r)throw new Error("Skill 创建任务缺少 id");const s=Array.isArray(n.candidates)?n.candidates.map(C0e):[],i=nn(n,"status")??"running";if(i!=="provisioning"&&i!=="running"&&i!=="completed")throw new Error(`未知的 Skill 任务状态:${i}`);return{id:r,prompt:nn(n,"prompt")??t,status:i,candidates:s}}async function I0e(e,t){const n=await Zf("/jobs",{method:"POST",body:JSON.stringify({prompt:e})});if(!n.ok)throw new p_(await m_(n,"创建 Skill 任务失败"),n.status);const r=n.headers.get("content-type")??"";if(r.includes("application/json")){const u=ex(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 c=u=>{if(!u.trim())return;const d=Qo(JSON.parse(u),"Skill 创建进度");if(d.type==="error")throw new Error(nn(d,"error")??"创建 Skill 任务失败");if(d.type!=="progress"&&d.type!=="complete")throw new Error("未知的 Skill 创建进度事件");o=ex(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(c),u)break}if(c(a),!o)throw new Error("创建 Skill 任务失败:服务端未返回任务");return o}async function O0e(e){const t=await Zf(`/jobs/${encodeURIComponent(e)}`);return ex(await g_(t,"读取 Skill 任务失败"))}async function R0e(e){const t=await Zf(`/jobs/${encodeURIComponent(e)}`,{method:"DELETE"});await g_(t,"清理 Skill 任务失败")}async function L0e(e,t){var o;const n=await Zf(`/jobs/${encodeURIComponent(e)}/candidates/${encodeURIComponent(t)}/download`);if(!n.ok)throw new Error(await m_(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 M0e(e,t,n){const r=await Zf(`/jobs/${encodeURIComponent(e)}/candidates/${encodeURIComponent(t)}/publish`,{method:"POST",body:JSON.stringify(n)}),s=Qo(await g_(r,"添加到 AgentKit 失败"),"发布结果"),i=nn(s,"skill_id","skillId","id");if(!i)throw new Error("发布结果缺少 skill_id");return{skillId:i,name:nn(s,"name"),version:nn(s,"version"),skillSpaceIds:Array.isArray(s.skillSpaceIds)?s.skillSpaceIds.map(String):Array.isArray(s.skill_space_ids)?s.skill_space_ids.map(String):[],message:nn(s,"message")}}const j0e=()=>{};function D0e(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 P0e({activities:e}){const t=w.useMemo(()=>e.filter(n=>n.kind!=="status").map(D0e),[e]);return t.length===0?null:l.jsx("div",{className:"skill-conversation","aria-label":"Skill 生成对话","aria-live":"polite",children:l.jsx(Xv,{blocks:t,onAction:j0e})})}const yC={provisioning:"正在准备 Sandbox",generating:"正在生成 Skill",validating:"正在校验结构",packaging:"正在打包",completed:"生成完成",failed:"生成失败"},bC=12e4;function B0e({status:e}){return e==="succeeded"?l.jsxs("svg",{viewBox:"0 0 20 20","aria-hidden":"true",children:[l.jsx("circle",{cx:"10",cy:"10",r:"7"}),l.jsx("path",{d:"m6.7 10.1 2.1 2.2 4.6-4.8"})]}):e==="failed"?l.jsxs("svg",{viewBox:"0 0 20 20","aria-hidden":"true",children:[l.jsx("circle",{cx:"10",cy:"10",r:"7"}),l.jsx("path",{d:"M10 6.2v4.5M10 13.6h.01"})]}):l.jsxs("svg",{className:"skill-candidate__spinner",viewBox:"0 0 20 20","aria-hidden":"true",children:[l.jsx("circle",{cx:"10",cy:"10",r:"7"}),l.jsx("path",{d:"M10 3a7 7 0 0 1 7 7"})]})}function F0e(){return l.jsxs("svg",{viewBox:"0 0 20 20","aria-hidden":"true",children:[l.jsx("path",{d:"M4.2 3.5h7.1l4.5 4.6v8.4H4.2z"}),l.jsx("path",{d:"M11.3 3.5v4.6h4.5M7 11h6M7 13.8h4.2"})]})}function U0e(){return l.jsx("svg",{viewBox:"0 0 20 20","aria-hidden":"true",children:l.jsx("path",{d:"m9 5-5 5 5 5M4.5 10H16"})})}function $0e({candidate:e}){var c,u;const[t,n]=w.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=(c=e.skillMd)==null?void 0:c.slice(0,bC),o=(((u=e.skillMd)==null?void 0:u.length)??0)>bC;return s.length===0?null:l.jsxs("div",{className:"skill-files",children:[l.jsx("div",{className:"skill-files__tabs",role:"tablist","aria-label":`${e.name??"Skill"} 文件`,children:s.map(d=>l.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"))?l.jsxs(l.Fragment,{children:[l.jsx("pre",{className:"skill-files__content",children:l.jsx("code",{children:a})}),o?l.jsx("p",{className:"skill-files__truncated",children:"预览内容较长,完整文件请下载 ZIP 查看。"}):null]}):l.jsx("div",{className:"skill-files__unavailable",children:i?`${i.path} · ${i.size.toLocaleString()} bytes`:"文件内容将在下载包中提供"})]})}function H0e({label:e,jobId:t,candidate:n,selected:r,publishing:s,publishDisabled:i,publishError:a,onSelect:o,onPublish:c}){const[u,d]=w.useState("conversation"),[f,h]=w.useState(!1),[p,m]=w.useState(!1),[y,E]=w.useState(""),[g,x]=w.useState(""),[b,_]=w.useState(""),[k,N]=w.useState(""),C=w.useRef(null),S=w.useRef(null),A=n.status==="queued"||n.status==="running",O=n.status==="succeeded",D=n.validation;return l.jsxs("article",{className:`skill-candidate skill-candidate--${n.status}${r?" is-selected":""}`,"aria-label":`${e} ${n.model}`,children:[l.jsxs("header",{className:"skill-candidate__header",children:[l.jsx("h2",{children:n.model}),r?l.jsx("span",{className:"skill-candidate__selected",children:"已选方案"}):null]}),u==="conversation"?l.jsxs("div",{className:"skill-candidate__view skill-candidate__view--conversation",children:[l.jsxs("div",{className:"skill-candidate__status","aria-live":"polite",children:[l.jsx("span",{className:"skill-candidate__status-icon",children:l.jsx(B0e,{status:n.status})}),A?l.jsx(na,{duration:2.2,spread:16,children:yC[n.stage]}):l.jsx("span",{children:yC[n.stage]}),n.durationMs!==void 0&&O?l.jsxs("span",{className:"skill-candidate__duration",children:[(n.durationMs/1e3).toFixed(1)," 秒"]}):null]}),l.jsx(P0e,{activities:n.activities}),n.error?l.jsx("div",{className:"skill-candidate__error",children:n.error}):null,O?l.jsx("div",{className:"skill-candidate__view-actions",children:l.jsxs("button",{ref:C,type:"button",className:"skill-action skill-action--preview",onClick:()=>{d("preview"),requestAnimationFrame(()=>{var F;return(F=S.current)==null?void 0:F.focus()})},children:[l.jsx(F0e,{}),"查看 Skill"]})}):null]}):l.jsxs("div",{className:"skill-candidate__view skill-candidate__view--preview",children:[l.jsx("div",{className:"skill-candidate__preview-nav",children:l.jsxs("button",{ref:S,type:"button",className:"skill-candidate__back",onClick:()=>{d("conversation"),requestAnimationFrame(()=>{var F;return(F=C.current)==null?void 0:F.focus()})},children:[l.jsx(U0e,{}),"返回对话"]})}),l.jsxs("div",{className:"skill-candidate__result",children:[l.jsxs("div",{className:"skill-candidate__summary",children:[l.jsxs("div",{children:[l.jsx("span",{children:"Skill"}),l.jsx("strong",{children:n.name??"未命名 Skill"})]}),l.jsxs("div",{children:[l.jsx("span",{children:"文件"}),l.jsx("strong",{children:n.files.length})]}),l.jsxs("div",{children:[l.jsx("span",{children:"校验"}),l.jsx("strong",{className:(D==null?void 0:D.valid)===!1?"is-invalid":"is-valid",children:(D==null?void 0:D.valid)===!1?"未通过":"已通过"})]})]}),n.description?l.jsx("p",{className:"skill-candidate__description",children:n.description}):null,D&&(D.errors.length>0||D.warnings.length>0)?l.jsxs("details",{className:"skill-validation",children:[l.jsx("summary",{children:"查看校验详情"}),[...D.errors,...D.warnings].map((F,X)=>l.jsx("div",{children:F},`${F}-${X}`))]}):null,l.jsx($0e,{candidate:n}),l.jsxs("div",{className:"skill-candidate__actions",children:[l.jsx("button",{type:"button",className:"skill-action skill-action--select","aria-pressed":r,onClick:o,children:r?"已采用此方案":"采用此方案"}),l.jsx("button",{type:"button",className:"skill-action",disabled:p,onClick:()=>{m(!0),E(""),L0e(t,n.id).catch(F=>{E(F instanceof Error?F.message:String(F))}).finally(()=>m(!1))},children:p?"正在下载…":"下载 ZIP"}),l.jsx("button",{type:"button",className:"skill-action",disabled:!r||s||i||n.published,title:r?void 0:"请先采用此方案",onClick:()=>h(F=>!F),children:n.published?"已添加到 AgentKit":s?"正在添加…":"添加到 AgentKit"})]}),y?l.jsx("div",{className:"skill-candidate__error",children:y}):null,f&&r&&!n.published?l.jsxs("form",{className:"skill-publish-form",onSubmit:F=>{F.preventDefault();const X=g.split(",").map(L=>L.trim()).filter(Boolean);c({skillSpaceIds:X,...b.trim()?{projectName:b.trim()}:{},...k.trim()?{skillId:k.trim()}:{}})},children:[l.jsxs("label",{children:[l.jsx("span",{children:"SkillSpace ID(可选)"}),l.jsx("input",{value:g,onChange:F=>x(F.target.value),placeholder:"多个 ID 用英文逗号分隔"})]}),l.jsxs("div",{className:"skill-publish-form__optional",children:[l.jsxs("label",{children:[l.jsx("span",{children:"项目名称(可选)"}),l.jsx("input",{value:b,onChange:F=>_(F.target.value)})]}),l.jsxs("label",{children:[l.jsx("span",{children:"已有 Skill ID(可选)"}),l.jsx("input",{value:k,onChange:F=>N(F.target.value)})]})]}),l.jsx("button",{type:"submit",className:"skill-action skill-action--select",disabled:s,children:s?"正在添加…":"确认添加"})]}):null,a?l.jsx("div",{className:"skill-candidate__error",children:a}):null]})]})]})}const EC=new Set(["completed"]),dp=1100,z0e=3e4;function V0e(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 K0e({initialJob:e}){const[t,n]=w.useState(e),[r,s]=w.useState(""),[i,a]=w.useState(!1),[o,c]=w.useState(),[u,d]=w.useState(),[f,h]=w.useState(()=>new Set),[p,m]=w.useState({});w.useEffect(()=>{n(e),s(""),a(!1)},[e]),w.useEffect(()=>{if(EC.has(e.status)||e.id.startsWith("pending-"))return;let g=!1,x;const b=Date.now()+z0e,_=async()=>{try{const k=await O0e(e.id);g||(n({...k,prompt:k.prompt||e.prompt}),s(""),EC.has(k.status)||(x=window.setTimeout(_,dp)))}catch(k){if(!g){const N=k instanceof p_?k:void 0;if((N==null?void 0:N.status)===404&&Date.now(){g=!0,x!==void 0&&window.clearTimeout(x)}},[e.id,e.status]);const y=Qv.map((g,x)=>t.candidates.find(b=>b.model===g)??t.candidates[x]??V0e(g,x));async function E(g,x){d(g.id),m(b=>({...b,[g.id]:""}));try{await M0e(t.id,g.id,x),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 l.jsxs("section",{className:"skill-workspace",children:[l.jsx("header",{className:"skill-workspace__intro",children:l.jsx("h1",{children:"正在把需求变成可运行的 Skill"})}),r?l.jsxs("div",{className:"skill-workspace__poll-error",role:"alert",children:["状态刷新失败:",r,"。",i?"":"页面会继续重试。"]}):null,l.jsx("div",{className:"skill-workspace__grid",children:y.map((g,x)=>{const _=f.has(g.id)||g.published?{...g,published:!0}:g;return l.jsx(H0e,{label:`方案 ${x===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:()=>c(g.id),onPublish:k=>void E(g,k)},`${g.model}-${g.id}`)})})]})}const Nb="/web/sandbox/sessions",Y0e=33e4,G0e=6e5,W0e=15e3;function Sb(e){const t=Mg(e);return t.set("Accept","application/json"),t}async function Tb(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 q0e(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 c(){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}),c()}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,c()}function f(h){let p="message";const m=[];for(const E of h.split(/\r?\n/))E.startsWith("event:")&&(p=E.slice(6).trim()),E.startsWith("data:")&&m.push(E.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 Ab={async startSession(e={}){const t=await fetch(xi(Nb),{method:"POST",headers:Sb({"Content-Type":"application/json"}),signal:Ws(e.signal,Y0e)});if(!t.ok)throw await Tb(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(xi(`${Nb}/${encodeURIComponent(e.sessionId)}/messages`),{method:"POST",headers:Sb({Accept:"text/event-stream","Content-Type":"application/json"}),body:JSON.stringify({message:e.text}),signal:Ws(t.signal,G0e)});if(!n.ok)throw await Tb(n,"沙箱对话失败,请稍后重试。");return q0e(n,t.onBlocks)},async closeSession(e,t={}){if(!e)return;const n=await fetch(xi(`${Nb}/${encodeURIComponent(e)}`),{method:"DELETE",headers:Sb(),signal:Ws(t.signal,W0e)});if(!n.ok&&n.status!==404)throw await Tb(n,"无法清理 AgentKit 沙箱会话。")}},X0e=1e4;async function m5(e){const t=await fetch(xi(e),{headers:Mg({Accept:"application/json"}),signal:Ws(void 0,X0e)});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 Q0e(){return m5("/web/sandbox/capabilities")}async function Z0e(){return m5("/web/skill-creator/capabilities")}function J0e(e){return l.jsxs("svg",{viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"1.75",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",...e,children:[l.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"}),l.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"}),l.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 eye({open:e,state:t,error:n,onCancel:r,onConfirm:s}){const i=w.useRef(null),a=w.useRef(null);if(w.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 E;if(h.key==="Escape"){h.preventDefault(),r();return}if(h.key!=="Tab")return;const p=(E=i.current)==null?void 0:E.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",c=o?"正在初始化沙箱":t==="error"?"启动失败":"启用 Codex 智能体";return Ns.createPortal(l.jsx("div",{className:"sandbox-dialog-backdrop",onMouseDown:u=>{u.target===u.currentTarget&&!o&&r()},children:l.jsxs("section",{ref:i,className:"sandbox-dialog",role:"dialog","aria-modal":"true","aria-labelledby":"sandbox-dialog-title","aria-describedby":"sandbox-dialog-description",children:[l.jsxs("div",{className:"sandbox-dialog-visual","aria-hidden":"true",children:[l.jsx("span",{className:"sandbox-dialog-orbit"}),l.jsx("span",{className:"sandbox-dialog-icon",children:o?l.jsx("span",{className:"sandbox-spinner"}):l.jsx(J0e,{})})]}),l.jsxs("div",{className:"sandbox-dialog-copy",children:[l.jsx("h2",{id:"sandbox-dialog-title",children:c}),t==="error"?l.jsx("p",{id:"sandbox-dialog-description",className:"sandbox-dialog-error",role:"alert",children:n||"AgentKit 沙箱初始化失败,请稍后重新尝试。"}):o?l.jsx("p",{id:"sandbox-dialog-description","aria-live":"polite",children:"正在寻找可用工具并创建内置智能体会话,通常需要一点时间。"}):l.jsx("p",{id:"sandbox-dialog-description",children:"将启动 AgentKit 沙箱与 Codex 智能体,本次对话不会被持久化保存。"})]}),l.jsxs("footer",{className:"sandbox-dialog-actions",children:[l.jsx("button",{ref:a,type:"button",onClick:r,children:o?"取消启动":"取消"}),!o&&l.jsx("button",{type:"button",className:"is-primary",onClick:s,children:t==="error"?"重新尝试":"确认开启"})]})]})}),document.body)}function tye({onExit:e}){return l.jsxs("div",{className:"sandbox-session-warning",role:"status",children:[l.jsx("span",{className:"sandbox-session-warning-dot","aria-hidden":"true"}),l.jsx("span",{className:"sandbox-session-warning-copy",children:"当前为 Codex 智能体会话,退出后对话内容消失"}),l.jsx("button",{type:"button",onClick:e,children:"退出内置智能体"})]})}function nye({filled:e=!1,...t}){return l.jsxs("svg",{viewBox:"0 0 24 24",fill:e?"currentColor":"none",stroke:"currentColor",strokeWidth:"1.75",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",...t,children:[l.jsx("rect",{x:"3.5",y:"9.3",width:"4.5",height:"10.2",rx:"1.5"}),l.jsx("path",{d:"M8 10.2 11.3 4.8c.5-.8 1.7-.45 1.7.5v3.8h4.2a2.1 2.1 0 0 1 2.04 2.6l-1.4 5.75A2.1 2.1 0 0 1 15.8 19H8"})]})}function rye({filled:e=!1,...t}){return l.jsxs("svg",{viewBox:"0 0 24 24",fill:e?"currentColor":"none",stroke:"currentColor",strokeWidth:"1.75",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",...t,children:[l.jsx("rect",{x:"3.5",y:"4.5",width:"4.5",height:"10.2",rx:"1.5"}),l.jsx("path",{d:"M8 13.8 11.3 19.2c.5.8 1.7.45 1.7-.5v-3.8h4.2a2.1 2.1 0 0 0 2.04-2.6l-1.4-5.75A2.1 2.1 0 0 0 15.8 5H8"})]})}const xC=["#6366f1","#0ea5e9","#10b981","#f59e0b","#f43f5e","#a855f7","#14b8a6","#f472b6"];function Cb(e){let t=0;for(let n=0;n>>0;return xC[t%xC.length]}function sye(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,c=e.length?Math.max(...e.map(u=>u.end_time)):1;return{rootNodes:a,min:o,total:c-o||1}}function iye(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 wC(e){const t=e/1e6;return t>=1e3?`${(t/1e3).toFixed(2)} s`:`${t.toFixed(t<10?2:1)} ms`}const aye=e=>e.replace(/^(gen_ai|a2ui|adk)\./,"");function vC(e){return Object.entries(e.attributes).filter(([,t])=>t!=null&&typeof t!="object").map(([t,n])=>{const r=String(n);return{key:aye(t),value:r,long:r.length>80||r.includes(` +`)}}).sort((t,n)=>Number(t.long)-Number(n.long))}function oye({appName:e,sessionId:t,onClose:n}){const[r,s]=w.useState(null),[i,a]=w.useState(""),[o,c]=w.useState(new Set),[u,d]=w.useState(null);w.useEffect(()=>{s(null),a(""),qL(e,t).then(x=>{s(x),d(x.length?x.reduce((b,_)=>b.start_time<=_.start_time?b:_).span_id:null)}).catch(x=>a(String(x)))},[e,t]);const{rootNodes:f,min:h,total:p}=w.useMemo(()=>sye(r??[]),[r]),m=w.useMemo(()=>iye(f,o),[f,o]),y=(r==null?void 0:r.find(x=>x.span_id===u))??null,E=p/1e6,g=x=>c(b=>{const _=new Set(b);return _.has(x)?_.delete(x):_.add(x),_});return l.jsxs(l.Fragment,{children:[l.jsx("div",{className:"drawer-scrim",onClick:n}),l.jsxs("aside",{className:"drawer drawer--trace",children:[l.jsxs("header",{className:"drawer-head",children:[l.jsxs("div",{children:[l.jsx("div",{className:"drawer-title",children:"调用链路观测"}),l.jsx("div",{className:"drawer-sub",children:r?`${r.length} 个调用 · ${E.toFixed(1)} ms`:"加载中"})]}),l.jsx("button",{className:"drawer-close",onClick:n,"aria-label":"关闭",children:l.jsx(Hr,{className:"icon"})})]}),r==null&&!i&&l.jsxs("div",{className:"drawer-loading",children:[l.jsx(Mt,{className:"icon spin"})," 加载调用链路…"]}),i&&l.jsx("div",{className:"error",children:i}),r&&r.length===0&&l.jsx("div",{className:"drawer-empty",children:"该会话暂无调用链路(可能尚未产生调用)。"}),m.length>0&&l.jsxs("div",{className:"trace-split",children:[l.jsx("div",{className:"trace-tree scroll",children:m.map(x=>{const b=x.span,_=(b.start_time-h)/p*100,k=Math.max((b.end_time-b.start_time)/p*100,.6),N=x.children.length>0;return l.jsxs("button",{className:`trace-row ${u===b.span_id?"active":""}`,onClick:()=>d(b.span_id),children:[l.jsxs("span",{className:"trace-label",style:{paddingLeft:x.depth*14},children:[l.jsx("span",{className:`trace-caret ${N?"":"hidden"} ${o.has(b.span_id)?"":"open"}`,onClick:C=>{C.stopPropagation(),N&&g(b.span_id)},children:l.jsx(xs,{className:"chev"})}),l.jsx("span",{className:"trace-dot",style:{background:Cb(b.name)}}),l.jsx("span",{className:"trace-name",title:b.name,children:b.name})]}),l.jsx("span",{className:"trace-dur",children:wC(b.end_time-b.start_time)}),l.jsx("span",{className:"trace-track",children:l.jsx("span",{className:"trace-bar",style:{left:`${_}%`,width:`${k}%`,background:Cb(b.name)}})})]},b.span_id)})}),l.jsx("div",{className:"trace-detail scroll",children:y?l.jsxs(l.Fragment,{children:[l.jsx("div",{className:"td-title",children:y.name}),l.jsxs("div",{className:"td-dur",children:[l.jsx("span",{className:"td-dot",style:{background:Cb(y.name)}}),wC(y.end_time-y.start_time)]}),l.jsx("div",{className:"td-section",children:"属性"}),l.jsx("div",{className:"td-props",children:vC(y).filter(x=>!x.long).map(x=>l.jsxs("div",{className:"td-prop",children:[l.jsx("span",{className:"td-key",children:x.key}),l.jsx("span",{className:"td-val",children:x.value})]},x.key))}),vC(y).filter(x=>x.long).map(x=>l.jsxs("div",{className:"td-block",children:[l.jsx("div",{className:"td-section",children:x.key}),l.jsx("pre",{className:"td-pre",children:x.value})]},x.key))]}):l.jsx("div",{className:"drawer-empty",children:"选择左侧的一个调用查看详情"})})]})]})]})}function lye(e){return e.toLowerCase()==="github"?l.jsx(jH,{className:"icon"}):l.jsx($H,{className:"icon"})}function cye({branding:e,onUsername:t}){const[n,r]=w.useState(null),[s,i]=w.useState(""),[a,o]=w.useState(0),[c,u]=w.useState(""),d=w.useRef(null);w.useEffect(()=>{let m=!0;return r(null),i(""),BL().then(y=>{m&&r(y)}).catch(y=>{m&&i(y instanceof Error?y.message:String(y))}),()=>{m=!1}},[a]);const f=n!==null&&n.length===0;w.useEffect(()=>{var m;f&&((m=d.current)==null||m.focus())},[f]);const h=oz.test(c),p=()=>{h&&t(c)};return l.jsxs("div",{className:"login",children:[l.jsx("header",{className:"login-top",children:l.jsxs("span",{className:"login-brand",children:[l.jsx("img",{className:"login-brand-logo",src:e.logoUrl||Yw,width:20,height:20,alt:"","aria-hidden":!0}),e.title]})}),l.jsx("main",{className:"login-main",children:l.jsxs("div",{className:"login-card",children:[l.jsx(na,{as:"h1",className:"login-title",duration:4.8,spread:22,children:e.title}),s?l.jsxs("div",{className:"login-provider-error",role:"alert",children:[l.jsx("p",{children:s}),l.jsx("button",{type:"button",onClick:()=>o(m=>m+1),children:"重试"})]}):n===null?null:n.length>0?l.jsxs(l.Fragment,{children:[l.jsx("p",{className:"login-sub",children:"登录以继续使用"}),l.jsx("div",{className:"login-providers",children:n.map(m=>l.jsxs("button",{className:"login-btn",onClick:()=>cz(m.loginUrl),children:[lye(m.id),l.jsxs("span",{children:["使用 ",m.label," 登录"]})]},m.id))})]}):l.jsxs(l.Fragment,{children:[l.jsx("p",{className:"login-sub",children:"输入一个用户名即可开始"}),l.jsxs("form",{className:"login-name",onSubmit:m=>{m.preventDefault(),p()},children:[l.jsx("input",{ref:d,className:"login-name-input",value:c,onChange:m=>u(m.target.value),placeholder:"用户名(字母 + 数字,最多 16 位)",maxLength:16}),l.jsx("button",{type:"submit",className:"login-name-go",disabled:!h,"aria-label":"进入",children:l.jsx(ld,{className:"icon"})})]}),l.jsx("p",{className:"login-hint","aria-live":"polite",children:c&&!h?"只能包含大小写字母和数字,最多 16 位。":""})]}),l.jsx("p",{className:"login-powered",children:"火山引擎 AgentKit 提供企业级 Agent 解决方案"}),l.jsxs("p",{className:"login-legal",children:["继续即表示你已阅读并同意 AgentKit"," ",l.jsx("a",{href:"https://docs.volcengine.com/docs/86681/1925174?lang=zh",target:"_blank",rel:"noreferrer",children:"产品和服务条款"})]})]})}),l.jsx("footer",{className:"login-footer",children:"© 2026 VeADK. All rights reserved."})]})}function uye({open:e,checking:t,error:n,onLogin:r}){const s=w.useRef(null);return w.useEffect(()=>{var a;if(!e)return;const i=document.body.style.overflow;return document.body.style.overflow="hidden",(a=s.current)==null||a.focus(),()=>{document.body.style.overflow=i}},[e]),e?Ns.createPortal(l.jsx("div",{className:"auth-expired-backdrop",children:l.jsxs("section",{className:"auth-expired-dialog",role:"alertdialog","aria-modal":"true","aria-labelledby":"auth-expired-title","aria-describedby":"auth-expired-description",children:[l.jsx("div",{className:"auth-expired-mark","aria-hidden":"true",children:l.jsx(Rg,{})}),l.jsxs("div",{className:"auth-expired-copy",children:[l.jsx("h2",{id:"auth-expired-title",children:"登录状态已过期"}),l.jsx("p",{id:"auth-expired-description",children:"当前编辑内容会保留。重新登录后,刚才的操作将自动继续。"}),n&&l.jsx("p",{className:"auth-expired-error",role:"alert",children:n})]}),l.jsx("footer",{className:"auth-expired-actions",children:l.jsx("button",{ref:s,type:"button",onClick:r,disabled:t,children:t?"等待登录完成…":"重新登录"})})]})}),document.body):null}function dye({node:e,ctx:t}){const n=e.variant??"default";return l.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)})}Xo("Button",dye);function fye({node:e,ctx:t}){return l.jsx("div",{className:"a2ui-card","data-a2ui-id":e.id,"data-a2ui-component":e.component,children:t.render(e.child)})}Xo("Card",fye);const hye={start:"flex-start",center:"center",end:"flex-end",spaceBetween:"space-between",spaceAround:"space-around",spaceEvenly:"space-evenly",stretch:"stretch"},pye={start:"flex-start",center:"center",end:"flex-end",stretch:"stretch"};function g5(e){return hye[e]??"flex-start"}function y5(e){return pye[e]??"stretch"}function mye({node:e,ctx:t}){const n=e.children??[];return l.jsx("div",{className:"a2ui-column","data-a2ui-id":e.id,"data-a2ui-component":e.component,style:{display:"flex",flexDirection:"column",justifyContent:g5(e.justify),alignItems:y5(e.align)},children:n.map(r=>t.render(r))})}Xo("Column",mye);function gye({node:e}){const t=e.axis==="vertical";return l.jsx("div",{className:`a2ui-divider ${t?"a2ui-divider--v":"a2ui-divider--h"}`,"data-a2ui-id":e.id,"data-a2ui-component":e.component})}Xo("Divider",gye);const yye={send:"✈️",check:"✅",close:"✖️",star:"⭐",favorite:"❤️",info:"ℹ️",help:"❓",error:"⛔",calendarToday:"📅",event:"📅",schedule:"🕒",locationOn:"📍",accountCircle:"👤",mail:"✉️",call:"📞",home:"🏠",settings:"⚙️",search:"🔍"};function bye({node:e}){const t=e.name??"";return l.jsx("span",{className:"a2ui-icon",title:t,"aria-label":t,"data-a2ui-id":e.id,"data-a2ui-component":e.component,children:yye[t]??"•"})}Xo("Icon",bye);function Eye({node:e,ctx:t}){const n=e.children??[];return l.jsx("div",{className:"a2ui-row","data-a2ui-id":e.id,"data-a2ui-component":e.component,style:{display:"flex",flexDirection:"row",justifyContent:g5(e.justify),alignItems:y5(e.align??"center")},children:n.map(r=>t.render(r))})}Xo("Row",Eye);const xye=new Set(["h1","h2","h3","h4","h5"]);function wye({node:e,ctx:t}){const n=e.variant??"body",r=t.resolveString(e.text),s=xye.has(n)?n:"p";return l.jsx(s,{className:`a2ui-text a2ui-text--${n}`,"data-a2ui-id":e.id,"data-a2ui-component":e.component,children:r})}Xo("Text",wye);const vye="创建 Agent",_ye={intelligent:"智能模式",custom:"自定义",template:"从模板新建",workflow:"工作流",package:"代码包部署"},vl={app:"veadk.appName",view:"veadk.view",session:"veadk.sessionId"},kye=new Set,Nye=[];function Pi(){return{skills:[]}}function co(e){return`veadk.agentDrafts.${encodeURIComponent(e)}`}function Ib(e){return`${co(e)}.active`}function tx(e){return`veadk.agentOrder.${encodeURIComponent(e)}`}function Sye(e){if(!e)return[];try{const t=JSON.parse(localStorage.getItem(co(e))||"[]");return Array.isArray(t)?t:[]}catch{return[]}}function Tye(e){if(!e)return[];try{const t=JSON.parse(localStorage.getItem(tx(e))||"[]");return Array.isArray(t)?t.filter(n=>typeof n=="string"):[]}catch{return[]}}function nx(e,t){if(e.name===t||e.id===t)return e;for(const n of e.children){const r=nx(n,t);if(r)return r}}function b5(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(...b5(n)));return t}function _C(){const e=typeof localStorage<"u"?localStorage.getItem(vl.view):null;return e==="menu"||e==="intelligent"||e==="custom"||e==="template"||e==="workflow"?e:null}function Aye({className:e}){return l.jsxs("svg",{className:e,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"1.7",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":!0,children:[l.jsx("ellipse",{cx:"12",cy:"12",rx:"6.6",ry:"8.2"}),l.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 Cye(){return l.jsxs("svg",{viewBox:"0 0 24 24",width:"14",height:"14",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round","aria-hidden":!0,children:[l.jsx("rect",{x:"3",y:"4",width:"14",height:"3.2",rx:"1.2",fill:"currentColor",stroke:"none"}),l.jsx("rect",{x:"6",y:"10.4",width:"13",height:"3.2",rx:"1.2",fill:"currentColor",stroke:"none",opacity:"0.7"}),l.jsx("rect",{x:"9",y:"16.8",width:"9",height:"3.2",rx:"1.2",fill:"currentColor",stroke:"none",opacity:"0.45"})]})}function E5(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 Iye(e){if(!e)return"";const t=[];return e.ts&&t.push(E5(e.ts)),e.tokens!=null&&t.push(`${e.tokens.toLocaleString()} tokens`),t.join(" · ")}function kC(e){return e.blocks.map(t=>t.kind==="text"?t.text:"").join("").trim()}const Oye="send_a2ui_json_to_client";function Rye(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===Oye&&t.done):t.kind==="agent-transfer"?!1:t.kind==="a2ui"?$4(t.messages).some(n=>n.components[n.rootId]):t.kind==="auth")}function Lye(e){return e.blocks.some(t=>t.kind==="auth"&&!t.done)}function Mye(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",c)},o=d=>{if(!i){i=!0,a();try{s.close()}catch{}t(d)}},c=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",c);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 jye(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 NC({text:e}){const[t,n]=w.useState(!1);return l.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?l.jsx(Js,{className:"icon"}):l.jsx(Ow,{className:"icon"})})}function Dye(e){return e==="cn-beijing"?"华北 2(北京)":e==="cn-shanghai"?"华东 2(上海)":e||"未指定"}function Pye({tasks:e,onCancel:t}){const[n,r]=w.useState(!1),[s,i]=w.useState(null),a=e.filter(f=>f.status==="running").length,o=e[0],c=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 l.jsxs("div",{className:"global-deploy-center",children:[l.jsxs("button",{type:"button",className:`global-deploy-task is-${c}`,"aria-expanded":n,"aria-haspopup":"dialog",onClick:()=>r(f=>!f),children:[c==="running"?l.jsx(Mt,{className:"global-deploy-task-icon spin"}):c==="success"?l.jsx(NL,{className:"global-deploy-task-icon"}):c==="error"?l.jsx(Rg,{className:"global-deploy-task-icon"}):c==="cancelled"?l.jsx(V1,{className:"global-deploy-task-icon"}):l.jsx(UH,{className:"global-deploy-task-icon"}),l.jsx("span",{className:"global-deploy-task-detail",children:u}),l.jsx(Cw,{className:`global-deploy-task-chevron${n?" is-open":""}`})]}),n&&l.jsxs(l.Fragment,{children:[l.jsx("button",{type:"button",className:"global-deploy-task-scrim","aria-label":"关闭部署任务",onClick:()=>r(!1)}),l.jsxs("section",{className:"global-deploy-popover",role:"dialog","aria-label":"部署任务",children:[l.jsxs("header",{className:"global-deploy-popover-head",children:[l.jsx("span",{children:"部署任务"}),l.jsx("span",{children:e.length})]}),l.jsx("div",{className:"global-deploy-list",children:e.length===0?l.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 l.jsxs("article",{className:`global-deploy-item is-${f.status}`,children:[l.jsxs("div",{className:"global-deploy-item-head",children:[l.jsx("span",{className:"global-deploy-runtime-name",children:f.runtimeName}),l.jsx("span",{className:"global-deploy-status",children:h})]}),l.jsxs("dl",{className:"global-deploy-meta",children:[l.jsxs("div",{children:[l.jsx("dt",{children:"Runtime 名称"}),l.jsx("dd",{children:f.runtimeName})]}),l.jsxs("div",{children:[l.jsx("dt",{children:"部署地域"}),l.jsx("dd",{children:Dye(f.region)})]}),f.runtimeId&&l.jsxs("div",{children:[l.jsx("dt",{children:"Runtime ID"}),l.jsx("dd",{children:f.runtimeId})]})]}),f.message&&f.status==="error"?l.jsx(sg,{className:"global-deploy-error",message:f.message,onRetry:f.retry}):f.message?l.jsx("p",{className:"global-deploy-message",children:f.message}):null,f.status==="running"&&l.jsxs(l.Fragment,{children:[l.jsx("div",{className:"global-deploy-progress","aria-hidden":!0,children:l.jsx("span",{style:{width:`${Math.max(6,Math.min(100,f.pct??6))}%`}})}),l.jsx("div",{className:"global-deploy-item-actions",children:l.jsx("button",{type:"button",disabled:s===f.id,onClick:()=>d(f),children:s===f.id?"取消中…":"取消部署"})})]})]},f.id)})})]})]})]})}const SC=["今天想做点什么?","有什么可以帮你的?","需要我帮你查点什么吗?","有问题尽管问我","嗨,我们开始吧","开始一段新对话吧","今天想先解决哪件事?","把你的想法告诉我吧","我们从哪里开始?","有什么任务交给我?","准备好一起推进了吗?","说说你现在最关心的问题","今天也一起把事情做好","我在,随时可以开始"],TC=()=>SC[Math.floor(Math.random()*SC.length)];function Ob(e){var t;for(const n of e)(t=n.previewUrl)!=null&&t.startsWith("blob:")&&URL.revokeObjectURL(n.previewUrl)}function Bye(){return`draft-${Date.now()}-${Math.random().toString(36).slice(2)}`}function Fye(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 Uye(){const[e,t]=w.useState([]),[n,r]=w.useState(""),[s,i]=w.useState([]),[a,o]=w.useState(""),c=w.useRef(null),[u,d]=w.useState(!1),[f,h]=w.useState([]),[p,m]=w.useState(null),[y,E]=w.useState([]),[g,x]=w.useState(!1),[b,_]=w.useState(!1),[k,N]=w.useState("confirm"),[C,S]=w.useState(""),A=w.useRef(null),O=w.useRef(null),[D,F]=w.useState({}),X=a?D[a]??[]:f,L=p?y:X,j=(U,K)=>F(ae=>({...ae,[U]:typeof K=="function"?K(ae[U]??[]):K})),[T,R]=w.useState(""),[M,B]=w.useState("agent"),[I,V]=w.useState({}),[G,P]=w.useState(null),[ie,q]=w.useState(!1),ne=w.useRef(0),[oe,ee]=w.useState([]),[ce,re]=w.useState(Pi),[pe,ye]=w.useState(null),[J,fe]=w.useState(!1),[Ee,Te]=w.useState(null),[Ge,ke]=w.useState(!1),[rt,ze]=w.useState([]),[We,yt]=w.useState(!1),at=w.useRef(new Set),[St,Tt]=w.useState(()=>new Set),[H,Z]=w.useState(()=>new Set),le=w.useRef(new Map),be=w.useRef(new Map),Le=(U,K)=>Tt(ae=>{const ge=new Set(ae);return K?ge.add(U):ge.delete(U),ge}),Ke=U=>{const K=be.current.get(U);K!==void 0&&window.clearTimeout(K),be.current.delete(U),Z(ae=>new Set(ae).add(U))},Ot=U=>{const K=be.current.get(U);K!==void 0&&window.clearTimeout(K);const ae=window.setTimeout(()=>{be.current.delete(U),Z(ge=>{const Me=new Set(ge);return Me.delete(U),Me})},2400);be.current.set(U,ae)},He=w.useRef(""),[Ce,Ie]=w.useState(""),[wt,Kt]=w.useState(()=>new Set),[Pt,pn]=w.useState(!1),[je,st]=w.useState(!1),It=w.useRef(null),At=w.useCallback(()=>st(!1),[]),[me,Ve]=w.useState(TC),[nt,Xt]=w.useState(null),[mn,Qt]=w.useState(!1),[te,he]=w.useState(!1),[Oe,De]=w.useState(""),lt=w.useRef(!1),[Bt,it]=w.useState(null),[Q,ve]=w.useState(""),[xe,Xe]=w.useState(),[qe,Je]=w.useState(null),[ct,Rt]=w.useState({newChat:!0,search:!0,skillCenter:!0,history:!0,addAgent:!0,manageAgents:!0,addAgentkit:!0}),[Ft,vn]=w.useState("cloud"),[_n,Ut]=w.useState(Qd),[Ir,Dn]=w.useState(""),[or,Or]=w.useState("chat"),[Er,lr]=w.useState(!1),[kn,Zt]=w.useState(!1),[Nn,Vn]=w.useState(!1),[Zn,on]=w.useState({}),[as,Kn]=w.useState({}),[Pn,Jn]=w.useState({}),os=St.has(a),Si=H.has(a),ri=os||u,Cs=!!a&&Ge,Rr=p?g:ri,Zo=Rr||!p&&Si,Jo=Zn[a]??"",el=as[a]??kye,Ti=Pn[a]??Nye,er=pe==null?void 0:pe.graph,Is=[pe==null?void 0:pe.name,er==null?void 0:er.name,er==null?void 0:er.id].filter(U=>!!U),Vr=ce.targetAgent&&er?nx(er,ce.targetAgent.name):er,Jf=(Vr==null?void 0:Vr.skills)??(ce.targetAgent?[]:(pe==null?void 0:pe.skills)??[]),eh=er?b5(er):[];function tl(U){Ob(U);for(const K of U)K.status==="uploading"?at.current.add(K.id):K.uri&&Cp(n,K.uri).catch(ae=>Ie(String(ae)))}function nl(){ne.current+=1;const U=G;P(null),q(!1),U&&!U.id.startsWith("pending-")&&R0e(U.id).catch(K=>{Ie(K instanceof Error?K.message:String(K))})}async function rl(U){try{await q1(n,Q,U),await W1(n,Q,U),i(K=>K.filter(ae=>ae.id!==U)),F(K=>{const{[U]:ae,...ge}=K;return ge})}catch(K){Ie(String(K))}}function th(U){const K=oe.find(Me=>Me.id===U);if(!K)return;const ae=oe.filter(Me=>Me.id!==U);Ob([K]),K.status==="uploading"&&at.current.add(U),ee(ae),ae.length===0&&!T.trim()&&!!a&&L.length===0?(He.current="",o(""),rl(a)):K.uri&&Cp(n,K.uri).catch(Me=>Ie(String(Me)))}const ou=(U,K)=>{var Ne,Pe,Qe,Be,Ct;const ae=K.author&&K.author!=="user"?K.author:void 0;ae&&(on(et=>({...et,[U]:ae})),Kn(et=>({...et,[U]:new Set(et[U]??[]).add(ae)})),Jn(et=>{var pt;return(pt=et[U])!=null&&pt.length?et:{...et,[U]:[ae]}}));const ge=((Ne=K.actions)==null?void 0:Ne.transferToAgent)??((Pe=K.actions)==null?void 0:Pe.transfer_to_agent);ge&&Jn(et=>{const pt=et[U]??[];return pt[pt.length-1]===ge?et:{...et,[U]:[...pt,ge]}}),(((Qe=K.actions)==null?void 0:Qe.endOfAgent)??((Be=K.actions)==null?void 0:Be.end_of_agent)??((Ct=K.actions)==null?void 0:Ct.escalate))&&Jn(et=>{const pt=et[U]??[];return pt.length<=1?et:{...et,[U]:pt.slice(0,-1)}})},[Ai,_t]=w.useState(_C),[lu,qa]=w.useState([]),sl=w.useCallback(U=>{qa(K=>{const ae=K.findIndex(Me=>Me.id===U.id);if(ae===-1)return[U,...K];const ge=[...K];return ge[ae]={...ge[ae],...U},ge})},[]),nh=w.useCallback(async U=>{try{await iM(U.id),qa(K=>K.map(ae=>ae.id===U.id?{...ae,status:"cancelled",label:"已取消",message:"部署已取消,相关 Runtime 资源已请求销毁。"}:ae))}catch(K){const ae=K instanceof Error?K.message:String(K);qa(ge=>ge.map(Me=>Me.id===U.id?{...Me,message:`取消失败:${ae}`}:Me))}},[]),[rh,sh]=w.useState(!0),[W,de]=w.useState(!1),[Ue,Ye]=w.useState(!1),[Yt,mt]=w.useState(!1),[gn,kt]=w.useState(null),[Sn,Jt]=w.useState([]),[yn,Bn]=w.useState([]),[en,xr]=w.useState(""),ls=w.useRef(null),[_0,Os]=w.useState(!1),[x5,Yn]=w.useState(!1),k0=w.useRef(null),[N0,il]=w.useState(()=>{const U=fs();return Wc(U),U}),[w5,y_]=w.useState(!1),[v5,S0]=w.useState(""),[b_,ih]=w.useState(null),[_5,E_]=w.useState({}),[al,si]=w.useState(null),[k5,Ci]=w.useState(""),[N5,Ii]=w.useState(""),[S5,ah]=w.useState(!1),T0=w.useRef(!1),oh=w.useRef(!1),T5=w.useCallback((U,K,ae)=>{!U||!Q||Jt(ge=>{const Ne=[{id:U,draft:K,updatedAt:Date.now(),deploymentTarget:ae},...ge.filter(Pe=>Pe.id!==U)];return localStorage.setItem(co(Q),JSON.stringify(Ne)),Ne})},[Q]),A0=w.useCallback(U=>{!U||!Q||Jt(K=>{const ae=K.filter(ge=>ge.id!==U);return localStorage.setItem(co(Q),JSON.stringify(ae)),ae})},[Q]),A5=w.useCallback(U=>{if(!Q||U.length===0)return;const K=new Set(U.map(ae=>ae.id));Jt(ae=>{const ge=ae.filter(Me=>!K.has(Me.id));return localStorage.setItem(co(Q),JSON.stringify(ge)),ge}),K.has(en)&&(xr(""),kt(null),si(null),ls.current=null,localStorage.removeItem(Ib(Q)))},[en,Q]),x_=w.useCallback(U=>{if(!U||!Q)return;const K=ls.current;Jt(ae=>{const ge=ae.filter(Ne=>Ne.id!==U),Me=(K==null?void 0:K.id)===U?[K,...ge]:ge;return localStorage.setItem(co(Q),JSON.stringify(Me)),Me})},[Q]);w.useEffect(()=>{if(!Q){Jt([]),Bn([]),xr(""),ls.current=null;return}const U=Sye(Q);Jt(U),Bn(Tye(Q));const K=localStorage.getItem(Ib(Q))||"",ae=U.find(ge=>ge.id===K);ls.current=ae??null,Ai==="custom"&&ae&&(xr(ae.id),kt(ae.draft),si(ae.deploymentTarget??null))},[Q]),w.useEffect(()=>{if(!Q)return;const U=Ib(Q);Ai==="custom"&&en?localStorage.setItem(U,en):localStorage.removeItem(U)},[Ai,en,Q]);const C5=w.useCallback(U=>{if(!Q)return;const K=[...new Set(U.filter(Boolean))];Bn(K),localStorage.setItem(tx(Q),JSON.stringify(K))},[Q]),I5=w.useCallback(async U=>{const K=U.filter(Ne=>!!Ne.runtimeId&&Ne.canDelete===!0);if(K.length===0)return;const ae=new Set,ge=new Set,Me=[];for(const Ne of K)try{await fM(Ne.runtimeId,Ne.region??"cn-beijing"),Im(Ne.runtimeId),ae.add(Ne.runtimeId),ge.add(Ne.id)}catch(Pe){const Qe=Pe instanceof Error?Pe.message:String(Pe);Me.push(`${Ne.label}: ${Qe}`)}if(ae.size>0&&(il(fs()),ih(Ne=>{if(!Ne)return Ne;const Pe=new Set(Ne);for(const Qe of ae)Pe.delete(Qe);return Pe}),E_(Ne=>Object.fromEntries(Object.entries(Ne).filter(([Pe])=>!ae.has(Pe)))),Bn(Ne=>{const Pe=Ne.filter(Qe=>!ge.has(Qe));return Q&&localStorage.setItem(tx(Q),JSON.stringify(Pe)),Pe}),Jt(Ne=>{const Pe=Ne.filter(Qe=>{var Be;return!((Be=Qe.deploymentTarget)!=null&&Be.runtimeId)||!ae.has(Qe.deploymentTarget.runtimeId)});return Q&&localStorage.setItem(co(Q),JSON.stringify(Pe)),Pe}),K.some(Ne=>Ne.id===n)&&(He.current="",o(""),r(""))),Me.length>0){const Ne=Me.slice(0,3).join(";"),Pe=Me.length>3?`;另有 ${Me.length-3} 个失败`:"";throw new Error(`${Me.length} 个 Agent 删除失败:${Ne}${Pe}`)}},[n,Q]),w_=w.useCallback(async()=>{y_(!0),S0("");try{const U=[];let K="";do{const ge=await dd({scope:"mine",region:"all",pageSize:100,nextToken:K});U.push(...ge.runtimes),K=ge.nextToken}while(K&&U.length<2e3);ih(new Set(U.map(ge=>ge.runtimeId))),E_(Object.fromEntries(U.map(ge=>[ge.runtimeId,{canDelete:ge.canDelete}])));const ae=[];for(const ge of U)try{await Cm(ge.runtimeId,ge.name,ge.region,ge.currentVersion)}catch{ae.push(ge.name)}il(fs()),ae.length>0&&S0(`${ae.length} 个 Runtime 暂时无法读取,请稍后重试。`)}catch(U){S0(U instanceof Error?U.message:String(U))}finally{y_(!1)}},[]);function lh(U){console.log("create agent draft:",U),_t(null),ll()}function C0(U,K){console.log("Agent added, navigating to:",U,K),il(fs()),ih(null),A0(en),xr(""),ls.current=null,si(null),Ci(""),Ii(U),_t(null),Yn(!0),r(U)}const O5=w.useCallback(U=>{_t(null),mt(!1),Yn(!0),Ii(""),Ci(U.id),Ie("")},[]),R5=w.useCallback(async U=>{if(!U.runtimeId)throw new Error("部署完成,但未返回 Runtime ID。");const K=(al==null?void 0:al.region)??"cn-beijing",ae=await Cm(U.runtimeId,U.agentName,U.region??K,U.version);il(fs()),ih(ge=>{const Me=new Set(ge??[]);return Me.add(U.runtimeId),Me}),si(null),A0(en),xr(""),ls.current=null,Ci(""),Ii(ae),_t(null),Yn(!0),r(ae)},[en,A0,al]),cu=w.useRef(null),ol=w.useRef(!0),oa=w.useRef(!1),Xa=w.useRef(null),v_=w.useRef({key:"",turnCount:0}),I0=(p==null?void 0:p.id)??a;w.useLayoutEffect(()=>{const U=cu.current,K=v_.current,ae=K.key!==I0,ge=!ae&&L.length>K.turnCount;if(v_.current={key:I0,turnCount:L.length},!U||L.length===0||!ae&&!ge)return;ol.current=!0,oa.current=!1,Xa.current!==null&&(window.clearTimeout(Xa.current),Xa.current=null);const Me=window.matchMedia("(prefers-reduced-motion: reduce)").matches;if(ae||Me){U.scrollTop=U.scrollHeight;return}oa.current=!0,U.scrollTo({top:U.scrollHeight,behavior:"smooth"}),Xa.current=window.setTimeout(()=>{oa.current=!1,Xa.current=null},450)},[I0,L.length]),w.useLayoutEffect(()=>{const U=cu.current;!U||!ol.current||oa.current||(U.scrollTop=U.scrollHeight)},[Rr,L]),w.useEffect(()=>()=>{Xa.current!==null&&window.clearTimeout(Xa.current)},[]);const L5=w.useCallback(()=>{const U=cu.current;!U||oa.current||(ol.current=U.scrollHeight-U.scrollTop-U.clientHeight<32)},[]),M5=w.useCallback(U=>{U.deltaY<0&&(oa.current=!1,ol.current=!1)},[]),j5=w.useCallback(()=>{oa.current=!1,ol.current=!1},[]),D5=w.useCallback(()=>{const U=cu.current;!U||!ol.current||oa.current||(U.scrollTop=U.scrollHeight)},[]),O0=w.useCallback(()=>{it(null),Y1().then(U=>{ve(U.userId),Xe(U.info),Zt(!!U.local),Xt(U.status)}).catch(U=>{it(U instanceof Error?U.message:String(U))})},[]);w.useEffect(()=>{O0()},[O0]),w.useEffect(()=>{const U=()=>{De(""),Qt(!0)};return window.addEventListener(G1,U),yz()&&U(),()=>window.removeEventListener(G1,U)},[]);const P5=w.useCallback(async()=>{if(lt.current)return;lt.current=!0;const U=uz();if(!U){lt.current=!1,De("登录窗口被浏览器拦截,请允许弹出窗口后重试。");return}he(!0),De("");try{for(;;){await new Promise(K=>window.setTimeout(K,1e3));try{const K=await Y1();if(K.status==="authenticated"){ve(K.userId),Xe(K.info),Zt(!!K.local),Xt(K.status),Qt(!1),bz(),U.close();return}}catch{}if(U.closed){De("登录窗口已关闭,请重新登录以继续当前操作。");return}}}finally{lt.current=!1,he(!1)}},[]);w.useEffect(()=>{kn&&Q&&mS(Q)},[kn,Q]),w.useEffect(()=>{if(nt!=="authenticated"||!Q){V({});return}let U=!1;return Promise.allSettled([Q0e(),Z0e()]).then(([K,ae])=>{U||V({temporaryEnabled:K.status==="fulfilled"&&K.value.enabled,skillCreateEnabled:ae.status==="fulfilled"&&ae.value.enabled})}),()=>{U=!0}},[nt,Q]),w.useEffect(()=>{if(nt!=="authenticated"||!Q){Je(null);return}let U=!1;return Je(null),lM().then(K=>{U||Je(K)}).catch(K=>{console.warn("[app] /web/access failed; using ordinary-user access:",K),U||Je(oM)}),()=>{U=!0}},[nt,Q]),w.useEffect(()=>{aM().then(U=>{Rt(U.features),vn(U.agentsSource),Ut(U.branding),Dn(U.version),Or(U.defaultView),lr(!0)})},[]),w.useEffect(()=>{!qe||!Er||oh.current||(oh.current=!0,or==="addAgent"&&qe.capabilities.createAgents&&(_t(null),de(!1),Os(!1),Yn(!1),Ye(!1),mt(!0)))},[qe,or,Er]),w.useEffect(()=>{qe&&(qe.capabilities.createAgents||(_t(null),kt(null),Ye(!1),mt(!1),qa([])),qe.capabilities.manageAgents||Yn(!1))},[qe]),w.useEffect(()=>{document.title=_n.title;let U=document.querySelector('link[rel~="icon"]');U||(U=document.createElement("link"),U.rel="icon",document.head.appendChild(U)),U.removeAttribute("type"),U.href=_n.logoUrl||Yw},[_n]),w.useEffect(()=>{fetch("/web/runtime-config",{signal:AbortSignal.timeout(1e4)}).then(U=>U.ok?U.json():null).then(U=>{U&&sh(!!U.credentials)}).catch(U=>{console.warn("[app] /web/runtime-config probe failed; workbench stays hidden:",U)})},[]);function B5(U){mS(U),T0.current=!0,oh.current=!1,Je(null),_t(null),kt(null),de(!1),Ye(!1),mt(!1),Os(!1),Yn(!1),ll(),ve(U),Xe({name:U}),Zt(!0),Xt("authenticated")}function F5(){oh.current=!1,Je(null),kn?(lz(),ve(""),Xe(void 0),Xt("unauthenticated")):fz()}w.useEffect(()=>{nt!=="unauthenticated"&&VL().then(U=>{if(t(U),Ft==="cloud"){r("");return}const K=localStorage.getItem(vl.app),ae=N0.flatMap(Ne=>Ne.apps.map(Pe=>Mo(Ne.id,Pe))),ge=K&&(U.includes(K)||ae.includes(K)),Me=["web_search_agent","web_demo"].find(Ne=>U.includes(Ne))??U.find(Ne=>!/^\d/.test(Ne))??U[0];r(ge?K:Me||"")}).catch(U=>Ie(String(U)))},[nt,Ft]),w.useEffect(()=>{n&&localStorage.setItem(vl.app,n)},[n]),w.useEffect(()=>{let U=!1;if(Te(null),ze([]),!n||!Q||!a){ke(!1);return}return ke(!0),XL(n,Q,a).then(K=>{U||(Te(K),QL(n).then(ae=>{U||ze(ae)}).catch(()=>{U||ze([])}))}).catch(()=>{U||Te(null)}).finally(()=>{U||ke(!1)}),()=>{U=!0}},[n,Q,a]),w.useEffect(()=>{let U=!1;if(ye(null),re(Pi()),!n){fe(!1);return}return fe(!0),zw(n).then(K=>{U||ye(K)}).catch(()=>{U||ye(null)}).finally(()=>{U||fe(!1)}),()=>{U=!0}},[n]),w.useEffect(()=>{qe&&localStorage.setItem(vl.view,qe.capabilities.createAgents?Ai??"chat":"chat")},[qe,Ai]),w.useEffect(()=>{localStorage.setItem(vl.session,a),He.current=a},[a]),w.useEffect(()=>()=>le.current.forEach(U=>U.abort()),[]),w.useEffect(()=>()=>be.current.forEach(U=>{window.clearTimeout(U)}),[]),w.useEffect(()=>()=>{var U,K;(U=A.current)==null||U.abort(),(K=O.current)==null||K.abort()},[]),w.useEffect(()=>{!n||!Q||(async()=>{const U=await ch(n);if(!T0.current){T0.current=!0;const K=localStorage.getItem(vl.session)||"";if(_C()===null&&K&&U.some(ae=>ae.id===K)){uh(K);return}}ll()})()},[n,Q]),w.useEffect(()=>{const U=k0.current;U&&U.app===n&&(k0.current=null,uh(U.sid))},[n]);function U5(U,K){Os(!1),U===n?uh(K):(k0.current={app:U,sid:K},r(U))}async function ch(U){try{const K=await Uw(U,Q),ae=await Promise.all(K.map(ge=>{var Me;return(Me=ge.events)!=null&&Me.length?Promise.resolve(ge):Tm(U,Q,ge.id)}));return i(ae),ae}catch(K){return Ie(String(K)),[]}}function $5(){p||(Ie(""),S(""),N("confirm"),_(!0))}function H5(){var U;(U=A.current)==null||U.abort(),A.current=null,_(!1),N("confirm"),S(""),!p&&M==="temporary"&&B("agent")}async function z5(){var K;(K=A.current)==null||K.abort();const U=new AbortController;A.current=U,N("loading"),S("");try{const ae=await Ab.startSession({signal:U.signal});if(A.current!==U)return;He.current="",o(""),h([]),R(""),re(Pi()),B("temporary"),nl(),q(!1),tl(oe),ee([]),E([]),m(ae),_t(null),de(!1),Ye(!1),mt(!1),Os(!1),Yn(!1),_(!1),N("confirm")}catch(ae){if((ae==null?void 0:ae.name)==="AbortError"||A.current!==U)return;S(ae instanceof Error?ae.message:String(ae)),N("error")}finally{A.current===U&&(A.current=null)}}function Qa(){var K;(K=O.current)==null||K.abort(),O.current=null,x(!1),E([]),R(""),Ie(""),B("agent");const U=p;m(null),U&&Ab.closeSession(U.id).catch(ae=>Ie(String(ae)))}async function V5(U){var Me;const K=p;if(!K||g||!U.trim())return;Ie("");const ae=new AbortController;(Me=O.current)==null||Me.abort(),O.current=ae;const ge=[{role:"user",blocks:[{kind:"text",text:U}],meta:{ts:Date.now()/1e3}},{role:"assistant",blocks:[]}];E(Ne=>[...Ne,...ge]),x(!0);try{const Ne=await Ab.sendMessage({sessionId:K.id,text:U},{signal:ae.signal,onBlocks:Pe=>{O.current===ae&&E(Qe=>{const Be=Qe.slice(),Ct=Be[Be.length-1];return(Ct==null?void 0:Ct.role)==="assistant"&&(Be[Be.length-1]={...Ct,blocks:Pe}),Be})}});if(O.current!==ae)return;E(Pe=>{const Qe=Pe.slice(),Be=Qe[Qe.length-1];return(Be==null?void 0:Be.role)==="assistant"&&(Qe[Qe.length-1]={...Be,blocks:Ne.blocks,meta:{ts:Date.now()/1e3}}),Qe})}catch(Ne){if((Ne==null?void 0:Ne.name)==="AbortError"||O.current!==ae)return;E(Pe=>Pe.slice(0,-2)),R(U),Ie(`内置智能体发送失败:${Ne instanceof Error?Ne.message:String(Ne)}`)}finally{O.current===ae&&(O.current=null,x(!1))}}function ll(){Qa(),Ie(""),st(!1),Ve(TC()),B("agent"),nl(),q(!1);const U=a&&X.length===0&&oe.length>0?a:"";He.current="",o(""),Te(null),ze([]),d(!1),h([]),re(Pi()),tl(oe),ee([]),U&&rl(U)}async function K5(U){var K;try{(K=le.current.get(U))==null||K.abort(),await q1(n,Q,U),await W1(n,Q,U);const ae=be.current.get(U);ae!==void 0&&window.clearTimeout(ae),be.current.delete(U),Z(ge=>{if(!ge.has(U))return ge;const Me=new Set(ge);return Me.delete(U),Me}),F(ge=>{const{[U]:Me,...Ne}=ge;return Ne}),U===a&&ll(),await ch(n)}catch(ae){Ie(String(ae))}}async function uh(U){if(p&&Qa(),U!==a&&(He.current=U,Ie(""),d(!1),h([]),B("agent"),nl(),re(Pi()),Te(null),ze([]),o(U),D[U]===void 0)){Vn(!0);try{const K=await Tm(n,Q,U);j(U,Pz(K.events??[],K.state))}catch(K){Ie(String(K))}finally{Vn(!1)}}}async function __(U=!0){if(a)return a;c.current||(c.current=Sm(n,Q));const K=c.current;try{const ae=await K;U&&o(ae);const ge=Date.now()/1e3,Me={id:ae,lastUpdateTime:ge,events:[]};return i(Ne=>[Me,...Ne.filter(Pe=>Pe.id!==ae)]),ae}finally{c.current===K&&(c.current=null)}}async function k_(U){if(!n||!Q||!a||!Ee)return!1;yt(!0),Ie("");try{const K=await JL(n,Q,a,U,Ee.revision);return Te(K),!0}catch(K){return Ie(String(K)),!1}finally{yt(!1)}}async function N_(U){if(!(!n||!Q||!a||!Ee)){yt(!0),Ie("");try{const K=await eM(n,Q,a,U,Ee.revision);Te(K)}catch(K){Ie(String(K))}finally{yt(!1)}}}async function Y5(U){Ie("");let K;try{K=await __()}catch(ge){Ie(String(ge));return}const ae=Array.from(U).map(ge=>({file:ge,attachment:{id:Bye(),mimeType:Fye(ge),name:ge.name,sizeBytes:ge.size,status:"uploading"}}));ee(ge=>[...ge,...ae.map(Me=>Me.attachment)]),await Promise.all(ae.map(async({file:ge,attachment:Me})=>{try{const Ne=await YL(n,Q,K,ge);if(at.current.delete(Me.id)){Ne.uri&&await Cp(n,Ne.uri);return}ee(Pe=>Pe.map(Qe=>Qe.id===Me.id?Ne:Qe))}catch(Ne){if(at.current.delete(Me.id))return;const Pe=Ne instanceof Error?Ne.message:String(Ne);ee(Qe=>Qe.map(Be=>Be.id===Me.id?{...Be,status:"error",error:Pe}:Be)),Ie(Pe)}}))}async function S_(U,K=[],ae=Pi()){if(!U.trim()&&K.length===0||ri||Cs||!n||!Q)return;Ie("");const ge=[];(ae.skills.length>0||ae.targetAgent)&&ge.push({kind:"invocation",value:ae}),K.length&&ge.push({kind:"attachment",files:K.map(Be=>({id:Be.id,mimeType:Be.mimeType,data:Be.data,uri:Be.uri,name:Be.name,sizeBytes:Be.sizeBytes}))}),U.trim()&&ge.push({kind:"text",text:U});const Me=[{role:"user",blocks:ge,meta:{ts:Date.now()/1e3}},{role:"assistant",blocks:[]}],Ne=!a;Ne&&(h(Me),d(!0));let Pe;try{Pe=await __(!Ne)}catch(Be){Ne&&(h([]),d(!1),R(U),re(ae)),Ie(String(Be));return}j(Pe,Be=>Ne?Me:[...Be,...Me]),Ne&&(He.current=Pe,o(Pe),h([]),d(!1));const Qe=new AbortController;le.current.set(Pe,Qe),Le(Pe,!0),Ke(Pe),He.current=Pe,on(Be=>({...Be,[Pe]:""})),Kn(Be=>({...Be,[Pe]:new Set})),Jn(Be=>({...Be,[Pe]:[]}));try{let Be=zs(),Ct="",et=0,pt=Date.now()/1e3,ln="",Yr="";for await(const bn of Xd({appName:n,userId:Q,sessionId:Pe,text:U,attachments:K,invocation:ae,signal:Qe.signal,sessionCapabilities:Ee!==null})){if(Qe.signal.aborted)break;const Oi=bn.error??bn.errorMessage??bn.error_message;if(typeof Oi=="string"&&Oi){He.current===Pe&&Ie(Oi);break}ou(Pe,bn);const Ri=bn.author&&bn.author!=="user"?bn.author:"";Ri&&Ri!==Ct&&(Ct=Ri,Be=zs()),Be=xc(Be,bn);const ai=bn.usageMetadata??bn.usage_metadata;ai!=null&&ai.totalTokenCount&&(et=ai.totalTokenCount),bn.timestamp&&(pt=bn.timestamp),bn.id&&(ln=bn.id);const Fn=bn.invocationId??bn.invocation_id;Fn&&(Yr=Fn);const cs=Be.blocks,oi={author:Ct||void 0,tokens:et||void 0,ts:pt,eventId:ln||void 0,invocationId:Yr||void 0};j(Pe,Li=>{var Mi;const tr=Li.slice(),la=tr[tr.length-1];return(la==null?void 0:la.role)==="assistant"&&(!((Mi=la.meta)!=null&&Mi.author)||la.meta.author===Ct)?tr[tr.length-1]={...la,blocks:cs,meta:oi}:tr.push({role:"assistant",blocks:cs,meta:oi}),tr})}ch(n)}catch(Be){(Be==null?void 0:Be.name)!=="AbortError"&&!Qe.signal.aborted&&He.current===Pe&&Ie(String(Be))}finally{le.current.get(Pe)===Qe&&le.current.delete(Pe),Le(Pe,!1),Ot(Pe),on(Be=>({...Be,[Pe]:""})),Jn(Be=>({...Be,[Pe]:[]}))}}function G5(U,K){var Me,Ne;const ae=((Me=U==null?void 0:U.event)==null?void 0:Me.name)??K.id,ge=((Ne=U==null?void 0:U.event)==null?void 0:Ne.context)??{};S_(`[ui-action] ${ae}: ${JSON.stringify(ge)}`)}async function W5(U){var Be,Ct,et;if(!U.authUri)throw new Error("事件中没有授权地址。");if(!n||!Q||!a)throw new Error("会话尚未就绪。");const K=a,ae=await Mye(U.authUri),ge=jye(U.authConfig,ae),Me=pt=>pt.map(ln=>ln.kind==="auth"&&!ln.done?{...ln,done:!0}:ln);j(K,pt=>{const ln=pt.slice(),Yr=ln[ln.length-1];return(Yr==null?void 0:Yr.role)==="assistant"&&(ln[ln.length-1]={...Yr,blocks:Me(Yr.blocks)}),ln});const Ne=L[L.length-1],Pe=Me(Ne&&Ne.role==="assistant"?Ne.blocks:[]),Qe=new AbortController;le.current.set(K,Qe),Le(K,!0),Ke(K);try{let pt=zs(),ln=((Be=Ne==null?void 0:Ne.meta)==null?void 0:Be.author)??"",Yr=Pe,bn=0,Oi=Date.now()/1e3,Ri=((Ct=Ne==null?void 0:Ne.meta)==null?void 0:Ct.eventId)??"",ai=((et=Ne==null?void 0:Ne.meta)==null?void 0:et.invocationId)??"";for await(const Fn of Xd({appName:n,userId:Q,sessionId:a,text:"",functionResponses:[{id:U.callId,name:"adk_request_credential",response:ge}],signal:Qe.signal,sessionCapabilities:Ee!==null})){if(Qe.signal.aborted)break;ou(K,Fn);const cs=Fn.author&&Fn.author!=="user"?Fn.author:"";cs&&cs!==ln&&(ln=cs,Yr=[],pt=zs()),pt=xc(pt,Fn);const oi=Fn.usageMetadata??Fn.usage_metadata;oi!=null&&oi.totalTokenCount&&(bn=oi.totalTokenCount),Fn.timestamp&&(Oi=Fn.timestamp),Fn.id&&(Ri=Fn.id);const Li=Fn.invocationId??Fn.invocation_id;Li&&(ai=Li);const tr=[...Yr,...pt.blocks];j(K,la=>{var R_,L_,M_,j_,D_;const Mi=la.slice(),Gn=Mi[Mi.length-1],O_={author:ln||((R_=Gn==null?void 0:Gn.meta)==null?void 0:R_.author),tokens:bn||((L_=Gn==null?void 0:Gn.meta)==null?void 0:L_.tokens),ts:Oi,eventId:Ri||((M_=Gn==null?void 0:Gn.meta)==null?void 0:M_.eventId),invocationId:ai||((j_=Gn==null?void 0:Gn.meta)==null?void 0:j_.invocationId)};return(Gn==null?void 0:Gn.role)==="assistant"&&(!((D_=Gn.meta)!=null&&D_.author)||Gn.meta.author===ln)?Mi[Mi.length-1]={...Gn,blocks:tr,meta:O_}:Mi.push({role:"assistant",blocks:tr,meta:O_}),Mi})}ch(n)}catch(pt){(pt==null?void 0:pt.name)!=="AbortError"&&!Qe.signal.aborted&&He.current===K&&Ie(String(pt))}finally{le.current.get(K)===Qe&&le.current.delete(K),Le(K,!1),Ot(K),on(pt=>({...pt,[K]:""})),Jn(pt=>({...pt,[K]:[]}))}}if(Bt)return l.jsxs("div",{className:"boot boot-error",children:[l.jsx("p",{children:Bt}),l.jsx("button",{type:"button",onClick:O0,children:"重试"})]});if(nt===null)return l.jsx("div",{className:"boot"});if(nt==="unauthenticated")return l.jsx(cye,{branding:_n,onUsername:B5});if(!qe)return l.jsx("div",{className:"boot"});const ii=qe.capabilities.createAgents,T_=qe.capabilities.manageAgents,Rs=ii?Ai:null,dh=ii&&Yt,fh=ii&&Ue,R0=x5,A_=_M(e,N0),uu=A_.filter(U=>U.runtimeId&&(b_===null||b_.has(U.runtimeId))).map(U=>{var K;return{...U,canDelete:U.runtimeId?((K=_5[U.runtimeId])==null?void 0:K.canDelete)===!0:!1}}),q5=(()=>{if(uu.length===0)return uu;const U=new Map(yn.map((K,ae)=>[K,ae]));return[...uu].sort((K,ae)=>{const ge=U.get(K.id),Me=U.get(ae.id);return ge!=null&&Me!=null?ge-Me:ge!=null?-1:Me!=null?1:uu.indexOf(K)-uu.indexOf(ae)})})(),L0=U=>{var K;return((K=A_.find(ae=>ae.id===U))==null?void 0:K.label)??U},Kr=N0.find(U=>U.runtimeId&&U.apps.some(K=>Mo(U.id,K)===n)),M0=Kr&&Kr.runtimeId?{runtimeId:Kr.runtimeId,name:Kr.name,region:Kr.region??"cn-beijing"}:void 0,C_=async(U,K)=>{var Pe,Qe;const ae=(Pe=U.meta)==null?void 0:Pe.eventId,ge=a;if(!ae||!ge||!M0)return;const Me=(Qe=U.meta)==null?void 0:Qe.feedback,Ne={...Me,rating:K,syncStatus:"syncing",updatedAt:Date.now()/1e3};j(ge,Be=>Be.map(Ct=>{var et;return((et=Ct.meta)==null?void 0:et.eventId)===ae?{...Ct,meta:{...Ct.meta,feedback:Ne}}:Ct})),Kt(Be=>new Set(Be).add(ae));try{const Be=await KL({appName:n,userId:Q,sessionId:ge,eventId:ae,rating:K});j(ge,Ct=>Ct.map(et=>{var pt;return((pt=et.meta)==null?void 0:pt.eventId)===ae?{...et,meta:{...et.meta,feedback:Be}}:et})),i(Ct=>Ct.map(et=>et.id===ge?{...et,state:{...et.state??{},[`veadk_feedback:${ae}`]:Be}}:et))}catch(Be){j(ge,Ct=>Ct.map(et=>{var pt;return((pt=et.meta)==null?void 0:pt.eventId)===ae?{...et,meta:{...et.meta,feedback:Me}}:et})),He.current===ge&&Ie(Be instanceof Error?Be.message:String(Be))}finally{Kt(Be=>{const Ct=new Set(Be);return Ct.delete(ae),Ct})}},I_=U=>{il(fs()),He.current="",o(""),r(U)};return l.jsxs("div",{className:"layout",children:[l.jsx(rV,{branding:_n,access:qe,features:ct,sessions:s,currentSessionId:a,streamingSids:St,onNewChat:()=>{_t(null),de(!1),Ye(!1),mt(!1),Os(!1),Yn(!1),ll()},onSearch:()=>{p&&Qa(),_t(null),de(!1),Ye(!1),mt(!1),Yn(!1),Os(!0),Ie("")},onQuickCreate:()=>{if(!ii){Ie("当前账号没有添加 Agent 的权限。");return}p&&Qa(),He.current="",o(""),de(!1),Ye(!1),Os(!1),Yn(!1),_t(null),kt(null),mt(!0),Ie("")},onSkillCenter:()=>{p&&Qa(),_t(null),Ye(!1),mt(!1),Os(!1),Yn(!1),de(!0),Ie("")},onAddAgent:()=>{if(!ii){Ie("当前账号没有添加 Agent 的权限。");return}p&&Qa(),He.current="",_t(null),de(!1),Os(!1),Yn(!1),o(""),mt(!1),Ye(!0),Ie("")},onManageAgents:()=>{p&&Qa(),He.current="",o(""),_t(null),de(!1),Ye(!1),mt(!1),Os(!1),Yn(!0),Ie(""),w_()},onPickSession:U=>{_t(null),de(!1),Ye(!1),mt(!1),Os(!1),Yn(!1),Ie(""),uh(U)},onDeleteSession:K5,userInfo:xe,version:Ir,onLogout:F5}),(()=>{const U=l.jsxs("div",{className:`composer-slot${p?" sandbox-composer-wrap":""}`,children:[p&&l.jsx(tye,{onExit:ll}),l.jsx(Epe,{sessionId:p?p.id:a,sessionInitializing:!p&&u,appName:n,agentName:p?"AgentKit 沙箱":n?L0(n):"Agent",value:T,onChange:R,onSubmit:()=>{if(!p&&M==="skill-create"){const Me=T.trim();if(!Me||ie)return;const Ne={id:`pending-${Date.now()}`,prompt:Me,status:"provisioning",candidates:Qv.map((Qe,Be)=>({id:`pending-${Be}`,model:Qe,modelLabel:Qe,status:"queued",stage:"provisioning",files:[],activities:[{id:"provisioning",kind:"status",text:"正在拉起 Sandbox",status:"running"}]}))};q(!0);const Pe=++ne.current;Ie(""),P(Ne),R(""),I0e(Me,Qe=>{ne.current===Pe&&P(Qe)}).then(Qe=>{ne.current===Pe&&P(Qe)}).catch(Qe=>{ne.current===Pe&&(P(null),R(Me),Ie(Qe instanceof Error?Qe.message:String(Qe)))}).finally(()=>{ne.current===Pe&&q(!1)});return}const K=T;if(R(""),p){V5(K);return}const ae=oe,ge=ce;ee([]),re(Pi()),S_(K,ae,ge),Ob(ae)},disabled:p?!1:!Q||M==="temporary"||M==="agent"&&!n,busy:p?g:M==="skill-create"?ie:ri,showMeta:L.length>0&&!p,attachments:p?[]:oe,skills:p?[]:Jf,agents:p?[]:eh,invocation:p?Pi():ce,capabilitiesLoading:!p&&J,allowAttachments:!p,onInvocationChange:re,onAddFiles:Y5,onRemoveAttachment:th,newChatMode:p?"agent":M,newChatLayout:!p&&L.length===0&&G===null,showModeSelector:!p&&L.length===0&&G===null,temporaryEnabled:I.temporaryEnabled,skillCreateEnabled:I.skillCreateEnabled,onModeChange:K=>{if(!(K==="temporary"&&!I.temporaryEnabled||K==="skill-create"&&!I.skillCreateEnabled)){if(K==="temporary"){B(K),$5();return}if(B(K),Ie(""),K==="skill-create"){re(Pi());const ae=a&&X.length===0&&oe.length>0?a:"";tl(oe),ee([]),ae&&(He.current="",o(""),rl(ae))}}}})]});return l.jsxs("section",{className:"main-shell",children:[l.jsx(bV,{appName:n,onAppChange:I_,agentLabel:L0,agentsSource:Ft,localApps:e,currentRuntime:M0,runtimeScope:qe.capabilities.runtimeScope,title:dh?"添加 Agent":fh?"添加 AgentKit 智能体":R0?"智能体":void 0,titleLeading:L.length>0&&!p&&M==="agent"&&!dh&&!fh&&!W&&!_0&&!R0&&Rs===null&&n?l.jsx("button",{ref:It,type:"button",className:"agent-info-trigger","aria-label":"查看 Agent 信息",title:"Agent 信息","aria-expanded":je,onClick:()=>st(!0),children:l.jsx(wc,{})}):void 0,crumbs:W?[{label:"技能中心"},{label:"AgentKit Skill 空间"}]:_0||fh||dh||!Rs?void 0:Rs==="menu"?[{label:vye,onClick:()=>{_t(null),kt(null),mt(!0)}},{label:"从 0 快速创建"}]:[{label:"从 0 快速创建",onClick:()=>ah(!0)},{label:_ye[Rs]}],rightContent:l.jsxs(l.Fragment,{children:[qe.role==="admin"&&l.jsx(v0e,{}),l.jsx(Pye,{tasks:ii?lu:[],onCancel:nh})]})}),l.jsxs("main",{className:`main${p?" is-sandbox-session":""}`,children:[Ce&&l.jsx("div",{className:"error",children:Ce}),Nn&&l.jsxs("div",{className:"session-loading",children:[l.jsx(Mt,{className:"icon spin"})," 加载会话…"]}),R0?l.jsx(Che,{agents:q5,drafts:Sn,agentOrder:yn,selectedAgentId:n,agentInfo:pe,agentInfoAgentId:n,loadingAgentInfo:J,canCreate:ii,canUpdate:ii||T_,loadingAgents:w5,agentsError:v5,deploymentTasks:lu,focusedDeploymentTaskId:k5,focusedAgentId:N5,onRetryAgents:()=>void w_(),onAgentOrderChange:C5,onDeleteAgents:I5,onDeleteDrafts:A5,onSelectAgent:I_,onCreateAgent:()=>{if(!ii){Ie("当前账号没有添加 Agent 的权限。");return}Yn(!1),mt(!0),_t(null),kt(null),si(null),xr(""),ls.current=null,Ci(""),Ii(""),Ie("")},onUpdateAgent:K=>{if(!T_&&!ii){Ie("当前账号没有管理 Agent 的权限。");return}if(!(Kr!=null&&Kr.runtimeId)){Ie("仅支持更新已部署的云端智能体。");return}Yn(!1),kt(K);const ae=`runtime-${Kr.runtimeId}`;xr(ae),ls.current=Sn.find(ge=>ge.id===ae)??null,Ci(""),Ii(""),si({runtimeId:Kr.runtimeId,name:Kr.name,region:Kr.region??"cn-beijing",currentVersion:Kr.currentVersion}),_t("custom"),Ie("")},onEditDraft:K=>{Yn(!1),kt(K.draft),xr(K.id),ls.current=K,si(K.deploymentTarget??null),Ci(""),Ii(""),_t("custom"),Ie("")}}):dh?l.jsx(Q4,{title:"您想以哪种方式添加 Agent 来运行?",sub:"选择最适合你的方式,下一步即可开始",cards:[{key:"scratch",icon:Aye,title:"从 0 快速创建",desc:"用智能 / 自定义 / 模板 / 工作流的方式从零创建一个 Agent。",onClick:()=>{mt(!1),kt(null),_t("menu")}},{key:"package",icon:TH,title:"从代码包添加和部署",desc:"上传 Agent 项目压缩包,查看代码并直接部署到 AgentKit Runtime。",onClick:()=>{mt(!1),kt(null),_t("package")}}]}):_0?l.jsx(Xz,{userId:Q,appId:n,agentInfo:pe,capabilitiesLoading:J,agentLabel:L0,onOpenSession:U5}):fh?l.jsx(bre,{onAdded:K=>{il(fs()),Ye(!1),r(K)},onCancel:()=>Ye(!1)}):W?l.jsx(yre,{}):Rs!==null&&!rh?l.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:[l.jsx("div",{style:{fontSize:18,fontWeight:600},children:"需要配置火山引擎 AK/SK"}),l.jsxs("div",{style:{maxWidth:420,lineHeight:1.6},children:["智能体工作台需要 Volcengine 凭据才能使用。请在运行环境中设置"," ",l.jsx("code",{children:"VOLCENGINE_ACCESS_KEY"})," 与"," ",l.jsx("code",{children:"VOLCENGINE_SECRET_KEY"})," 后重试。"]})]}):Rs==="menu"?l.jsx(jme,{onSelect:K=>{kt(null),si(null),Ci(""),Ii(""),xr(K==="custom"?`draft-${Date.now().toString(36)}`:""),ls.current=null,_t(K)},onImport:K=>{kt(K),si(null),Ci(""),Ii(""),xr(`draft-${Date.now().toString(36)}`),ls.current=null,_t("custom")}}):Rs==="intelligent"?l.jsx(age,{userId:Q,onBack:()=>_t("menu"),onCreate:lh,onAgentAdded:C0,onDeploymentTaskChange:sl}):Rs==="custom"?l.jsx(Xge,{initialDraft:gn??void 0,onBack:()=>_t("menu"),onCreate:lh,onAgentAdded:C0,features:ct,onDeploymentTaskChange:sl,deploymentTarget:al??void 0,onDraftChange:(K,ae)=>{en&&(ae?T5(en,K,al??void 0):x_(en))},onDiscard:en?()=>{x_(en),xr(""),ls.current=null,kt(null),si(null),Ci(""),Ii(n),_t(null),mt(!1),Yn(!0),Ie("")}:void 0,onDeploymentStarted:O5,onDeploymentComplete:R5},en||"custom"):Rs==="template"?l.jsx(Jge,{onBack:()=>_t("menu"),onCreate:lh}):Rs==="workflow"?l.jsx(o0e,{onBack:()=>_t("menu"),onCreate:lh}):Rs==="package"?l.jsx(f0e,{onBack:()=>{_t(null),mt(!0)},onAgentAdded:C0,onDeploymentTaskChange:sl}):L.length===0&&G?l.jsx(K0e,{initialJob:G}):L.length===0?l.jsxs("div",{className:"welcome",children:[l.jsx(na,{as:"h1",className:"welcome-title",duration:4.8,spread:22,children:p?"让灵感在临时空间里自由生长":M==="skill-create"?"想创建一个什么 Skill?":me}),U]}):l.jsxs(l.Fragment,{children:[l.jsx("div",{className:`transcript${Zo?" is-streaming":""}`,ref:cu,onScroll:L5,onWheel:M5,onTouchMove:j5,children:L.map((K,ae)=>{var bn,Oi,Ri,ai,Fn;const ge=ae===L.length-1;if(K.role==="user"){const cs=K.blocks.map(tr=>tr.kind==="text"?tr.text:"").join(""),oi=K.blocks.flatMap(tr=>tr.kind==="attachment"?tr.files:[]),Li=K.blocks.find(tr=>tr.kind==="invocation");return l.jsxs(Dt.div,{className:"turn turn--user",initial:{opacity:0,y:8},animate:{opacity:1,y:0},transition:{duration:.2,ease:"easeOut"},children:[(Li==null?void 0:Li.kind)==="invocation"&&l.jsx(Gv,{value:Li.value}),oi.length>0&&l.jsx(qv,{appName:n,items:oi}),cs&&l.jsx("div",{className:"bubble",children:l.jsx(Pf,{text:cs})}),l.jsxs("div",{className:"turn-actions turn-actions--right",children:[((bn=K.meta)==null?void 0:bn.ts)&&l.jsx("span",{className:"meta-text",children:E5(K.meta.ts)}),l.jsx(NC,{text:cs})]})]},ae)}const Me=((Oi=K.meta)==null?void 0:Oi.author)??"",Ne=Me&&er?nx(er,Me):void 0,Pe=!!(Me&&Is.length>0&&!Is.includes(Me)),Qe=(Ne==null?void 0:Ne.name)||Me,Be=(Ne==null?void 0:Ne.description)||(Pe?"正在执行主 Agent 移交的任务。":"");if(K.blocks.length>0&&K.blocks.every(cs=>cs.kind==="agent-transfer"))return null;const Ct=K.blocks.length===0,et=((ai=(Ri=K.meta)==null?void 0:Ri.feedback)==null?void 0:ai.rating)??null,pt=((Fn=K.meta)==null?void 0:Fn.eventId)??"",ln=wt.has(pt),Yr=!!(M0&&pt&&kC(K));return l.jsxs(Dt.div,{className:`turn turn--assistant${Pe?" turn--subagent":""}`,initial:{opacity:0,y:8},animate:{opacity:1,y:0},transition:{duration:.2,ease:"easeOut"},children:[Pe&&l.jsxs(l.Fragment,{children:[l.jsxs("div",{className:"subagent-run-label",children:[l.jsxs("span",{className:"subagent-run-handoff",children:[l.jsx(_H,{}),l.jsx("span",{children:"智能体移交"})]}),l.jsx("span",{className:"subagent-run-title",children:Qe})]}),l.jsx("p",{className:"subagent-run-description",title:Be,children:Be})]}),Ct?ge&&Rr?l.jsx(q4,{}):null:l.jsxs(l.Fragment,{children:[l.jsx(Xv,{appName:n,blocks:K.blocks,streaming:ge&&(Rr||Si),onStreamFrame:ge?D5:void 0,onAction:G5,onAuth:W5}),!(ge&&Rr)&&!Rye(K)&&l.jsx("div",{className:"turn-empty",children:"本次没有返回可显示的内容。"}),!(ge&&Rr)&&!Lye(K)&&l.jsxs("div",{className:"turn-meta",children:[l.jsxs("div",{className:"turn-actions",children:[Yr&&l.jsxs(l.Fragment,{children:[l.jsx("button",{type:"button",className:`icon-btn feedback-btn${et==="good"?" feedback-btn--good":""}`,"aria-label":"赞","aria-pressed":et==="good","aria-busy":ln,title:et==="good"?"取消点赞":"赞",disabled:ln,onClick:()=>void C_(K,et==="good"?null:"good"),children:l.jsx(nye,{className:"icon",filled:et==="good"})}),l.jsx("button",{type:"button",className:`icon-btn feedback-btn${et==="bad"?" feedback-btn--bad":""}`,"aria-label":"踩","aria-pressed":et==="bad","aria-busy":ln,title:et==="bad"?"取消点踩":"踩",disabled:ln,onClick:()=>void C_(K,et==="bad"?null:"bad"),children:l.jsx(rye,{className:"icon",filled:et==="bad"})})]}),!p&&l.jsx("button",{className:"icon-btn",title:"Tracing 火焰图",onClick:()=>pn(!0),children:l.jsx(Cye,{})}),l.jsx(NC,{text:kC(K)})]}),K.meta&&l.jsx("span",{className:"meta-text",children:Iye(K.meta)})]})]})]},ae)})}),!p&&l.jsx(jM,{appName:n,info:pe,loading:J,activeAgent:Jo,seenAgents:el,execPath:Ti,capabilities:Ee,capabilityLoading:Ge,capabilityMutating:We,builtinTools:rt,onAddCapability:k_,onRemoveCapability:K=>void N_(K)}),l.jsx("div",{className:"conversation-composer-slot",children:U})]})]})]})})(),Pt&&a&&l.jsx(oye,{appName:n,sessionId:a,onClose:()=>pn(!1)}),je&&L.length>0&&l.jsx(DV,{appName:n,info:pe,loading:J,activeAgent:Jo,seenAgents:el,execPath:Ti,capabilities:Ee,capabilityLoading:Ge,capabilityMutating:We,builtinTools:rt,onAddCapability:k_,onRemoveCapability:U=>void N_(U),onClose:At,returnFocusRef:It}),l.jsx(eye,{open:b,state:k,error:C,onCancel:H5,onConfirm:()=>void z5()}),l.jsx(uye,{open:mn,checking:te,error:Oe,onLogin:()=>void P5()}),S5&&l.jsx("div",{className:"confirm-scrim",onClick:()=>ah(!1),children:l.jsxs("div",{className:"confirm-box",onClick:U=>U.stopPropagation(),children:[l.jsx("div",{className:"confirm-title",children:"返回创建首页?"}),l.jsx("div",{className:"confirm-text",children:"返回后当前填写的内容将会丢失,确定要返回吗?"}),l.jsxs("div",{className:"confirm-actions",children:[l.jsx("button",{className:"confirm-btn",onClick:()=>ah(!1),children:"取消"}),l.jsx("button",{className:"confirm-btn confirm-btn--danger",onClick:()=>{kt(null),_t("menu"),ah(!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})()||Rb.createRoot(document.getElementById("root")).render(l.jsx(ft.StrictMode,{children:l.jsx(MF,{reducedMotion:"user",children:l.jsx(hH,{maskOpacity:.9,children:l.jsx(Uye,{})})})}));export{w as A,Hg as B,es as C,Kye as D,fd as E,jo as F,k3 as G,Hye as R,yr as V,ft as a,Sc as b,xT as c,Yye as d,Jw as e,zG as f,ef as g,vt as h,aX as i,hX as j,KG as k,yf as l,hQ as m,Wq as n,qq as o,wQ as p,$X as q,HX as r,j3 as s,l as t,Ze as u,$t as v,bt as w,Vye as x,sX as y,Ns as z}; diff --git a/veadk/webui/assets/index-BKcJcY8v.js b/veadk/webui/assets/index-BKcJcY8v.js deleted file mode 100644 index ce475151..00000000 --- a/veadk/webui/assets/index-BKcJcY8v.js +++ /dev/null @@ -1,708 +0,0 @@ -const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/MarkdownPromptEditor-DH4ASeh5.js","assets/MarkdownPromptEditor-ZH9qtki0.css"])))=>i.map(i=>d[i]); -var V5=Object.defineProperty;var K5=(e,t,n)=>t in e?V5(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n;var M_=(e,t,n)=>K5(e,typeof t!="symbol"?t+"":t,n);function Y5(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 $p=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{};function pf(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}var NC={exports:{}},sg={},SC={exports:{}},bt={};/** - * @license React - * react.production.min.js - * - * Copyright (c) Facebook, Inc. and its affiliates. - * - * This source code is licensed under the MIT license found in the - * LICENSE file in the root directory of this source tree. - */var mf=Symbol.for("react.element"),W5=Symbol.for("react.portal"),G5=Symbol.for("react.fragment"),q5=Symbol.for("react.strict_mode"),X5=Symbol.for("react.profiler"),Q5=Symbol.for("react.provider"),Z5=Symbol.for("react.context"),J5=Symbol.for("react.forward_ref"),eB=Symbol.for("react.suspense"),tB=Symbol.for("react.memo"),nB=Symbol.for("react.lazy"),j_=Symbol.iterator;function rB(e){return e===null||typeof e!="object"?null:(e=j_&&e[j_]||e["@@iterator"],typeof e=="function"?e:null)}var TC={isMounted:function(){return!1},enqueueForceUpdate:function(){},enqueueReplaceState:function(){},enqueueSetState:function(){}},AC=Object.assign,CC={};function Uc(e,t,n){this.props=e,this.context=t,this.refs=CC,this.updater=n||TC}Uc.prototype.isReactComponent={};Uc.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")};Uc.prototype.forceUpdate=function(e){this.updater.enqueueForceUpdate(this,e,"forceUpdate")};function IC(){}IC.prototype=Uc.prototype;function ex(e,t,n){this.props=e,this.context=t,this.refs=CC,this.updater=n||TC}var tx=ex.prototype=new IC;tx.constructor=ex;AC(tx,Uc.prototype);tx.isPureReactComponent=!0;var D_=Array.isArray,OC=Object.prototype.hasOwnProperty,nx={current:null},RC={key:!0,ref:!0,__self:!0,__source:!0};function LC(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)OC.call(t,r)&&!RC.hasOwnProperty(r)&&(s[r]=t[r]);var o=arguments.length-2;if(o===1)s.children=n;else if(1>>1,W=R[V];if(0>>1;Vs(G,I))res(ue,G)?(R[V]=ue,R[re]=I,V=re):(R[V]=G,R[ie]=I,V=ie);else if(res(ue,I))R[V]=ue,R[re]=I,V=re;else break e}}return F}function s(R,F){var I=R.sortIndex-F.sortIndex;return I!==0?I:R.id-F.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 c=[],u=[],d=1,f=null,h=3,p=!1,m=!1,y=!1,E=typeof setTimeout=="function"?setTimeout:null,g=typeof clearTimeout=="function"?clearTimeout:null,x=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(R){for(var F=n(u);F!==null;){if(F.callback===null)r(u);else if(F.startTime<=R)r(u),F.sortIndex=F.expirationTime,t(c,F);else break;F=n(u)}}function _(R){if(y=!1,b(R),!m)if(n(c)!==null)m=!0,T(k);else{var F=n(u);F!==null&&L(_,F.startTime-R)}}function k(R,F){m=!1,y&&(y=!1,g(S),S=-1),p=!0;var I=h;try{for(b(F),f=n(c);f!==null&&(!(f.expirationTime>F)||R&&!D());){var V=f.callback;if(typeof V=="function"){f.callback=null,h=f.priorityLevel;var W=V(f.expirationTime<=F);F=e.unstable_now(),typeof W=="function"?f.callback=W:f===n(c)&&r(c),b(F)}else r(c);f=n(c)}if(f!==null)var P=!0;else{var ie=n(u);ie!==null&&L(_,ie.startTime-F),P=!1}return P}finally{f=null,h=I,p=!1}}var N=!1,C=null,S=-1,A=5,O=-1;function D(){return!(e.unstable_now()-OR||125V?(R.sortIndex=I,t(u,R),n(c)===null&&R===n(u)&&(y?(g(S),S=-1):y=!0,L(_,I-V))):(R.sortIndex=W,t(c,R),m||p||(m=!0,T(k))),R},e.unstable_shouldYield=D,e.unstable_wrapCallback=function(R){var F=h;return function(){var I=h;h=F;try{return R.apply(this,arguments)}finally{h=I}}}})(BC);PC.exports=BC;var pB=PC.exports;/** - * @license React - * react-dom.production.min.js - * - * Copyright (c) Facebook, Inc. and its affiliates. - * - * This source code is licensed under the MIT license found in the - * LICENSE file in the root directory of this source tree. - */var mB=w,ns=pB;function Ae(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"),Ib=Object.prototype.hasOwnProperty,gB=/^[: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]*$/,B_={},F_={};function yB(e){return Ib.call(F_,e)?!0:Ib.call(B_,e)?!1:gB.test(e)?F_[e]=!0:(B_[e]=!0,!1)}function bB(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 EB(e,t,n,r){if(t===null||typeof t>"u"||bB(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 Ir(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 ir={};"children dangerouslySetInnerHTML defaultValue defaultChecked innerHTML suppressContentEditableWarning suppressHydrationWarning style".split(" ").forEach(function(e){ir[e]=new Ir(e,0,!1,e,null,!1,!1)});[["acceptCharset","accept-charset"],["className","class"],["htmlFor","for"],["httpEquiv","http-equiv"]].forEach(function(e){var t=e[0];ir[t]=new Ir(t,1,!1,e[1],null,!1,!1)});["contentEditable","draggable","spellCheck","value"].forEach(function(e){ir[e]=new Ir(e,2,!1,e.toLowerCase(),null,!1,!1)});["autoReverse","externalResourcesRequired","focusable","preserveAlpha"].forEach(function(e){ir[e]=new Ir(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){ir[e]=new Ir(e,3,!1,e.toLowerCase(),null,!1,!1)});["checked","multiple","muted","selected"].forEach(function(e){ir[e]=new Ir(e,3,!0,e,null,!1,!1)});["capture","download"].forEach(function(e){ir[e]=new Ir(e,4,!1,e,null,!1,!1)});["cols","rows","size","span"].forEach(function(e){ir[e]=new Ir(e,6,!1,e,null,!1,!1)});["rowSpan","start"].forEach(function(e){ir[e]=new Ir(e,5,!1,e.toLowerCase(),null,!1,!1)});var sx=/[\-:]([a-z])/g;function ix(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(sx,ix);ir[t]=new Ir(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(sx,ix);ir[t]=new Ir(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(sx,ix);ir[t]=new Ir(t,1,!1,e,"http://www.w3.org/XML/1998/namespace",!1,!1)});["tabIndex","crossOrigin"].forEach(function(e){ir[e]=new Ir(e,1,!1,e.toLowerCase(),null,!1,!1)});ir.xlinkHref=new Ir("xlinkHref",1,!1,"xlink:href","http://www.w3.org/1999/xlink",!0,!1);["src","href","action","formAction"].forEach(function(e){ir[e]=new Ir(e,1,!1,e.toLowerCase(),null,!0,!0)});function ax(e,t,n,r){var s=ir.hasOwnProperty(t)?ir[t]:null;(s!==null?s.type!==0:r||!(2o||s[a]!==i[o]){var c=` -`+s[a].replace(" at new "," at ");return e.displayName&&c.includes("")&&(c=c.replace("",e.displayName)),c}while(1<=a&&0<=o);break}}}finally{L0=!1,Error.prepareStackTrace=n}return(e=e?e.displayName||e.name:"")?Ou(e):""}function xB(e){switch(e.tag){case 5:return Ou(e.type);case 16:return Ou("Lazy");case 13:return Ou("Suspense");case 19:return Ou("SuspenseList");case 0:case 2:case 15:return e=M0(e.type,!1),e;case 11:return e=M0(e.type.render,!1),e;case 1:return e=M0(e.type,!0),e;default:return""}}function Mb(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 kl:return"Fragment";case _l:return"Portal";case Ob:return"Profiler";case ox:return"StrictMode";case Rb:return"Suspense";case Lb:return"SuspenseList"}if(typeof e=="object")switch(e.$$typeof){case $C:return(e.displayName||"Context")+".Consumer";case UC:return(e._context.displayName||"Context")+".Provider";case lx:var t=e.render;return e=e.displayName,e||(e=t.displayName||t.name||"",e=e!==""?"ForwardRef("+e+")":"ForwardRef"),e;case cx:return t=e.displayName||null,t!==null?t:Mb(e.type)||"Memo";case ga:t=e._payload,e=e._init;try{return Mb(e(t))}catch{}}return null}function wB(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 Mb(t);case 8:return t===ox?"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 Pa(e){switch(typeof e){case"boolean":case"number":case"string":case"undefined":return e;case"object":return e;default:return""}}function zC(e){var t=e.type;return(e=e.nodeName)&&e.toLowerCase()==="input"&&(t==="checkbox"||t==="radio")}function vB(e){var t=zC(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 uh(e){e._valueTracker||(e._valueTracker=vB(e))}function VC(e){if(!e)return!1;var t=e._valueTracker;if(!t)return!0;var n=t.getValue(),r="";return e&&(r=zC(e)?e.checked?"true":"false":e.value),e=r,e!==n?(t.setValue(e),!0):!1}function Hp(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 jb(e,t){var n=t.checked;return dn({},t,{defaultChecked:void 0,defaultValue:void 0,value:void 0,checked:n??e._wrapperState.initialChecked})}function $_(e,t){var n=t.defaultValue==null?"":t.defaultValue,r=t.checked!=null?t.checked:t.defaultChecked;n=Pa(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 KC(e,t){t=t.checked,t!=null&&ax(e,"checked",t,!1)}function Db(e,t){KC(e,t);var n=Pa(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")?Pb(e,t.type,n):t.hasOwnProperty("defaultValue")&&Pb(e,t.type,Pa(t.defaultValue)),t.checked==null&&t.defaultChecked!=null&&(e.defaultChecked=!!t.defaultChecked)}function H_(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 Pb(e,t,n){(t!=="number"||Hp(e.ownerDocument)!==e)&&(n==null?e.defaultValue=""+e._wrapperState.initialValue:e.defaultValue!==""+n&&(e.defaultValue=""+n))}var Ru=Array.isArray;function ql(e,t,n,r){if(e=e.options,t){t={};for(var s=0;s"+t.valueOf().toString()+"",t=dh.firstChild;e.firstChild;)e.removeChild(e.firstChild);for(;t.firstChild;)e.appendChild(t.firstChild)}});function vd(e,t){if(t){var n=e.firstChild;if(n&&n===e.lastChild&&n.nodeType===3){n.nodeValue=t;return}}e.textContent=t}var Yu={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},_B=["Webkit","ms","Moz","O"];Object.keys(Yu).forEach(function(e){_B.forEach(function(t){t=t+e.charAt(0).toUpperCase()+e.substring(1),Yu[t]=Yu[e]})});function qC(e,t,n){return t==null||typeof t=="boolean"||t===""?"":n||typeof t!="number"||t===0||Yu.hasOwnProperty(e)&&Yu[e]?(""+t).trim():t+"px"}function XC(e,t){e=e.style;for(var n in t)if(t.hasOwnProperty(n)){var r=n.indexOf("--")===0,s=qC(n,t[n],r);n==="float"&&(n="cssFloat"),r?e.setProperty(n,s):e[n]=s}}var kB=dn({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 Ub(e,t){if(t){if(kB[e]&&(t.children!=null||t.dangerouslySetInnerHTML!=null))throw Error(Ae(137,e));if(t.dangerouslySetInnerHTML!=null){if(t.children!=null)throw Error(Ae(60));if(typeof t.dangerouslySetInnerHTML!="object"||!("__html"in t.dangerouslySetInnerHTML))throw Error(Ae(61))}if(t.style!=null&&typeof t.style!="object")throw Error(Ae(62))}}function $b(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 Hb=null;function ux(e){return e=e.target||e.srcElement||window,e.correspondingUseElement&&(e=e.correspondingUseElement),e.nodeType===3?e.parentNode:e}var zb=null,Xl=null,Ql=null;function K_(e){if(e=bf(e)){if(typeof zb!="function")throw Error(Ae(280));var t=e.stateNode;t&&(t=cg(t),zb(e.stateNode,e.type,t))}}function QC(e){Xl?Ql?Ql.push(e):Ql=[e]:Xl=e}function ZC(){if(Xl){var e=Xl,t=Ql;if(Ql=Xl=null,K_(e),t)for(e=0;e>>=0,e===0?32:31-(jB(e)/DB|0)|0}var fh=64,hh=4194304;function Lu(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 Yp(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=Lu(o):(i&=a,i!==0&&(r=Lu(i)))}else a=n&~s,a!==0?r=Lu(a):i!==0&&(r=Lu(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 gf(e,t,n){e.pendingLanes|=t,t!==536870912&&(e.suspendedLanes=0,e.pingedLanes=0),e=e.eventTimes,t=31-Ys(t),e[t]=n}function UB(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=Gu),ek=" ",tk=!1;function bI(e,t){switch(e){case"keyup":return p8.indexOf(t.keyCode)!==-1;case"keydown":return t.keyCode!==229;case"keypress":case"mousedown":case"focusout":return!0;default:return!1}}function EI(e){return e=e.detail,typeof e=="object"&&"data"in e?e.data:null}var Nl=!1;function g8(e,t){switch(e){case"compositionend":return EI(t);case"keypress":return t.which!==32?null:(tk=!0,ek);case"textInput":return e=t.data,e===ek&&tk?null:e;default:return null}}function y8(e,t){if(Nl)return e==="compositionend"||!bx&&bI(e,t)?(e=gI(),up=mx=_a=null,Nl=!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=ik(n)}}function _I(e,t){return e&&t?e===t?!0:e&&e.nodeType===3?!1:t&&t.nodeType===3?_I(e,t.parentNode):"contains"in e?e.contains(t):e.compareDocumentPosition?!!(e.compareDocumentPosition(t)&16):!1:!1}function kI(){for(var e=window,t=Hp();t instanceof e.HTMLIFrameElement;){try{var n=typeof t.contentWindow.location.href=="string"}catch{n=!1}if(n)e=t.contentWindow;else break;t=Hp(e.document)}return t}function Ex(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 S8(e){var t=kI(),n=e.focusedElem,r=e.selectionRange;if(t!==n&&n&&n.ownerDocument&&_I(n.ownerDocument.documentElement,n)){if(r!==null&&Ex(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=ak(n,i);var a=ak(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,Sl=null,qb=null,Xu=null,Xb=!1;function ok(e,t,n){var r=n.window===n?n.document:n.nodeType===9?n:n.ownerDocument;Xb||Sl==null||Sl!==Hp(r)||(r=Sl,"selectionStart"in r&&Ex(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}),Xu&&Ad(Xu,r)||(Xu=r,r=qp(qb,"onSelect"),0Cl||(e.current=n1[Cl],n1[Cl]=null,Cl--)}function Ht(e,t){Cl++,n1[Cl]=e.current,e.current=t}var Ba={},gr=Ha(Ba),Fr=Ha(!1),Oo=Ba;function uc(e,t){var n=e.type.contextTypes;if(!n)return Ba;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 Ur(e){return e=e.childContextTypes,e!=null}function Qp(){Wt(Fr),Wt(gr)}function pk(e,t,n){if(gr.current!==Ba)throw Error(Ae(168));Ht(gr,t),Ht(Fr,n)}function LI(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(Ae(108,wB(e)||"Unknown",s));return dn({},n,r)}function Zp(e){return e=(e=e.stateNode)&&e.__reactInternalMemoizedMergedChildContext||Ba,Oo=gr.current,Ht(gr,e),Ht(Fr,Fr.current),!0}function mk(e,t,n){var r=e.stateNode;if(!r)throw Error(Ae(169));n?(e=LI(e,t,Oo),r.__reactInternalMemoizedMergedChildContext=e,Wt(Fr),Wt(gr),Ht(gr,e)):Wt(Fr),Ht(Fr,n)}var Fi=null,ug=!1,G0=!1;function MI(e){Fi===null?Fi=[e]:Fi.push(e)}function B8(e){ug=!0,MI(e)}function za(){if(!G0&&Fi!==null){G0=!0;var e=0,t=Ot;try{var n=Fi;for(Ot=1;e>=a,s-=a,$i=1<<32-Ys(t)+s|n<S?(A=C,C=null):A=C.sibling;var O=h(g,C,b[S],_);if(O===null){C===null&&(C=A);break}e&&C&&O.alternate===null&&t(g,C),x=i(O,x,S),N===null?k=O:N.sibling=O,N=O,C=A}if(S===b.length)return n(g,C),Jt&&so(g,S),k;if(C===null){for(;SS?(A=C,C=null):A=C.sibling;var D=h(g,C,O.value,_);if(D===null){C===null&&(C=A);break}e&&C&&D.alternate===null&&t(g,C),x=i(D,x,S),N===null?k=D:N.sibling=D,N=D,C=A}if(O.done)return n(g,C),Jt&&so(g,S),k;if(C===null){for(;!O.done;S++,O=b.next())O=f(g,O.value,_),O!==null&&(x=i(O,x,S),N===null?k=O:N.sibling=O,N=O);return Jt&&so(g,S),k}for(C=r(g,C);!O.done;S++,O=b.next())O=p(C,g,S,O.value,_),O!==null&&(e&&O.alternate!==null&&C.delete(O.key===null?S:O.key),x=i(O,x,S),N===null?k=O:N.sibling=O,N=O);return e&&C.forEach(function(U){return t(g,U)}),Jt&&so(g,S),k}function E(g,x,b,_){if(typeof b=="object"&&b!==null&&b.type===kl&&b.key===null&&(b=b.props.children),typeof b=="object"&&b!==null){switch(b.$$typeof){case ch:e:{for(var k=b.key,N=x;N!==null;){if(N.key===k){if(k=b.type,k===kl){if(N.tag===7){n(g,N.sibling),x=s(N,b.props.children),x.return=g,g=x;break e}}else if(N.elementType===k||typeof k=="object"&&k!==null&&k.$$typeof===ga&&bk(k)===N.type){n(g,N.sibling),x=s(N,b.props),x.ref=hu(g,N,b),x.return=g,g=x;break e}n(g,N);break}else t(g,N);N=N.sibling}b.type===kl?(x=ko(b.props.children,g.mode,_,b.key),x.return=g,g=x):(_=bp(b.type,b.key,b.props,null,g.mode,_),_.ref=hu(g,x,b),_.return=g,g=_)}return a(g);case _l:e:{for(N=b.key;x!==null;){if(x.key===N)if(x.tag===4&&x.stateNode.containerInfo===b.containerInfo&&x.stateNode.implementation===b.implementation){n(g,x.sibling),x=s(x,b.children||[]),x.return=g,g=x;break e}else{n(g,x);break}else t(g,x);x=x.sibling}x=ny(b,g.mode,_),x.return=g,g=x}return a(g);case ga:return N=b._init,E(g,x,N(b._payload),_)}if(Ru(b))return m(g,x,b,_);if(lu(b))return y(g,x,b,_);xh(g,b)}return typeof b=="string"&&b!==""||typeof b=="number"?(b=""+b,x!==null&&x.tag===6?(n(g,x.sibling),x=s(x,b),x.return=g,g=x):(n(g,x),x=ty(b,g.mode,_),x.return=g,g=x),a(g)):n(g,x)}return E}var fc=BI(!0),FI=BI(!1),tm=Ha(null),nm=null,Rl=null,_x=null;function kx(){_x=Rl=nm=null}function Nx(e){var t=tm.current;Wt(tm),e._currentValue=t}function i1(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 Jl(e,t){nm=e,_x=Rl=null,e=e.dependencies,e!==null&&e.firstContext!==null&&(e.lanes&t&&(Pr=!0),e.firstContext=null)}function ks(e){var t=e._currentValue;if(_x!==e)if(e={context:e,memoizedValue:t,next:null},Rl===null){if(nm===null)throw Error(Ae(308));Rl=e,nm.dependencies={lanes:0,firstContext:e}}else Rl=Rl.next=e;return t}var go=null;function Sx(e){go===null?go=[e]:go.push(e)}function UI(e,t,n,r){var s=t.interleaved;return s===null?(n.next=n,Sx(t)):(n.next=s.next,s.next=n),t.interleaved=n,Qi(e,r)}function Qi(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 ya=!1;function Tx(e){e.updateQueue={baseState:e.memoizedState,firstBaseUpdate:null,lastBaseUpdate:null,shared:{pending:null,interleaved:null,lanes:0},effects:null}}function $I(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 Ki(e,t){return{eventTime:e,lane:t,tag:0,payload:null,callback:null,next:null}}function Oa(e,t,n){var r=e.updateQueue;if(r===null)return null;if(r=r.shared,Nt&2){var s=r.pending;return s===null?t.next=t:(t.next=s.next,s.next=t),r.pending=t,Qi(e,n)}return s=r.interleaved,s===null?(t.next=t,Sx(r)):(t.next=s.next,s.next=t),r.interleaved=t,Qi(e,n)}function fp(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,fx(e,n)}}function Ek(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 rm(e,t,n,r){var s=e.updateQueue;ya=!1;var i=s.firstBaseUpdate,a=s.lastBaseUpdate,o=s.shared.pending;if(o!==null){s.shared.pending=null;var c=o,u=c.next;c.next=null,a===null?i=u:a.next=u,a=c;var d=e.alternate;d!==null&&(d=d.updateQueue,o=d.lastBaseUpdate,o!==a&&(o===null?d.firstBaseUpdate=u:o.next=u,d.lastBaseUpdate=c))}if(i!==null){var f=s.baseState;a=0,d=u=c=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=dn({},f,h);break e;case 2:ya=!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,c=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&&(c=f),s.baseState=c,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);Mo|=a,e.lanes=a,e.memoizedState=f}}function xk(e,t,n){if(e=t.effects,t.effects=null,e!==null)for(t=0;tn?n:4,e(!0);var r=X0.transition;X0.transition={};try{e(!1),t()}finally{Ot=n,X0.transition=r}}function sO(){return Ns().memoizedState}function H8(e,t,n){var r=La(e);if(n={lane:r,action:n,hasEagerState:!1,eagerState:null,next:null},iO(e))aO(t,n);else if(n=UI(e,t,n,r),n!==null){var s=Tr();Ws(n,e,r,s),oO(n,t,r)}}function z8(e,t,n){var r=La(e),s={lane:r,action:n,hasEagerState:!1,eagerState:null,next:null};if(iO(e))aO(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,Qs(o,a)){var c=t.interleaved;c===null?(s.next=s,Sx(t)):(s.next=c.next,c.next=s),t.interleaved=s;return}}catch{}finally{}n=UI(e,t,s,r),n!==null&&(s=Tr(),Ws(n,e,r,s),oO(n,t,r))}}function iO(e){var t=e.alternate;return e===un||t!==null&&t===un}function aO(e,t){Qu=im=!0;var n=e.pending;n===null?t.next=t:(t.next=n.next,n.next=t),e.pending=t}function oO(e,t,n){if(n&4194240){var r=t.lanes;r&=e.pendingLanes,n|=r,t.lanes=n,fx(e,n)}}var am={readContext:ks,useCallback:cr,useContext:cr,useEffect:cr,useImperativeHandle:cr,useInsertionEffect:cr,useLayoutEffect:cr,useMemo:cr,useReducer:cr,useRef:cr,useState:cr,useDebugValue:cr,useDeferredValue:cr,useTransition:cr,useMutableSource:cr,useSyncExternalStore:cr,useId:cr,unstable_isNewReconciler:!1},V8={readContext:ks,useCallback:function(e,t){return ci().memoizedState=[e,t===void 0?null:t],e},useContext:ks,useEffect:vk,useImperativeHandle:function(e,t,n){return n=n!=null?n.concat([e]):null,pp(4194308,4,JI.bind(null,t,e),n)},useLayoutEffect:function(e,t){return pp(4194308,4,e,t)},useInsertionEffect:function(e,t){return pp(4,2,e,t)},useMemo:function(e,t){var n=ci();return t=t===void 0?null:t,e=e(),n.memoizedState=[e,t],e},useReducer:function(e,t,n){var r=ci();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=H8.bind(null,un,e),[r.memoizedState,e]},useRef:function(e){var t=ci();return e={current:e},t.memoizedState=e},useState:wk,useDebugValue:jx,useDeferredValue:function(e){return ci().memoizedState=e},useTransition:function(){var e=wk(!1),t=e[0];return e=$8.bind(null,e[1]),ci().memoizedState=e,[t,e]},useMutableSource:function(){},useSyncExternalStore:function(e,t,n){var r=un,s=ci();if(Jt){if(n===void 0)throw Error(Ae(407));n=n()}else{if(n=t(),qn===null)throw Error(Ae(349));Lo&30||KI(r,t,n)}s.memoizedState=n;var i={value:n,getSnapshot:t};return s.queue=i,vk(WI.bind(null,r,i,e),[e]),r.flags|=2048,Dd(9,YI.bind(null,r,i,n,t),void 0,null),n},useId:function(){var e=ci(),t=qn.identifierPrefix;if(Jt){var n=Hi,r=$i;n=(r&~(1<<32-Ys(r)-1)).toString(32)+n,t=":"+t+"R"+n,n=Md++,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[hi]=t,e[Od]=r,yO(e,t,!1,!1),t.stateNode=e;e:{switch(a=$b(n,r),n){case"dialog":Yt("cancel",e),Yt("close",e),s=r;break;case"iframe":case"object":case"embed":Yt("load",e),s=r;break;case"video":case"audio":for(s=0;smc&&(t.flags|=128,r=!0,pu(i,!1),t.lanes=4194304)}else{if(!r)if(e=sm(a),e!==null){if(t.flags|=128,r=!0,n=e.updateQueue,n!==null&&(t.updateQueue=n,t.flags|=4),pu(i,!0),i.tail===null&&i.tailMode==="hidden"&&!a.alternate&&!Jt)return ur(t),null}else 2*wn()-i.renderingStartTime>mc&&n!==1073741824&&(t.flags|=128,r=!0,pu(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=wn(),t.sibling=null,n=ln.current,Ht(ln,r?n&1|2:n&1),t):(ur(t),null);case 22:case 23:return $x(),r=t.memoizedState!==null,e!==null&&e.memoizedState!==null!==r&&(t.flags|=8192),r&&t.mode&1?Xr&1073741824&&(ur(t),t.subtreeFlags&6&&(t.flags|=8192)):ur(t),null;case 24:return null;case 25:return null}throw Error(Ae(156,t.tag))}function Z8(e,t){switch(wx(t),t.tag){case 1:return Ur(t.type)&&Qp(),e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 3:return hc(),Wt(Fr),Wt(gr),Ix(),e=t.flags,e&65536&&!(e&128)?(t.flags=e&-65537|128,t):null;case 5:return Cx(t),null;case 13:if(Wt(ln),e=t.memoizedState,e!==null&&e.dehydrated!==null){if(t.alternate===null)throw Error(Ae(340));dc()}return e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 19:return Wt(ln),null;case 4:return hc(),null;case 10:return Nx(t.type._context),null;case 22:case 23:return $x(),null;case 24:return null;default:return null}}var vh=!1,fr=!1,J8=typeof WeakSet=="function"?WeakSet:Set,Fe=null;function Ll(e,t){var n=e.ref;if(n!==null)if(typeof n=="function")try{n(null)}catch(r){yn(e,t,r)}else n.current=null}function p1(e,t,n){try{n()}catch(r){yn(e,t,r)}}var Lk=!1;function eF(e,t){if(Qb=Wp,e=kI(),Ex(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,c=-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||(c=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&&(c=a),(p=f.nextSibling)!==null)break;f=h,h=f.parentNode}f=p}n=o===-1||c===-1?null:{start:o,end:c}}else n=null}n=n||{start:0,end:0}}else n=null;for(Zb={focusedElem:e,selectionRange:n},Wp=!1,Fe=t;Fe!==null;)if(t=Fe,e=t.child,(t.subtreeFlags&1028)!==0&&e!==null)e.return=t,Fe=e;else for(;Fe!==null;){t=Fe;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,E=m.memoizedState,g=t.stateNode,x=g.getSnapshotBeforeUpdate(t.elementType===t.type?y:Bs(t.type,y),E);g.__reactInternalSnapshotBeforeUpdate=x}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(Ae(163))}}catch(_){yn(t,t.return,_)}if(e=t.sibling,e!==null){e.return=t.return,Fe=e;break}Fe=t.return}return m=Lk,Lk=!1,m}function Zu(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&&p1(t,n,i)}s=s.next}while(s!==r)}}function hg(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 m1(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 xO(e){var t=e.alternate;t!==null&&(e.alternate=null,xO(t)),e.child=null,e.deletions=null,e.sibling=null,e.tag===5&&(t=e.stateNode,t!==null&&(delete t[hi],delete t[Od],delete t[t1],delete t[D8],delete t[P8])),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 wO(e){return e.tag===5||e.tag===3||e.tag===4}function Mk(e){e:for(;;){for(;e.sibling===null;){if(e.return===null||wO(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 g1(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=Xp));else if(r!==4&&(e=e.child,e!==null))for(g1(e,t,n),e=e.sibling;e!==null;)g1(e,t,n),e=e.sibling}function y1(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(y1(e,t,n),e=e.sibling;e!==null;)y1(e,t,n),e=e.sibling}var tr=null,Fs=!1;function la(e,t,n){for(n=n.child;n!==null;)vO(e,t,n),n=n.sibling}function vO(e,t,n){if(gi&&typeof gi.onCommitFiberUnmount=="function")try{gi.onCommitFiberUnmount(ig,n)}catch{}switch(n.tag){case 5:fr||Ll(n,t);case 6:var r=tr,s=Fs;tr=null,la(e,t,n),tr=r,Fs=s,tr!==null&&(Fs?(e=tr,n=n.stateNode,e.nodeType===8?e.parentNode.removeChild(n):e.removeChild(n)):tr.removeChild(n.stateNode));break;case 18:tr!==null&&(Fs?(e=tr,n=n.stateNode,e.nodeType===8?W0(e.parentNode,n):e.nodeType===1&&W0(e,n),Sd(e)):W0(tr,n.stateNode));break;case 4:r=tr,s=Fs,tr=n.stateNode.containerInfo,Fs=!0,la(e,t,n),tr=r,Fs=s;break;case 0:case 11:case 14:case 15:if(!fr&&(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)&&p1(n,t,a),s=s.next}while(s!==r)}la(e,t,n);break;case 1:if(!fr&&(Ll(n,t),r=n.stateNode,typeof r.componentWillUnmount=="function"))try{r.props=n.memoizedProps,r.state=n.memoizedState,r.componentWillUnmount()}catch(o){yn(n,t,o)}la(e,t,n);break;case 21:la(e,t,n);break;case 22:n.mode&1?(fr=(r=fr)||n.memoizedState!==null,la(e,t,n),fr=r):la(e,t,n);break;default:la(e,t,n)}}function jk(e){var t=e.updateQueue;if(t!==null){e.updateQueue=null;var n=e.stateNode;n===null&&(n=e.stateNode=new J8),t.forEach(function(r){var s=cF.bind(null,e,r);n.has(r)||(n.add(r),r.then(s,s))})}}function Ms(e,t){var n=t.deletions;if(n!==null)for(var r=0;rs&&(s=a),r&=~i}if(r=s,r=wn()-r,r=(120>r?120:480>r?480:1080>r?1080:1920>r?1920:3e3>r?3e3:4320>r?4320:1960*nF(r/1960))-r,10e?16:e,ka===null)var r=!1;else{if(e=ka,ka=null,cm=0,Nt&6)throw Error(Ae(331));var s=Nt;for(Nt|=4,Fe=e.current;Fe!==null;){var i=Fe,a=i.child;if(Fe.flags&16){var o=i.deletions;if(o!==null){for(var c=0;cwn()-Fx?_o(e,0):Bx|=n),$r(e,t)}function IO(e,t){t===0&&(e.mode&1?(t=hh,hh<<=1,!(hh&130023424)&&(hh=4194304)):t=1);var n=Tr();e=Qi(e,t),e!==null&&(gf(e,t,n),$r(e,n))}function lF(e){var t=e.memoizedState,n=0;t!==null&&(n=t.retryLane),IO(e,n)}function cF(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(Ae(314))}r!==null&&r.delete(t),IO(e,n)}var OO;OO=function(e,t,n){if(e!==null)if(e.memoizedProps!==t.pendingProps||Fr.current)Pr=!0;else{if(!(e.lanes&n)&&!(t.flags&128))return Pr=!1,X8(e,t,n);Pr=!!(e.flags&131072)}else Pr=!1,Jt&&t.flags&1048576&&jI(t,em,t.index);switch(t.lanes=0,t.tag){case 2:var r=t.type;mp(e,t),e=t.pendingProps;var s=uc(t,gr.current);Jl(t,n),s=Rx(null,t,r,e,s,n);var i=Lx();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,Ur(r)?(i=!0,Zp(t)):i=!1,t.memoizedState=s.state!==null&&s.state!==void 0?s.state:null,Tx(t),s.updater=fg,t.stateNode=s,s._reactInternals=t,o1(t,r,e,n),t=u1(null,t,r,!0,i,n)):(t.tag=0,Jt&&i&&xx(t),_r(null,t,s,n),t=t.child),t;case 16:r=t.elementType;e:{switch(mp(e,t),e=t.pendingProps,s=r._init,r=s(r._payload),t.type=r,s=t.tag=dF(r),e=Bs(r,e),s){case 0:t=c1(null,t,r,e,n);break e;case 1:t=Ik(null,t,r,e,n);break e;case 11:t=Ak(null,t,r,e,n);break e;case 14:t=Ck(null,t,r,Bs(r.type,e),n);break e}throw Error(Ae(306,r,""))}return t;case 0:return r=t.type,s=t.pendingProps,s=t.elementType===r?s:Bs(r,s),c1(e,t,r,s,n);case 1:return r=t.type,s=t.pendingProps,s=t.elementType===r?s:Bs(r,s),Ik(e,t,r,s,n);case 3:e:{if(pO(t),e===null)throw Error(Ae(387));r=t.pendingProps,i=t.memoizedState,s=i.element,$I(e,t),rm(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=pc(Error(Ae(423)),t),t=Ok(e,t,r,n,s);break e}else if(r!==s){s=pc(Error(Ae(424)),t),t=Ok(e,t,r,n,s);break e}else for(Zr=Ia(t.stateNode.containerInfo.firstChild),Jr=t,Jt=!0,$s=null,n=FI(t,null,r,n),t.child=n;n;)n.flags=n.flags&-3|4096,n=n.sibling;else{if(dc(),r===s){t=Zi(e,t,n);break e}_r(e,t,r,n)}t=t.child}return t;case 5:return HI(t),e===null&&s1(t),r=t.type,s=t.pendingProps,i=e!==null?e.memoizedProps:null,a=s.children,Jb(r,s)?a=null:i!==null&&Jb(r,i)&&(t.flags|=32),hO(e,t),_r(e,t,a,n),t.child;case 6:return e===null&&s1(t),null;case 13:return mO(e,t,n);case 4:return Ax(t,t.stateNode.containerInfo),r=t.pendingProps,e===null?t.child=fc(t,null,r,n):_r(e,t,r,n),t.child;case 11:return r=t.type,s=t.pendingProps,s=t.elementType===r?s:Bs(r,s),Ak(e,t,r,s,n);case 7:return _r(e,t,t.pendingProps,n),t.child;case 8:return _r(e,t,t.pendingProps.children,n),t.child;case 12:return _r(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,Ht(tm,r._currentValue),r._currentValue=a,i!==null)if(Qs(i.value,a)){if(i.children===s.children&&!Fr.current){t=Zi(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 c=o.firstContext;c!==null;){if(c.context===r){if(i.tag===1){c=Ki(-1,n&-n),c.tag=2;var u=i.updateQueue;if(u!==null){u=u.shared;var d=u.pending;d===null?c.next=c:(c.next=d.next,d.next=c),u.pending=c}}i.lanes|=n,c=i.alternate,c!==null&&(c.lanes|=n),i1(i.return,n,t),o.lanes|=n;break}c=c.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(Ae(341));a.lanes|=n,o=a.alternate,o!==null&&(o.lanes|=n),i1(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}_r(e,t,s.children,n),t=t.child}return t;case 9:return s=t.type,r=t.pendingProps.children,Jl(t,n),s=ks(s),r=r(s),t.flags|=1,_r(e,t,r,n),t.child;case 14:return r=t.type,s=Bs(r,t.pendingProps),s=Bs(r.type,s),Ck(e,t,r,s,n);case 15:return dO(e,t,t.type,t.pendingProps,n);case 17:return r=t.type,s=t.pendingProps,s=t.elementType===r?s:Bs(r,s),mp(e,t),t.tag=1,Ur(r)?(e=!0,Zp(t)):e=!1,Jl(t,n),lO(t,r,s),o1(t,r,s,n),u1(null,t,r,!0,e,n);case 19:return gO(e,t,n);case 22:return fO(e,t,n)}throw Error(Ae(156,t.tag))};function RO(e,t){return iI(e,t)}function uF(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 xs(e,t,n,r){return new uF(e,t,n,r)}function zx(e){return e=e.prototype,!(!e||!e.isReactComponent)}function dF(e){if(typeof e=="function")return zx(e)?1:0;if(e!=null){if(e=e.$$typeof,e===lx)return 11;if(e===cx)return 14}return 2}function Ma(e,t){var n=e.alternate;return n===null?(n=xs(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 bp(e,t,n,r,s,i){var a=2;if(r=e,typeof e=="function")zx(e)&&(a=1);else if(typeof e=="string")a=5;else e:switch(e){case kl:return ko(n.children,s,i,t);case ox:a=8,s|=8;break;case Ob:return e=xs(12,n,t,s|2),e.elementType=Ob,e.lanes=i,e;case Rb:return e=xs(13,n,t,s),e.elementType=Rb,e.lanes=i,e;case Lb:return e=xs(19,n,t,s),e.elementType=Lb,e.lanes=i,e;case HC:return mg(n,s,i,t);default:if(typeof e=="object"&&e!==null)switch(e.$$typeof){case UC:a=10;break e;case $C:a=9;break e;case lx:a=11;break e;case cx:a=14;break e;case ga:a=16,r=null;break e}throw Error(Ae(130,e==null?e:typeof e,""))}return t=xs(a,n,t,s),t.elementType=e,t.type=r,t.lanes=i,t}function ko(e,t,n,r){return e=xs(7,e,r,t),e.lanes=n,e}function mg(e,t,n,r){return e=xs(22,e,r,t),e.elementType=HC,e.lanes=n,e.stateNode={isHidden:!1},e}function ty(e,t,n){return e=xs(6,e,null,t),e.lanes=n,e}function ny(e,t,n){return t=xs(4,e.children!==null?e.children:[],e.key,t),t.lanes=n,t.stateNode={containerInfo:e.containerInfo,pendingChildren:null,implementation:e.implementation},t}function fF(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=D0(0),this.expirationTimes=D0(-1),this.entangledLanes=this.finishedLanes=this.mutableReadLanes=this.expiredLanes=this.pingedLanes=this.suspendedLanes=this.pendingLanes=0,this.entanglements=D0(0),this.identifierPrefix=r,this.onRecoverableError=s,this.mutableSourceEagerHydrationData=null}function Vx(e,t,n,r,s,i,a,o,c){return e=new fF(e,t,n,o,c),t===1?(t=1,i===!0&&(t|=8)):t=0,i=xs(3,null,null,t),e.current=i,i.stateNode=e,i.memoizedState={element:r,isDehydrated:n,cache:null,transitions:null,pendingSuspenseBoundaries:null},Tx(i),e}function hF(e,t,n){var r=3"u"||typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE!="function"))try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(DO)}catch(e){console.error(e)}}DO(),DC.exports=is;var Ss=DC.exports,zk=Ss;Cb.createRoot=zk.createRoot,Cb.hydrateRoot=zk.hydrateRoot;const Gx=w.createContext({});function xg(e){const t=w.useRef(null);return t.current===null&&(t.current=e()),t.current}const wg=w.createContext(null),Bd=w.createContext({transformPagePoint:e=>e,isStatic:!1,reducedMotion:"never"});class bF extends w.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 EF({children:e,isPresent:t}){const n=w.useId(),r=w.useRef(null),s=w.useRef({width:0,height:0,top:0,left:0}),{nonce:i}=w.useContext(Bd);return w.useInsertionEffect(()=>{const{width:a,height:o,top:c,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; - height: ${o}px !important; - top: ${c}px !important; - left: ${u}px !important; - } - `),()=>{document.head.removeChild(d)}},[t]),l.jsx(bF,{isPresent:t,childRef:r,sizeRef:s,children:w.cloneElement(e,{ref:r})})}const xF=({children:e,initial:t,isPresent:n,onExitComplete:r,custom:s,presenceAffectsLayout:i,mode:a})=>{const o=xg(wF),c=w.useId(),u=w.useCallback(f=>{o.set(f,!0);for(const h of o.values())if(!h)return;r&&r()},[o,r]),d=w.useMemo(()=>({id:c,initial:t,isPresent:n,custom:s,onExitComplete:u,register:f=>(o.set(f,!1),()=>o.delete(f))}),i?[Math.random(),u]:[n,u]);return w.useMemo(()=>{o.forEach((f,h)=>o.set(h,!1))},[n]),w.useEffect(()=>{!n&&!o.size&&r&&r()},[n]),a==="popLayout"&&(e=l.jsx(EF,{isPresent:n,children:e})),l.jsx(wg.Provider,{value:d,children:e})};function wF(){return new Map}function PO(e=!0){const t=w.useContext(wg);if(t===null)return[!0,null];const{isPresent:n,onExitComplete:r,register:s}=t,i=w.useId();w.useEffect(()=>{e&&s(i)},[e]);const a=w.useCallback(()=>e&&r&&r(i),[i,r,e]);return!n&&r?[!1,a]:[!0]}const Nh=e=>e.key||"";function Vk(e){const t=[];return w.Children.forEach(e,n=>{w.isValidElement(n)&&t.push(n)}),t}const qx=typeof window<"u",BO=qx?w.useLayoutEffect:w.useEffect,pi=({children:e,custom:t,initial:n=!0,onExitComplete:r,presenceAffectsLayout:s=!0,mode:i="sync",propagate:a=!1})=>{const[o,c]=PO(a),u=w.useMemo(()=>Vk(e),[e]),d=a&&!o?[]:u.map(Nh),f=w.useRef(!0),h=w.useRef(u),p=xg(()=>new Map),[m,y]=w.useState(u),[E,g]=w.useState(u);BO(()=>{f.current=!1,h.current=u;for(let _=0;_{const k=Nh(_),N=a&&!o?!1:u===E||d.includes(k),C=()=>{if(p.has(k))p.set(k,!0);else return;let S=!0;p.forEach(A=>{A||(S=!1)}),S&&(b==null||b(),g(h.current),a&&(c==null||c()),r&&r())};return l.jsx(xF,{isPresent:N,initial:!f.current||n?void 0:!1,custom:N?void 0:t,presenceAffectsLayout:s,mode:i,onExitComplete:N?void 0:C,children:_},k)})})},es=e=>e;let FO=es;const vF={useManualTiming:!1};function _F(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)&&(c.schedule(u),e()),u(a)}const c={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,c.process(u))}};return c}const Sh=["read","resolveKeyframes","update","preRender","render","postRender"],kF=40;function UO(e,t){let n=!1,r=!0;const s={delta:0,timestamp:0,isProcessing:!1},i=()=>n=!0,a=Sh.reduce((g,x)=>(g[x]=_F(i),g),{}),{read:o,resolveKeyframes:c,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,kF),1),s.timestamp=g,s.isProcessing=!0,o.process(s),c.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:Sh.reduce((g,x)=>{const b=a[x];return g[x]=(_,k=!1,N=!1)=>(n||m(),b.schedule(_,k,N)),g},{}),cancel:g=>{for(let x=0;xKk[e].some(n=>!!t[n])};function NF(e){for(const t in e)gc[t]={...gc[t],...e[t]}}const SF=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 fm(e){return e.startsWith("while")||e.startsWith("drag")&&e!=="draggable"||e.startsWith("layout")||e.startsWith("onTap")||e.startsWith("onPan")||e.startsWith("onLayout")||SF.has(e)}let HO=e=>!fm(e);function zO(e){e&&(HO=t=>t.startsWith("on")?!fm(t):e(t))}try{zO(require("@emotion/is-prop-valid").default)}catch{}function TF(e,t,n){const r={};for(const s in e)s==="values"&&typeof e.values=="object"||(HO(s)||n===!0&&fm(s)||!t&&!fm(s)||e.draggable&&s.startsWith("onDrag"))&&(r[s]=e[s]);return r}function AF({children:e,isValidProp:t,...n}){t&&zO(t),n={...w.useContext(Bd),...n},n.isStatic=xg(()=>n.isStatic);const r=w.useMemo(()=>n,[JSON.stringify(n.transition),n.transformPagePoint,n.reducedMotion]);return l.jsx(Bd.Provider,{value:r,children:e})}function CF(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 vg=w.createContext({});function Fd(e){return typeof e=="string"||Array.isArray(e)}function _g(e){return e!==null&&typeof e=="object"&&typeof e.start=="function"}const Xx=["animate","whileInView","whileFocus","whileHover","whileTap","whileDrag","exit"],Qx=["initial",...Xx];function kg(e){return _g(e.animate)||Qx.some(t=>Fd(e[t]))}function VO(e){return!!(kg(e)||e.variants)}function IF(e,t){if(kg(e)){const{initial:n,animate:r}=e;return{initial:n===!1||Fd(n)?n:void 0,animate:Fd(r)?r:void 0}}return e.inherit!==!1?t:{}}function OF(e){const{initial:t,animate:n}=IF(e,w.useContext(vg));return w.useMemo(()=>({initial:t,animate:n}),[Yk(t),Yk(n)])}function Yk(e){return Array.isArray(e)?e.join(" "):e}const RF=Symbol.for("motionComponentSymbol");function jl(e){return e&&typeof e=="object"&&Object.prototype.hasOwnProperty.call(e,"current")}function LF(e,t,n){return w.useCallback(r=>{r&&e.onMount&&e.onMount(r),t&&(r?t.mount(r):t.unmount()),n&&(typeof n=="function"?n(r):jl(n)&&(n.current=r))},[t])}const Zx=e=>e.replace(/([a-z])([A-Z])/gu,"$1-$2").toLowerCase(),MF="framerAppearId",KO="data-"+Zx(MF),{schedule:Jx}=UO(queueMicrotask,!1),YO=w.createContext({});function jF(e,t,n,r,s){var i,a;const{visualElement:o}=w.useContext(vg),c=w.useContext($O),u=w.useContext(wg),d=w.useContext(Bd).reducedMotion,f=w.useRef(null);r=r||c.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=w.useContext(YO);h&&!h.projection&&s&&(h.type==="html"||h.type==="svg")&&DF(f.current,n,s,p);const m=w.useRef(!1);w.useInsertionEffect(()=>{h&&m.current&&h.update(n,u)});const y=n[KO],E=w.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 BO(()=>{h&&(m.current=!0,window.MotionIsMounted=!0,h.updateFeatures(),Jx.render(h.render),E.current&&h.animationState&&h.animationState.animateChanges())}),w.useEffect(()=>{h&&(!E.current&&h.animationState&&h.animationState.animateChanges(),E.current&&(queueMicrotask(()=>{var g;(g=window.MotionHandoffMarkAsComplete)===null||g===void 0||g.call(window,y)}),E.current=!1))}),h}function DF(e,t,n,r){const{layoutId:s,layout:i,drag:a,dragConstraints:o,layoutScroll:c,layoutRoot:u}=t;e.projection=new n(e.latestValues,t["data-framer-portal-id"]?void 0:WO(e.parent)),e.projection.setOptions({layoutId:s,layout:i,alwaysMeasureLayout:!!a||o&&jl(o),visualElement:e,animationType:typeof i=="string"?i:"both",initialPromotionConfig:r,layoutScroll:c,layoutRoot:u})}function WO(e){if(e)return e.options.allowProjection!==!1?e.projection:WO(e.parent)}function PF({preloadedFeatures:e,createVisualElement:t,useRender:n,useVisualState:r,Component:s}){var i,a;e&&NF(e);function o(u,d){let f;const h={...w.useContext(Bd),...u,layoutId:BF(u)},{isStatic:p}=h,m=OF(u),y=r(u,p);if(!p&&qx){FF();const E=UF(h);f=E.MeasureLayout,m.visualElement=jF(s,y,h,t,E.ProjectionNode)}return l.jsxs(vg.Provider,{value:m,children:[f&&m.visualElement?l.jsx(f,{visualElement:m.visualElement,...h}):null,n(s,u,LF(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 c=w.forwardRef(o);return c[RF]=s,c}function BF({layoutId:e}){const t=w.useContext(Gx).id;return t&&e!==void 0?t+"-"+e:e}function FF(e,t){w.useContext($O).strict}function UF(e){const{drag:t,layout:n}=gc;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 $F=["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 ew(e){return typeof e!="string"||e.includes("-")?!1:!!($F.indexOf(e)>-1||/[A-Z]/u.test(e))}function Wk(e){const t=[{},{}];return e==null||e.values.forEach((n,r)=>{t[0][r]=n.get(),t[1][r]=n.getVelocity()}),t}function tw(e,t,n,r){if(typeof t=="function"){const[s,i]=Wk(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]=Wk(r);t=t(n!==void 0?n:e.custom,s,i)}return t}const v1=e=>Array.isArray(e),HF=e=>!!(e&&typeof e=="object"&&e.mix&&e.toValue),zF=e=>v1(e)?e[e.length-1]||0:e,hr=e=>!!(e&&e.getVelocity);function Ep(e){const t=hr(e)?e.get():e;return HF(t)?t.toValue():t}function VF({scrapeMotionValuesFromProps:e,createRenderState:t,onUpdate:n},r,s,i){const a={latestValues:KF(r,s,i,e),renderState:t()};return n&&(a.onMount=o=>n({props:r,current:o,...a}),a.onUpdate=o=>n(o)),a}const GO=e=>(t,n)=>{const r=w.useContext(vg),s=w.useContext(wg),i=()=>VF(e,t,r,s);return n?i():xg(i)};function KF(e,t,n,r){const s={},i=r(e,{});for(const h in i)s[h]=Ep(i[h]);let{initial:a,animate:o}=e;const c=kg(e),u=VO(e);t&&u&&!c&&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"&&!_g(f)){const h=Array.isArray(f)?f:[f];for(let p=0;pt=>typeof t=="string"&&t.startsWith(e),XO=qO("--"),YF=qO("var(--"),nw=e=>YF(e)?WF.test(e.split("/*")[0].trim()):!1,WF=/var\(--(?:[\w-]+\s*|[\w-]+\s*,(?:\s*[^)(\s]|\s*\((?:[^)(]|\([^)(]*\))*\))+\s*)\)$/iu,QO=(e,t)=>t&&typeof e=="number"?t.transform(e):e,Ji=(e,t,n)=>n>t?t:ntypeof e=="number",parse:parseFloat,transform:e=>e},Ud={...Vc,transform:e=>Ji(0,1,e)},Th={...Vc,default:1},xf=e=>({test:t=>typeof t=="string"&&t.endsWith(e)&&t.split(" ").length===1,parse:parseFloat,transform:t=>`${t}${e}`}),ha=xf("deg"),bi=xf("%"),et=xf("px"),GF=xf("vh"),qF=xf("vw"),Gk={...bi,parse:e=>bi.parse(e)/100,transform:e=>bi.transform(e*100)},XF={borderWidth:et,borderTopWidth:et,borderRightWidth:et,borderBottomWidth:et,borderLeftWidth:et,borderRadius:et,radius:et,borderTopLeftRadius:et,borderTopRightRadius:et,borderBottomRightRadius:et,borderBottomLeftRadius:et,width:et,maxWidth:et,height:et,maxHeight:et,top:et,right:et,bottom:et,left:et,padding:et,paddingTop:et,paddingRight:et,paddingBottom:et,paddingLeft:et,margin:et,marginTop:et,marginRight:et,marginBottom:et,marginLeft:et,backgroundPositionX:et,backgroundPositionY:et},QF={rotate:ha,rotateX:ha,rotateY:ha,rotateZ:ha,scale:Th,scaleX:Th,scaleY:Th,scaleZ:Th,skew:ha,skewX:ha,skewY:ha,distance:et,translateX:et,translateY:et,translateZ:et,x:et,y:et,z:et,perspective:et,transformPerspective:et,opacity:Ud,originX:Gk,originY:Gk,originZ:et},qk={...Vc,transform:Math.round},rw={...XF,...QF,zIndex:qk,size:et,fillOpacity:Ud,strokeOpacity:Ud,numOctaves:qk},ZF={x:"translateX",y:"translateY",z:"translateZ",transformPerspective:"perspective"},JF=zc.length;function e9(e,t,n){let r="",s=!0;for(let i=0;i({style:{},transform:{},transformOrigin:{},vars:{}}),ZO=()=>({...aw(),attrs:{}}),ow=e=>typeof e=="string"&&e.toLowerCase()==="svg";function JO(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 eR=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 tR(e,t,n,r){JO(e,t,void 0,r);for(const s in t.attrs)e.setAttribute(eR.has(s)?s:Zx(s),t.attrs[s])}const hm={};function i9(e){Object.assign(hm,e)}function nR(e,{layout:t,layoutId:n}){return Go.has(e)||e.startsWith("origin")||(t||n!==void 0)&&(!!hm[e]||e==="opacity")}function lw(e,t,n){var r;const{style:s}=e,i={};for(const a in s)(hr(s[a])||t.style&&hr(t.style[a])||nR(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 rR(e,t,n){const r=lw(e,t,n);for(const s in e)if(hr(e[s])||hr(t[s])){const i=zc.indexOf(s)!==-1?"attr"+s.charAt(0).toUpperCase()+s.substring(1):s;r[i]=e[s]}return r}function a9(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 Qk=["x","y","width","height","cx","cy","r"],o9={useVisualState:GO({scrapeMotionValuesFromProps:rR,createRenderState:ZO,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(Go.has(o)){i=!0;break}}if(!i)return;let a=!t;if(t)for(let o=0;o{a9(n,r),Gt.render(()=>{iw(r,s,ow(n.tagName),e.transformTemplate),tR(n,r)})})}})},l9={useVisualState:GO({scrapeMotionValuesFromProps:lw,createRenderState:aw})};function sR(e,t,n){for(const r in t)!hr(t[r])&&!nR(r,n)&&(e[r]=t[r])}function c9({transformTemplate:e},t){return w.useMemo(()=>{const n=aw();return sw(n,t,e),Object.assign({},n.vars,n.style)},[t])}function u9(e,t){const n=e.style||{},r={};return sR(r,n,e),Object.assign(r,c9(e,t)),r}function d9(e,t){const n={},r=u9(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 f9(e,t,n,r){const s=w.useMemo(()=>{const i=ZO();return iw(i,t,ow(r),e.transformTemplate),{...i.attrs,style:{...i.style}}},[t]);if(e.style){const i={};sR(i,e.style,e),s.style={...i,...s.style}}return s}function h9(e=!1){return(n,r,s,{latestValues:i},a)=>{const c=(ew(n)?f9:d9)(r,i,a,n),u=TF(r,typeof n=="string",e),d=n!==w.Fragment?{...u,...c,ref:s}:{},{children:f}=r,h=w.useMemo(()=>hr(f)?f.get():f,[f]);return w.createElement(n,{...d,children:h})}}function p9(e,t){return function(r,{forwardMotionProps:s}={forwardMotionProps:!1}){const a={...ew(r)?o9:l9,preloadedFeatures:e,useRender:h9(s),createVisualElement:t,Component:r};return PF(a)}}function iR(e,t){if(!Array.isArray(t))return!1;const n=t.length;if(n!==e.length)return!1;for(let r=0;r(xp===void 0&&Ei.set(nr.isProcessing||vF.useManualTiming?nr.timestamp:performance.now()),xp),set:e=>{xp=e,queueMicrotask(m9)}};function uw(e,t){e.indexOf(t)===-1&&e.push(t)}function dw(e,t){const n=e.indexOf(t);n>-1&&e.splice(n,1)}class fw{constructor(){this.subscriptions=[]}add(t){return uw(this.subscriptions,t),()=>dw(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 y9{constructor(t,n={}){this.version="11.18.2",this.canTrackVelocity=null,this.events={},this.updateAndNotify=(r,s=!0)=>{const i=Ei.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=Ei.now(),this.canTrackVelocity===null&&t!==void 0&&(this.canTrackVelocity=g9(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 fw);const r=this.events[t].add(n);return t==="change"?()=>{r(),Gt.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=Ei.now();if(!this.canTrackVelocity||this.prevFrameValue===void 0||t-this.updatedAt>Zk)return 0;const n=Math.min(this.updatedAt-this.prevUpdatedAt,Zk);return oR(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 $d(e,t){return new y9(e,t)}function b9(e,t,n){e.hasValue(t)?e.getValue(t).set(n):e.addValue(t,$d(n))}function E9(e,t){const n=Ng(e,t);let{transitionEnd:r={},transition:s={},...i}=n||{};i={...i,...r};for(const a in i){const o=zF(i[a]);b9(e,a,o)}}function x9(e){return!!(hr(e)&&e.add)}function _1(e,t){const n=e.getValue("willChange");if(x9(n))return n.add(t)}function lR(e){return e.props[KO]}function hw(e){let t;return()=>(t===void 0&&(t=e()),t)}const w9=hw(()=>window.ScrollTimeline!==void 0);class v9{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(w9()&&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 _9 extends v9{then(t,n){return Promise.all(this.animations).then(t).catch(n)}}const Yi=e=>e*1e3,Wi=e=>e/1e3;function pw(e){return typeof e=="function"}function Jk(e,t){e.timeline=t,e.onfinish=null}const mw=e=>Array.isArray(e)&&typeof e[0]=="number",k9={linearEasing:void 0};function N9(e,t){const n=hw(e);return()=>{var r;return(r=k9[t])!==null&&r!==void 0?r:n()}}const pm=N9(()=>{try{document.createElement("div").animate({opacity:0},{easing:"linear(0, 1)"})}catch{return!1}return!0},"linearEasing"),yc=(e,t,n)=>{const r=t-e;return r===0?1:(n-e)/r},cR=(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})`,k1={linear:"linear",ease:"ease",easeIn:"ease-in",easeOut:"ease-out",easeInOut:"ease-in-out",circIn:ju([0,.65,.55,1]),circOut:ju([.55,0,1,.45]),backIn:ju([.31,.01,.66,-.59]),backOut:ju([.33,1.53,.69,.99])};function dR(e,t){if(e)return typeof e=="function"&&pm()?cR(e,t):mw(e)?ju(e):Array.isArray(e)?e.map(n=>dR(n,t)||k1.easeOut):k1[e]}const fR=(e,t,n)=>(((1-3*n+3*t)*e+(3*n-6*t))*e+3*t)*e,S9=1e-7,T9=12;function A9(e,t,n,r,s){let i,a,o=0;do a=t+(n-t)/2,i=fR(a,r,s)-e,i>0?n=a:t=a;while(Math.abs(i)>S9&&++oA9(i,0,1,e,n);return i=>i===0||i===1?i:fR(s(i),t,r)}const hR=e=>t=>t<=.5?e(2*t)/2:(2-e(2*(1-t)))/2,pR=e=>t=>1-e(1-t),mR=wf(.33,1.53,.69,.99),gw=pR(mR),gR=hR(gw),yR=e=>(e*=2)<1?.5*gw(e):.5*(2-Math.pow(2,-10*(e-1))),yw=e=>1-Math.sin(Math.acos(e)),bR=pR(yw),ER=hR(yw),xR=e=>/^0[^.\s]+$/u.test(e);function C9(e){return typeof e=="number"?e===0:e!==null?e==="none"||e==="0"||xR(e):!0}const td=e=>Math.round(e*1e5)/1e5,bw=/-?(?:\d+(?:\.\d+)?|\.\d+)/gu;function I9(e){return e==null}const O9=/^(?:#[\da-f]{3,8}|(?:rgb|hsl)a?\((?:-?[\d.]+%?[,\s]+){2}-?[\d.]+%?\s*(?:[,/]\s*)?(?:\b\d+(?:\.\d+)?|\.\d+)?%?\))$/iu,Ew=(e,t)=>n=>!!(typeof n=="string"&&O9.test(n)&&n.startsWith(e)||t&&!I9(n)&&Object.prototype.hasOwnProperty.call(n,t)),wR=(e,t,n)=>r=>{if(typeof r!="string")return r;const[s,i,a,o]=r.match(bw);return{[e]:parseFloat(s),[t]:parseFloat(i),[n]:parseFloat(a),alpha:o!==void 0?parseFloat(o):1}},R9=e=>Ji(0,255,e),sy={...Vc,transform:e=>Math.round(R9(e))},bo={test:Ew("rgb","red"),parse:wR("red","green","blue"),transform:({red:e,green:t,blue:n,alpha:r=1})=>"rgba("+sy.transform(e)+", "+sy.transform(t)+", "+sy.transform(n)+", "+td(Ud.transform(r))+")"};function L9(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 N1={test:Ew("#"),parse:L9,transform:bo.transform},Dl={test:Ew("hsl","hue"),parse:wR("hue","saturation","lightness"),transform:({hue:e,saturation:t,lightness:n,alpha:r=1})=>"hsla("+Math.round(e)+", "+bi.transform(td(t))+", "+bi.transform(td(n))+", "+td(Ud.transform(r))+")"},dr={test:e=>bo.test(e)||N1.test(e)||Dl.test(e),parse:e=>bo.test(e)?bo.parse(e):Dl.test(e)?Dl.parse(e):N1.parse(e),transform:e=>typeof e=="string"?e:e.hasOwnProperty("red")?bo.transform(e):Dl.transform(e)},M9=/(?:#[\da-f]{3,8}|(?:rgb|hsl)a?\((?:-?[\d.]+%?[,\s]+){2}-?[\d.]+%?\s*(?:[,/]\s*)?(?:\b\d+(?:\.\d+)?|\.\d+)?%?\))/giu;function j9(e){var t,n;return isNaN(e)&&typeof e=="string"&&(((t=e.match(bw))===null||t===void 0?void 0:t.length)||0)+(((n=e.match(M9))===null||n===void 0?void 0:n.length)||0)>0}const vR="number",_R="color",D9="var",P9="var(",eN="${}",B9=/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 Hd(e){const t=e.toString(),n=[],r={color:[],number:[],var:[]},s=[];let i=0;const o=t.replace(B9,c=>(dr.test(c)?(r.color.push(i),s.push(_R),n.push(dr.parse(c))):c.startsWith(P9)?(r.var.push(i),s.push(D9),n.push(c)):(r.number.push(i),s.push(vR),n.push(parseFloat(c))),++i,eN)).split(eN);return{values:n,split:o,indexes:r,types:s}}function kR(e){return Hd(e).values}function NR(e){const{split:t,types:n}=Hd(e),r=t.length;return s=>{let i="";for(let a=0;atypeof e=="number"?0:e;function U9(e){const t=kR(e);return NR(e)(t.map(F9))}const Ua={test:j9,parse:kR,createTransformer:NR,getAnimatableNone:U9},$9=new Set(["brightness","contrast","saturate","opacity"]);function H9(e){const[t,n]=e.slice(0,-1).split("(");if(t==="drop-shadow")return e;const[r]=n.match(bw)||[];if(!r)return e;const s=n.replace(r,"");let i=$9.has(t)?1:0;return r!==n&&(i*=100),t+"("+i+s+")"}const z9=/\b([a-z-]*)\(.*?\)/gu,S1={...Ua,getAnimatableNone:e=>{const t=e.match(z9);return t?t.map(H9).join(" "):e}},V9={...rw,color:dr,backgroundColor:dr,outlineColor:dr,fill:dr,stroke:dr,borderColor:dr,borderTopColor:dr,borderRightColor:dr,borderBottomColor:dr,borderLeftColor:dr,filter:S1,WebkitFilter:S1},xw=e=>V9[e];function SR(e,t){let n=xw(e);return n!==S1&&(n=Ua),n.getAnimatableNone?n.getAnimatableNone(t):void 0}const K9=new Set(["auto","none","0"]);function Y9(e,t,n){let r=0,s;for(;re===Vc||e===et,nN=(e,t)=>parseFloat(e.split(", ")[t]),rN=(e,t)=>(n,{transform:r})=>{if(r==="none"||!r)return 0;const s=r.match(/^matrix3d\((.+)\)$/u);if(s)return nN(s[1],t);{const i=r.match(/^matrix\((.+)\)$/u);return i?nN(i[1],e):0}},W9=new Set(["x","y","z"]),G9=zc.filter(e=>!W9.has(e));function q9(e){const t=[];return G9.forEach(n=>{const r=e.getValue(n);r!==void 0&&(t.push([n,r.get()]),r.set(n.startsWith("scale")?1:0))}),t}const bc={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:rN(4,13),y:rN(5,14)};bc.translateX=bc.x;bc.translateY=bc.y;const No=new Set;let T1=!1,A1=!1;function TR(){if(A1){const e=Array.from(No).filter(r=>r.needsMeasurement),t=new Set(e.map(r=>r.element)),n=new Map;t.forEach(r=>{const s=q9(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)})}A1=!1,T1=!1,No.forEach(e=>e.complete()),No.clear()}function AR(){No.forEach(e=>{e.readKeyframes(),e.needsMeasurement&&(A1=!0)})}function X9(){AR(),TR()}class ww{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?(No.add(this),T1||(T1=!0,Gt.read(AR),Gt.resolveKeyframes(TR))):(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),Q9=/^var\(--(?:([\w-]+)|([\w-]+), ?([a-zA-Z\d ()%#.,-]+))\)/u;function Z9(e){const t=Q9.exec(e);if(!t)return[,];const[,n,r,s]=t;return[`--${n??r}`,s]}function IR(e,t,n=1){const[r,s]=Z9(e);if(!r)return;const i=window.getComputedStyle(t).getPropertyValue(r);if(i){const a=i.trim();return CR(a)?parseFloat(a):a}return nw(s)?IR(s,t,n+1):s}const OR=e=>t=>t.test(e),J9={test:e=>e==="auto",parse:e=>e},RR=[Vc,et,bi,ha,qF,GF,J9],sN=e=>RR.find(OR(e));class LR extends ww{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 c=0;c{n.getValue(c).set(u)}),this.resolveNoneKeyframes()}}const iN=(e,t)=>t==="zIndex"?!1:!!(typeof e=="number"||Array.isArray(e)||typeof e=="string"&&(Ua.test(e)||e==="0")&&!e.startsWith("url("));function eU(e){const t=e[0];if(e.length===1)return!0;for(let n=0;ne!==null;function Sg(e,{repeat:t,repeatType:n="loop"},r){const s=e.filter(nU),i=t&&n!=="loop"&&t%2===1?0:s.length-1;return!i||r===void 0?s[i]:r}const rU=40;class MR{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=Ei.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>rU?this.resolvedAt:this.createdAt:this.createdAt}get resolved(){return!this._resolved&&!this.hasAttemptedResolve&&X9(),this._resolved}onKeyframesResolved(t,n){this.resolvedAt=Ei.now(),this.hasAttemptedResolve=!0;const{name:r,type:s,velocity:i,delay:a,onComplete:o,onUpdate:c,isGenerator:u}=this.options;if(!u&&!tU(t,r,s,i))if(a)this.options.duration=0;else{c&&c(Sg(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 C1=2e4;function jR(e){let t=0;const n=50;let r=e.next(t);for(;!r.done&&t=C1?1/0:t}const cn=(e,t,n)=>e+(t-e)*n;function iy(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 sU({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,c=2*n-o;s=iy(c,o,e+1/3),i=iy(c,o,e),a=iy(c,o,e-1/3)}return{red:Math.round(s*255),green:Math.round(i*255),blue:Math.round(a*255),alpha:r}}function mm(e,t){return n=>n>0?t:e}const ay=(e,t,n)=>{const r=e*e,s=n*(t*t-r)+r;return s<0?0:Math.sqrt(s)},iU=[N1,bo,Dl],aU=e=>iU.find(t=>t.test(e));function aN(e){const t=aU(e);if(!t)return!1;let n=t.parse(e);return t===Dl&&(n=sU(n)),n}const oN=(e,t)=>{const n=aN(e),r=aN(t);if(!n||!r)return mm(e,t);const s={...n};return i=>(s.red=ay(n.red,r.red,i),s.green=ay(n.green,r.green,i),s.blue=ay(n.blue,r.blue,i),s.alpha=cn(n.alpha,r.alpha,i),bo.transform(s))},oU=(e,t)=>n=>t(e(n)),vf=(...e)=>e.reduce(oU),I1=new Set(["none","hidden"]);function lU(e,t){return I1.has(e)?n=>n<=0?e:t:n=>n>=1?t:e}function cU(e,t){return n=>cn(e,t,n)}function vw(e){return typeof e=="number"?cU:typeof e=="string"?nw(e)?mm:dr.test(e)?oN:fU:Array.isArray(e)?DR:typeof e=="object"?dr.test(e)?oN:uU:mm}function DR(e,t){const n=[...e],r=n.length,s=e.map((i,a)=>vw(i)(i,t[a]));return i=>{for(let a=0;a{for(const i in r)n[i]=r[i](s);return n}}function dU(e,t){var n;const r=[],s={color:0,var:0,number:0};for(let i=0;i{const n=Ua.createTransformer(t),r=Hd(e),s=Hd(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?I1.has(e)&&!s.values.length||I1.has(t)&&!r.values.length?lU(e,t):vf(DR(dU(r,s),s.values),n):mm(e,t)};function PR(e,t,n){return typeof e=="number"&&typeof t=="number"&&typeof n=="number"?cn(e,t,n):vw(e)(e,t)}const hU=5;function BR(e,t,n){const r=Math.max(t-hU,0);return oR(n-e(r),t-r)}const gn={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},oy=.001;function pU({duration:e=gn.duration,bounce:t=gn.bounce,velocity:n=gn.velocity,mass:r=gn.mass}){let s,i,a=1-t;a=Ji(gn.minDamping,gn.maxDamping,a),e=Ji(gn.minDuration,gn.maxDuration,Wi(e)),a<1?(s=u=>{const d=u*a,f=d*e,h=d-n,p=O1(u,a),m=Math.exp(-f);return oy-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=O1(Math.pow(u,2),a);return(-s(u)+oy>0?-1:1)*((h-p)*m)/y}):(s=u=>{const d=Math.exp(-u*e),f=(u-n)*e+1;return-oy+d*f},i=u=>{const d=Math.exp(-u*e),f=(n-u)*(e*e);return d*f});const o=5/e,c=gU(s,i,o);if(e=Yi(e),isNaN(c))return{stiffness:gn.stiffness,damping:gn.damping,duration:e};{const u=Math.pow(c,2)*r;return{stiffness:u,damping:a*2*Math.sqrt(r*u),duration:e}}}const mU=12;function gU(e,t,n){let r=n;for(let s=1;se[n]!==void 0)}function EU(e){let t={velocity:gn.velocity,stiffness:gn.stiffness,damping:gn.damping,mass:gn.mass,isResolvedFromDuration:!1,...e};if(!lN(e,bU)&&lN(e,yU))if(e.visualDuration){const n=e.visualDuration,r=2*Math.PI/(n*1.2),s=r*r,i=2*Ji(.05,1,1-(e.bounce||0))*Math.sqrt(s);t={...t,mass:gn.mass,stiffness:s,damping:i}}else{const n=pU(e);t={...t,...n,mass:gn.mass},t.isResolvedFromDuration=!0}return t}function FR(e=gn.visualDuration,t=gn.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:c,damping:u,mass:d,duration:f,velocity:h,isResolvedFromDuration:p}=EU({...n,velocity:-Wi(n.velocity||0)}),m=h||0,y=u/(2*Math.sqrt(c*d)),E=a-i,g=Wi(Math.sqrt(c/d)),x=Math.abs(E)<5;r||(r=x?gn.restSpeed.granular:gn.restSpeed.default),s||(s=x?gn.restDelta.granular:gn.restDelta.default);let b;if(y<1){const k=O1(g,y);b=N=>{const C=Math.exp(-y*g*N);return a-C*((m+y*g*E)/k*Math.sin(k*N)+E*Math.cos(k*N))}}else if(y===1)b=k=>a-Math.exp(-g*k)*(E+(m+g*E)*k);else{const k=g*Math.sqrt(y*y-1);b=N=>{const C=Math.exp(-y*g*N),S=Math.min(k*N,300);return a-C*((m+y*g*E)*Math.sinh(S)+k*E*Math.cosh(S))/k}}const _={calculatedDuration:p&&f||null,next:k=>{const N=b(k);if(p)o.done=k>=f;else{let C=0;y<1&&(C=k===0?Yi(m):BR(b,k,N));const S=Math.abs(C)<=r,A=Math.abs(a-N)<=s;o.done=S&&A}return o.value=o.done?a:N,o},toString:()=>{const k=Math.min(jR(_),C1),N=cR(C=>_.next(k*C).value,k,30);return k+"ms "+N}};return _}function cN({keyframes:e,velocity:t=0,power:n=.8,timeConstant:r=325,bounceDamping:s=10,bounceStiffness:i=500,modifyTarget:a,min:o,max:c,restDelta:u=.5,restSpeed:d}){const f=e[0],h={done:!1,value:f},p=S=>o!==void 0&&Sc,m=S=>o===void 0?c:c===void 0||Math.abs(o-S)-y*Math.exp(-S/r),b=S=>g+x(S),_=S=>{const A=x(S),O=b(S);h.done=Math.abs(A)<=u,h.value=h.done?g:O};let k,N;const C=S=>{p(h.value)&&(k=S,N=FR({keyframes:[h.value,m(h.value)],velocity:BR(b,S,h.value),damping:s,stiffness:i,restDelta:u,restSpeed:d}))};return C(0),{calculatedDuration:null,next:S=>{let A=!1;return!N&&k===void 0&&(A=!0,_(S),C(S)),k!==void 0&&S>=k?N.next(S-k):(!A&&_(S),h)}}}const xU=wf(.42,0,1,1),wU=wf(0,0,.58,1),UR=wf(.42,0,.58,1),vU=e=>Array.isArray(e)&&typeof e[0]!="number",_U={linear:es,easeIn:xU,easeInOut:UR,easeOut:wU,circIn:yw,circInOut:ER,circOut:bR,backIn:gw,backInOut:gR,backOut:mR,anticipate:yR},uN=e=>{if(mw(e)){FO(e.length===4);const[t,n,r,s]=e;return wf(t,n,r,s)}else if(typeof e=="string")return _U[e];return e};function kU(e,t,n){const r=[],s=n||PR,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=kU(t,r,s),c=o.length,u=d=>{if(a&&d1)for(;fu(Ji(e[0],e[i-1],d)):u}function SU(e,t){const n=e[e.length-1];for(let r=1;r<=t;r++){const s=yc(0,t,r);e.push(cn(n,1,s))}}function TU(e){const t=[0];return SU(t,e.length-1),t}function AU(e,t){return e.map(n=>n*t)}function CU(e,t){return e.map(()=>t||UR).splice(0,e.length-1)}function gm({duration:e=300,keyframes:t,times:n,ease:r="easeInOut"}){const s=vU(r)?r.map(uN):uN(r),i={done:!1,value:t[0]},a=AU(n&&n.length===t.length?n:TU(t),e),o=NU(a,t,{ease:Array.isArray(s)?s:CU(t,s)});return{calculatedDuration:e,next:c=>(i.value=o(c),i.done=c>=e,i)}}const IU=e=>{const t=({timestamp:n})=>e(n);return{start:()=>Gt.update(t,!0),stop:()=>Fa(t),now:()=>nr.isProcessing?nr.timestamp:Ei.now()}},OU={decay:cN,inertia:cN,tween:gm,keyframes:gm,spring:FR},RU=e=>e/100;class _w extends MR{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:c}=this.options;c&&c()};const{name:n,motionValue:r,element:s,keyframes:i}=this.options,a=(s==null?void 0:s.KeyframeResolver)||ww,o=(c,u)=>this.onKeyframesResolved(c,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=pw(n)?n:OU[n]||gm;let c,u;o!==gm&&typeof t[0]!="number"&&(c=vf(RU,PR(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=jR(d));const{calculatedDuration:f}=d,h=f+s,p=h*(r+1)-s;return{generator:d,mirroredGenerator:u,mapPercentToKeyframes:c,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:S}=this.options;return{done:!0,value:S[S.length-1]}}const{finalKeyframe:s,generator:i,mirroredGenerator:a,mapPercentToKeyframes:o,keyframes:c,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:E}=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),x=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 S=Math.min(this.currentTime,d)/f;let A=Math.floor(S),O=S%1;!O&&S>=1&&(O=1),O===1&&A--,A=Math.min(A,p+1),!!(A%2)&&(m==="reverse"?(O=1-O,y&&(O-=y/f)):m==="mirror"&&(_=a)),b=Ji(0,1,O)*f}const k=x?{done:!1,value:c[0]}:_.next(b);o&&(k.value=o(k.value));let{done:N}=k;!x&&u!==null&&(N=this.speed>=0?this.currentTime>=d:this.currentTime<=0);const C=this.holdTime===null&&(this.state==="finished"||this.state==="running"&&N);return C&&s!==void 0&&(k.value=Sg(c,this.options,s)),E&&E(k.value),C&&this.finish(),k}get duration(){const{resolved:t}=this;return t?Wi(t.calculatedDuration):0}get time(){return Wi(this.currentTime)}set time(t){t=Yi(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=Wi(this.currentTime))}play(){if(this.resolver.isScheduled||this.resolver.resume(),!this._resolved){this.pendingPlayState="running";return}if(this.isStopped)return;const{driver:t=IU,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 LU=new Set(["opacity","clipPath","filter","transform"]);function MU(e,t,n,{delay:r=0,duration:s=300,repeat:i=0,repeatType:a="loop",ease:o="easeInOut",times:c}={}){const u={[t]:n};c&&(u.offset=c);const d=dR(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 jU=hw(()=>Object.hasOwnProperty.call(Element.prototype,"animate")),ym=10,DU=2e4;function PU(e){return pw(e.type)||e.type==="spring"||!uR(e.ease)}function BU(e,t){const n=new _w({...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:c,startTime:u}=this.options;if(!o.owner||!o.owner.current)return!1;if(typeof i=="string"&&pm()&&FU(i)&&(i=$R[i]),PU(this.options)){const{onComplete:f,onUpdate:h,motionValue:p,element:m,...y}=this.options,E=BU(t,y);t=E.keyframes,t.length===1&&(t[1]=t[0]),r=E.duration,s=E.times,i=E.ease,a="keyframes"}const d=MU(o.owner.current,c,t,{...this.options,duration:r,times:s,ease:i});return d.startTime=u??this.calcStartTime(),this.pendingTimeline?(Jk(d,this.pendingTimeline),this.pendingTimeline=void 0):d.onfinish=()=>{const{onComplete:f}=this.options;o.set(Sg(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 Wi(n)}get time(){const{resolved:t}=this;if(!t)return 0;const{animation:n}=t;return Wi(n.currentTime||0)}set time(t){const{resolved:n}=this;if(!n)return;const{animation:r}=n;r.currentTime=Yi(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 es;const{animation:r}=n;Jk(r,t)}return es}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 _w({...p,keyframes:r,duration:s,type:i,ease:a,times:o,isGenerator:!0}),y=Yi(this.time);u.setWithVelocity(m.sample(y-ym).value,m.sample(y).value,ym)}const{onStop:c}=this.options;c&&c(),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:c,transformTemplate:u}=n.owner.getProps();return jU()&&r&&LU.has(r)&&!c&&!u&&!s&&i!=="mirror"&&a!==0&&o!=="inertia"}}const UU={type:"spring",stiffness:500,damping:25,restSpeed:10},$U=e=>({type:"spring",stiffness:550,damping:e===0?2*Math.sqrt(550):30,restSpeed:10}),HU={type:"keyframes",duration:.8},zU={type:"keyframes",ease:[.25,.1,.35,1],duration:.3},VU=(e,{keyframes:t})=>t.length>2?HU:Go.has(e)?e.startsWith("scale")?$U(t[1]):UU:zU;function KU({when:e,delay:t,delayChildren:n,staggerChildren:r,staggerDirection:s,repeat:i,repeatType:a,repeatDelay:o,from:c,elapsed:u,...d}){return!!Object.keys(d).length}const kw=(e,t,n,r={},s,i)=>a=>{const o=cw(r,e)||{},c=o.delay||r.delay||0;let{elapsed:u=0}=r;u=u-Yi(c);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};KU(o)||(d={...d,...VU(e,d)}),d.duration&&(d.duration=Yi(d.duration)),d.repeatDelay&&(d.repeatDelay=Yi(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=Sg(d.keyframes,o);if(h!==void 0)return Gt.update(()=>{d.onUpdate(h),d.onComplete()}),new _9([])}return!i&&dN.supports(d)?new dN(d):new _w(d)};function YU({protectedKeys:e,needsAnimating:t},n){const r=e.hasOwnProperty(n)&&t[n]!==!0;return t[n]=!1,r}function HR(e,t,{delay:n=0,transitionOverride:r,type:s}={}){var i;let{transition:a=e.getDefaultTransition(),transitionEnd:o,...c}=t;r&&(a=r);const u=[],d=s&&e.animationState&&e.animationState.getState()[s];for(const f in c){const h=e.getValue(f,(i=e.latestValues[f])!==null&&i!==void 0?i:null),p=c[f];if(p===void 0||d&&YU(d,f))continue;const m={delay:n,...cw(a||{},f)};let y=!1;if(window.MotionHandoffAnimation){const g=lR(e);if(g){const x=window.MotionHandoffAnimation(g,f,Gt);x!==null&&(m.startTime=x,y=!0)}}_1(e,f),h.start(kw(f,h,p,e.shouldReduceMotion&&aR.has(f)?{type:!1}:m,e,y));const E=h.animation;E&&u.push(E)}return o&&Promise.all(u).then(()=>{Gt.update(()=>{o&&E9(e,o)})}),u}function R1(e,t,n={}){var r;const s=Ng(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(HR(e,s,n)):()=>Promise.resolve(),o=e.variantChildren&&e.variantChildren.size?(u=0)=>{const{delayChildren:d=0,staggerChildren:f,staggerDirection:h}=i;return WU(e,t,d+u,f,h,n)}:()=>Promise.resolve(),{when:c}=i;if(c){const[u,d]=c==="beforeChildren"?[a,o]:[o,a];return u().then(()=>d())}else return Promise.all([a(),o(n.delay)])}function WU(e,t,n=0,r=0,s=1,i){const a=[],o=(e.variantChildren.size-1)*r,c=s===1?(u=0)=>u*r:(u=0)=>o-u*r;return Array.from(e.variantChildren).sort(GU).forEach((u,d)=>{u.notify("AnimationStart",t),a.push(R1(u,t,{...i,delay:n+c(d)}).then(()=>u.notify("AnimationComplete",t)))}),Promise.all(a)}function GU(e,t){return e.sortNodePosition(t)}function qU(e,t,n={}){e.notify("AnimationStart",t);let r;if(Array.isArray(t)){const s=t.map(i=>R1(e,i,n));r=Promise.all(s)}else if(typeof t=="string")r=R1(e,t,n);else{const s=typeof t=="function"?Ng(e,t,n.custom):t;r=Promise.all(HR(e,s,n))}return r.then(()=>{e.notify("AnimationComplete",t)})}const XU=Qx.length;function zR(e){if(!e)return;if(!e.isControllingVariants){const n=e.parent?zR(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})=>qU(e,n,r)))}function e$(e){let t=JU(e),n=fN(),r=!0;const s=c=>(u,d)=>{var f;const h=Ng(e,d,c==="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(c){t=c(e)}function a(c){const{props:u}=e,d=zR(e.parent)||{},f=[],h=new Set;let p={},m=1/0;for(let E=0;Em&&_,A=!1;const O=Array.isArray(b)?b:[b];let D=O.reduce(s(g),{});k===!1&&(D={});const{prevResolvedValues:U={}}=x,X={...U,...D},M=L=>{S=!0,h.has(L)&&(A=!0,h.delete(L)),x.needsAnimating[L]=!0;const R=e.getValue(L);R&&(R.liveStyle=!1)};for(const L in X){const R=D[L],F=U[L];if(p.hasOwnProperty(L))continue;let I=!1;v1(R)&&v1(F)?I=!iR(R,F):I=R!==F,I?R!=null?M(L):h.add(L):R!==void 0&&h.has(L)?M(L):x.protectedKeys[L]=!0}x.prevProp=b,x.prevResolvedValues=D,x.isActive&&(p={...p,...D}),r&&e.blockInitialAnimation&&(S=!1),S&&(!(N&&C)||A)&&f.push(...O.map(L=>({animation:L,options:{type:g}})))}if(h.size){const E={};h.forEach(g=>{const x=e.getBaseTarget(g),b=e.getValue(g);b&&(b.liveStyle=!0),E[g]=x??null}),f.push({animation:E})}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(c,u){var d;if(n[c].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(c,u)}),n[c].isActive=u;const f=a(c);for(const h in n)n[h].protectedKeys={};return f}return{animateChanges:a,setActive:o,setAnimateFunction:i,getState:()=>n,reset:()=>{n=fN(),r=!0}}}function t$(e,t){return typeof t=="string"?t!==e:Array.isArray(t)?!iR(t,e):!1}function to(e=!1){return{isActive:e,protectedKeys:{},needsAnimating:{},prevResolvedValues:{}}}function fN(){return{animate:to(!0),whileInView:to(),whileHover:to(),whileTap:to(),whileDrag:to(),whileFocus:to(),exit:to()}}class Va{constructor(t){this.isMounted=!1,this.node=t}update(){}}class n$ extends Va{constructor(t){super(t),t.animationState||(t.animationState=e$(t))}updateAnimationControlsSubscription(){const{animate:t}=this.node.getProps();_g(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 r$=0;class s$ extends Va{constructor(){super(...arguments),this.id=r$++}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 i$={animation:{Feature:n$},exit:{Feature:s$}},Ps={x:!1,y:!1};function VR(){return Ps.x||Ps.y}function a$(e){return e==="x"||e==="y"?Ps[e]?null:(Ps[e]=!0,()=>{Ps[e]=!1}):Ps.x||Ps.y?null:(Ps.x=Ps.y=!0,()=>{Ps.x=Ps.y=!1})}const Nw=e=>e.pointerType==="mouse"?typeof e.button!="number"||e.button<=0:e.isPrimary!==!1;function zd(e,t,n,r={passive:!0}){return e.addEventListener(t,n,r),()=>e.removeEventListener(t,n)}function _f(e){return{point:{x:e.pageX,y:e.pageY}}}const o$=e=>t=>Nw(t)&&e(t,_f(t));function nd(e,t,n,r){return zd(e,t,o$(n),r)}const hN=(e,t)=>Math.abs(e-t);function l$(e,t){const n=hN(e.x,t.x),r=hN(e.y,t.y);return Math.sqrt(n**2+r**2)}class KR{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=cy(this.lastMoveEventInfo,this.history),h=this.startEvent!==null,p=l$(f.offset,{x:0,y:0})>=3;if(!h&&!p)return;const{point:m}=f,{timestamp:y}=nr;this.history.push({...m,timestamp:y});const{onStart:E,onMove:g}=this.handlers;h||(E&&E(this.lastMoveEvent,f),this.startEvent=this.lastMoveEvent),g&&g(this.lastMoveEvent,f)},this.handlePointerMove=(f,h)=>{this.lastMoveEvent=f,this.lastMoveEventInfo=ly(h,this.transformPagePoint),Gt.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 E=cy(f.type==="pointercancel"?this.lastMoveEventInfo:ly(h,this.transformPagePoint),this.history);this.startEvent&&p&&p(f,E),m&&m(f,E)},!Nw(t))return;this.dragSnapToOrigin=i,this.handlers=n,this.transformPagePoint=r,this.contextWindow=s||window;const a=_f(t),o=ly(a,this.transformPagePoint),{point:c}=o,{timestamp:u}=nr;this.history=[{...c,timestamp:u}];const{onSessionStart:d}=n;d&&d(t,cy(o,this.history)),this.removeListeners=vf(nd(this.contextWindow,"pointermove",this.handlePointerMove),nd(this.contextWindow,"pointerup",this.handlePointerUp),nd(this.contextWindow,"pointercancel",this.handlePointerUp))}updateHandlers(t){this.handlers=t}end(){this.removeListeners&&this.removeListeners(),Fa(this.updatePoint)}}function ly(e,t){return t?{point:t(e.point)}:e}function pN(e,t){return{x:e.x-t.x,y:e.y-t.y}}function cy({point:e},t){return{point:e,delta:pN(e,YR(t)),offset:pN(e,c$(t)),velocity:u$(t,.1)}}function c$(e){return e[0]}function YR(e){return e[e.length-1]}function u$(e,t){if(e.length<2)return{x:0,y:0};let n=e.length-1,r=null;const s=YR(e);for(;n>=0&&(r=e[n],!(s.timestamp-r.timestamp>Yi(t)));)n--;if(!r)return{x:0,y:0};const i=Wi(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 WR=1e-4,d$=1-WR,f$=1+WR,GR=.01,h$=0-GR,p$=0+GR;function rs(e){return e.max-e.min}function m$(e,t,n){return Math.abs(e-t)<=n}function mN(e,t,n,r=.5){e.origin=r,e.originPoint=cn(t.min,t.max,e.origin),e.scale=rs(n)/rs(t),e.translate=cn(n.min,n.max,e.origin)-e.originPoint,(e.scale>=d$&&e.scale<=f$||isNaN(e.scale))&&(e.scale=1),(e.translate>=h$&&e.translate<=p$||isNaN(e.translate))&&(e.translate=0)}function rd(e,t,n,r){mN(e.x,t.x,n.x,r?r.originX:void 0),mN(e.y,t.y,n.y,r?r.originY:void 0)}function gN(e,t,n){e.min=n.min+t.min,e.max=e.min+rs(t)}function g$(e,t,n){gN(e.x,t.x,n.x),gN(e.y,t.y,n.y)}function yN(e,t,n){e.min=t.min-n.min,e.max=e.min+rs(t)}function sd(e,t,n){yN(e.x,t.x,n.x),yN(e.y,t.y,n.y)}function y$(e,{min:t,max:n},r){return t!==void 0&&en&&(e=r?cn(n,e,r.max):Math.min(e,n)),e}function bN(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 b$(e,{top:t,left:n,bottom:r,right:s}){return{x:bN(e.x,n,s),y:bN(e.y,t,r)}}function EN(e,t){let n=t.min-e.min,r=t.max-e.max;return t.max-t.minr?n=yc(t.min,t.max-r,e.min):r>s&&(n=yc(e.min,e.max-s,t.min)),Ji(0,1,n)}function w$(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 L1=.35;function v$(e=L1){return e===!1?e=0:e===!0&&(e=L1),{x:xN(e,"left","right"),y:xN(e,"top","bottom")}}function xN(e,t,n){return{min:wN(e,t),max:wN(e,n)}}function wN(e,t){return typeof e=="number"?e:e[t]||0}const vN=()=>({translate:0,scale:1,origin:0,originPoint:0}),Pl=()=>({x:vN(),y:vN()}),_N=()=>({min:0,max:0}),xn=()=>({x:_N(),y:_N()});function hs(e){return[e("x"),e("y")]}function qR({top:e,left:t,right:n,bottom:r}){return{x:{min:t,max:n},y:{min:e,max:r}}}function _$({x:e,y:t}){return{top:t.min,right:e.max,bottom:t.max,left:e.min}}function k$(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 uy(e){return e===void 0||e===1}function M1({scale:e,scaleX:t,scaleY:n}){return!uy(e)||!uy(t)||!uy(n)}function ao(e){return M1(e)||XR(e)||e.z||e.rotate||e.rotateX||e.rotateY||e.skewX||e.skewY}function XR(e){return kN(e.x)||kN(e.y)}function kN(e){return e&&e!=="0%"}function bm(e,t,n){const r=e-n,s=t*r;return n+s}function NN(e,t,n,r,s){return s!==void 0&&(e=bm(e,s,r)),bm(e,n,r)+t}function j1(e,t=0,n=1,r,s){e.min=NN(e.min,t,n,r,s),e.max=NN(e.max,t,n,r,s)}function QR(e,{x:t,y:n}){j1(e.x,t.translate,t.scale,t.originPoint),j1(e.y,n.translate,n.scale,n.originPoint)}const SN=.999999999999,TN=1.0000000000001;function N$(e,t,n,r=!1){const s=n.length;if(!s)return;t.x=t.y=1;let i,a;for(let o=0;oSN&&(t.x=1),t.ySN&&(t.y=1)}function Bl(e,t){e.min=e.min+t,e.max=e.max+t}function AN(e,t,n,r,s=.5){const i=cn(e.min,e.max,s);j1(e,t,n,i,r)}function Fl(e,t){AN(e.x,t.x,t.scaleX,t.scale,t.originX),AN(e.y,t.y,t.scaleY,t.scale,t.originY)}function ZR(e,t){return qR(k$(e.getBoundingClientRect(),t))}function S$(e,t,n){const r=ZR(e,n),{scroll:s}=t;return s&&(Bl(r.x,s.offset.x),Bl(r.y,s.offset.y)),r}const JR=({current:e})=>e?e.ownerDocument.defaultView:null,T$=new WeakMap;class A${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=xn(),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(_f(d).point)},i=(d,f)=>{const{drag:h,dragPropagation:p,onDragStart:m}=this.getProps();if(h&&!p&&(this.openDragLock&&this.openDragLock(),this.openDragLock=a$(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),hs(E=>{let g=this.getAxisMotionValue(E).get()||0;if(bi.test(g)){const{projection:x}=this.visualElement;if(x&&x.layout){const b=x.layout.layoutBox[E];b&&(g=rs(b)*(parseFloat(g)/100))}}this.originPoint[E]=g}),m&&Gt.postRender(()=>m(d,f)),_1(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:E}=f;if(p&&this.currentDirection===null){this.currentDirection=C$(E),this.currentDirection!==null&&m&&m(this.currentDirection);return}this.updateAxis("x",f.point,E),this.updateAxis("y",f.point,E),this.visualElement.render(),y&&y(d,f)},o=(d,f)=>this.stop(d,f),c=()=>hs(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 KR(t,{onSessionStart:s,onStart:i,onMove:a,onSessionEnd:o,resumeAnimation:c},{transformPagePoint:this.visualElement.getTransformPagePoint(),dragSnapToOrigin:u,contextWindow:JR(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&&Gt.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||!Ah(t,s,this.currentDirection))return;const i=this.getAxisMotionValue(t);let a=this.originPoint[t]+r[t];this.constraints&&this.constraints[t]&&(a=y$(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&&jl(n)?this.constraints||(this.constraints=this.resolveRefConstraints()):n&&s?this.constraints=b$(s.layoutBox,n):this.constraints=!1,this.elastic=v$(r),i!==this.constraints&&s&&this.constraints&&!this.hasMutatedConstraints&&hs(a=>{this.constraints!==!1&&this.getAxisMotionValue(a)&&(this.constraints[a]=w$(s.layoutBox[a],this.constraints[a]))})}resolveRefConstraints(){const{dragConstraints:t,onMeasureDragConstraints:n}=this.getProps();if(!t||!jl(t))return!1;const r=t.current,{projection:s}=this.visualElement;if(!s||!s.layout)return!1;const i=S$(r,s.root,this.visualElement.getTransformPagePoint());let a=E$(s.layout.layoutBox,i);if(n){const o=n(_$(a));this.hasMutatedConstraints=!!o,o&&(a=qR(o))}return a}startAnimation(t){const{drag:n,dragMomentum:r,dragElastic:s,dragTransition:i,dragSnapToOrigin:a,onDragTransitionEnd:o}=this.getProps(),c=this.constraints||{},u=hs(d=>{if(!Ah(d,n,this.currentDirection))return;let f=c&&c[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 _1(this.visualElement,t),r.start(kw(t,r,0,n,this.visualElement,!1))}stopAnimation(){hs(t=>this.getAxisMotionValue(t).stop())}pauseAnimation(){hs(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){hs(n=>{const{drag:r}=this.getProps();if(!Ah(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]-cn(a,o,.5))}})}scalePositionWithinConstraints(){if(!this.visualElement.current)return;const{drag:t,dragConstraints:n}=this.getProps(),{projection:r}=this.visualElement;if(!jl(n)||!r||!this.constraints)return;this.stopAnimation();const s={x:0,y:0};hs(a=>{const o=this.getAxisMotionValue(a);if(o&&this.constraints!==!1){const c=o.get();s[a]=x$({min:c,max:c},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(),hs(a=>{if(!Ah(a,t,null))return;const o=this.getAxisMotionValue(a),{min:c,max:u}=this.constraints[a];o.set(cn(c,u,s[a]))})}addListeners(){if(!this.visualElement.current)return;T$.set(this.visualElement,this);const t=this.visualElement.current,n=nd(t,"pointerdown",c=>{const{drag:u,dragListener:d=!0}=this.getProps();u&&d&&this.start(c)}),r=()=>{const{dragConstraints:c}=this.getProps();jl(c)&&c.current&&(this.constraints=this.resolveRefConstraints())},{projection:s}=this.visualElement,i=s.addEventListener("measure",r);s&&!s.layout&&(s.root&&s.root.updateScroll(),s.updateLayout()),Gt.read(r);const a=zd(window,"resize",()=>this.scalePositionWithinConstraints()),o=s.addEventListener("didUpdate",({delta:c,hasLayoutChanged:u})=>{this.isDragging&&u&&(hs(d=>{const f=this.getAxisMotionValue(d);f&&(this.originPoint[d]+=c[d].translate,f.set(f.get()+c[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=L1,dragMomentum:o=!0}=t;return{...t,drag:n,dragDirectionLock:r,dragPropagation:s,dragConstraints:i,dragElastic:a,dragMomentum:o}}}function Ah(e,t,n){return(t===!0||t===e)&&(n===null||n===e)}function C$(e,t=10){let n=null;return Math.abs(e.y)>t?n="y":Math.abs(e.x)>t&&(n="x"),n}class I$ extends Va{constructor(t){super(t),this.removeGroupControls=es,this.removeListeners=es,this.controls=new A$(t)}mount(){const{dragControls:t}=this.node.getProps();t&&(this.removeGroupControls=t.subscribe(this.controls)),this.removeListeners=this.controls.addListeners()||es}unmount(){this.removeGroupControls(),this.removeListeners()}}const CN=e=>(t,n)=>{e&&Gt.postRender(()=>e(t,n))};class O$ extends Va{constructor(){super(...arguments),this.removePointerDownListener=es}onPointerDown(t){this.session=new KR(t,this.createPanHandlers(),{transformPagePoint:this.node.getTransformPagePoint(),contextWindow:JR(this.node)})}createPanHandlers(){const{onPanSessionStart:t,onPanStart:n,onPan:r,onPanEnd:s}=this.node.getProps();return{onSessionStart:CN(t),onStart:CN(n),onMove:r,onEnd:(i,a)=>{delete this.session,s&&Gt.postRender(()=>s(i,a))}}}mount(){this.removePointerDownListener=nd(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 wp={hasAnimatedSinceResize:!0,hasEverUpdated:!1};function IN(e,t){return t.max===t.min?0:e/(t.max-t.min)*100}const gu={correct:(e,t)=>{if(!t.target)return e;if(typeof e=="string")if(et.test(e))e=parseFloat(e);else return e;const n=IN(e,t.target.x),r=IN(e,t.target.y);return`${n}% ${r}%`}},R$={correct:(e,{treeScale:t,projectionDelta:n})=>{const r=e,s=Ua.parse(e);if(s.length>5)return r;const i=Ua.createTransformer(e),a=typeof s[0]!="number"?1:0,o=n.x.scale*t.x,c=n.y.scale*t.y;s[0+a]/=o,s[1+a]/=c;const u=cn(o,c,.5);return typeof s[2+a]=="number"&&(s[2+a]/=u),typeof s[3+a]=="number"&&(s[3+a]/=u),i(s)}};class L$ extends w.Component{componentDidMount(){const{visualElement:t,layoutGroup:n,switchLayoutGroup:r,layoutId:s}=this.props,{projection:i}=t;i9(M$),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()})),wp.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()||Gt.postRender(()=>{const o=a.getStack();(!o||!o.members.length)&&this.safeToRemove()}))),null}componentDidUpdate(){const{projection:t}=this.props.visualElement;t&&(t.root.didUpdate(),Jx.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 eL(e){const[t,n]=PO(),r=w.useContext(Gx);return l.jsx(L$,{...e,layoutGroup:r,switchLayoutGroup:w.useContext(YO),isPresent:t,safeToRemove:n})}const M$={borderRadius:{...gu,applyTo:["borderTopLeftRadius","borderTopRightRadius","borderBottomLeftRadius","borderBottomRightRadius"]},borderTopLeftRadius:gu,borderTopRightRadius:gu,borderBottomLeftRadius:gu,borderBottomRightRadius:gu,boxShadow:R$};function j$(e,t,n){const r=hr(e)?e:$d(e);return r.start(kw("",r,t,n)),r.animation}function D$(e){return e instanceof SVGElement&&e.tagName!=="svg"}const P$=(e,t)=>e.depth-t.depth;class B${constructor(){this.children=[],this.isDirty=!1}add(t){uw(this.children,t),this.isDirty=!0}remove(t){dw(this.children,t),this.isDirty=!0}forEach(t){this.isDirty&&this.children.sort(P$),this.isDirty=!1,this.children.forEach(t)}}function F$(e,t){const n=Ei.now(),r=({timestamp:s})=>{const i=s-n;i>=t&&(Fa(r),e(i-t))};return Gt.read(r,!0),()=>Fa(r)}const tL=["TopLeft","TopRight","BottomLeft","BottomRight"],U$=tL.length,ON=e=>typeof e=="string"?parseFloat(e):e,RN=e=>typeof e=="number"||et.test(e);function $$(e,t,n,r,s,i){s?(e.opacity=cn(0,n.opacity!==void 0?n.opacity:1,H$(r)),e.opacityExit=cn(t.opacity!==void 0?t.opacity:1,0,z$(r))):i&&(e.opacity=cn(t.opacity!==void 0?t.opacity:1,n.opacity!==void 0?n.opacity:1,r));for(let a=0;art?1:n(yc(e,t,r))}function MN(e,t){e.min=t.min,e.max=t.max}function fs(e,t){MN(e.x,t.x),MN(e.y,t.y)}function jN(e,t){e.translate=t.translate,e.scale=t.scale,e.originPoint=t.originPoint,e.origin=t.origin}function DN(e,t,n,r,s){return e-=t,e=bm(e,1/n,r),s!==void 0&&(e=bm(e,1/s,r)),e}function V$(e,t=0,n=1,r=.5,s,i=e,a=e){if(bi.test(t)&&(t=parseFloat(t),t=cn(a.min,a.max,t/100)-a.min),typeof t!="number")return;let o=cn(i.min,i.max,r);e===i&&(o-=t),e.min=DN(e.min,t,n,o,s),e.max=DN(e.max,t,n,o,s)}function PN(e,t,[n,r,s],i,a){V$(e,t[n],t[r],t[s],t.scale,i,a)}const K$=["x","scaleX","originX"],Y$=["y","scaleY","originY"];function BN(e,t,n,r){PN(e.x,t,K$,n?n.x:void 0,r?r.x:void 0),PN(e.y,t,Y$,n?n.y:void 0,r?r.y:void 0)}function FN(e){return e.translate===0&&e.scale===1}function rL(e){return FN(e.x)&&FN(e.y)}function UN(e,t){return e.min===t.min&&e.max===t.max}function W$(e,t){return UN(e.x,t.x)&&UN(e.y,t.y)}function $N(e,t){return Math.round(e.min)===Math.round(t.min)&&Math.round(e.max)===Math.round(t.max)}function sL(e,t){return $N(e.x,t.x)&&$N(e.y,t.y)}function HN(e){return rs(e.x)/rs(e.y)}function zN(e,t){return e.translate===t.translate&&e.scale===t.scale&&e.originPoint===t.originPoint}class G${constructor(){this.members=[]}add(t){uw(this.members,t),t.scheduleRender()}remove(t){if(dw(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 q$(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,c=e.y.scale*t.y;return(o!==1||c!==1)&&(r+=`scale(${o}, ${c})`),r||"none"}const oo={type:"projectionFrame",totalNodes:0,resolvedTargetDeltas:0,recalculatedProjection:0},Du=typeof window<"u"&&window.MotionDebug!==void 0,dy=["","X","Y","Z"],X$={visibility:"hidden"},VN=1e3;let Q$=0;function fy(e,t,n,r){const{latestValues:s}=t;s[e]&&(n[e]=s[e],t.setStaticValue(e,0),r&&(r[e]=0))}function iL(e){if(e.hasCheckedOptimisedAppear=!0,e.root===e)return;const{visualElement:t}=e.options;if(!t)return;const n=lR(t);if(window.MotionHasOptimisedAnimation(n,"transform")){const{layout:s,layoutId:i}=e.options;window.MotionCancelOptimisedAnimation(n,"transform",Gt,!(s||i))}const{parent:r}=e;r&&!r.hasCheckedOptimisedAppear&&iL(r)}function aL({attachResizeListener:e,defaultParent:t,measureScroll:n,checkIsScrollRoot:r,resetTransform:s}){return class{constructor(a={},o=t==null?void 0:t()){this.id=Q$++,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,Du&&(oo.totalNodes=oo.resolvedTargetDeltas=oo.recalculatedProjection=0),this.nodes.forEach(e7),this.nodes.forEach(i7),this.nodes.forEach(a7),this.nodes.forEach(t7),Du&&window.MotionDebug.record(oo)},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 c=0;cthis.root.updateBlockedByResize=!1;e(a,()=>{this.root.updateBlockedByResize=!0,f&&f(),f=F$(h,250),wp.hasAnimatedSinceResize&&(wp.hasAnimatedSinceResize=!1,this.nodes.forEach(YN))})}c&&this.root.registerSharedNode(c,this),this.options.animate!==!1&&d&&(c||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()||d7,{onLayoutAnimationStart:E,onLayoutAnimationComplete:g}=d.getProps(),x=!this.targetLayout||!sL(this.targetLayout,m)||p,b=!h&&p;if(this.options.layoutRoot||this.resumeFrom&&this.resumeFrom.instance||b||h&&(x||!this.currentAnimation)){this.resumeFrom&&(this.resumingFrom=this.resumeFrom,this.resumingFrom.resumingFrom=void 0),this.setAnimationOrigin(f,b);const _={...cw(y,"layout"),onPlay:E,onComplete:g};(d.shouldReduceMotion||this.options.layoutRoot)&&(_.delay=0,_.type=!1),this.startAnimation(_)}else h||YN(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,Fa(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(o7),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&&iL(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 c=0;c{const k=_/1e3;WN(f.x,a.x,k),WN(f.y,a.y,k),this.setTargetDelta(f),this.relativeTarget&&this.relativeTargetOrigin&&this.layout&&this.relativeParent&&this.relativeParent.layout&&(sd(h,this.layout.layoutBox,this.relativeParent.layout.layoutBox),c7(this.relativeTarget,this.relativeTargetOrigin,h,k),b&&W$(this.relativeTarget,b)&&(this.isProjectionDirty=!1),b||(b=xn()),fs(b,this.relativeTarget)),y&&(this.animationValues=d,$$(d,u,this.latestValues,k,x,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&&(Fa(this.pendingAnimation),this.pendingAnimation=void 0),this.pendingAnimation=Gt.update(()=>{wp.hasAnimatedSinceResize=!0,this.currentAnimation=j$(0,VN,{...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(VN),this.currentAnimation.stop()),this.completeAnimation()}applyTransformsToTarget(){const a=this.getLead();let{targetWithTransforms:o,target:c,layout:u,latestValues:d}=a;if(!(!o||!c||!u)){if(this!==a&&this.layout&&u&&oL(this.options.animationType,this.layout.layoutBox,u.layoutBox)){c=this.target||xn();const f=rs(this.layout.layoutBox.x);c.x.min=a.target.x.min,c.x.max=c.x.min+f;const h=rs(this.layout.layoutBox.y);c.y.min=a.target.y.min,c.y.max=c.y.min+h}fs(o,c),Fl(o,d),rd(this.projectionDeltaWithTransform,this.layoutCorrected,o,d)}}registerSharedNode(a,o){this.sharedNodes.has(a)||this.sharedNodes.set(a,new G$),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:c}={}){const u=this.getStack();u&&u.promote(this,c),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:c}=a;if((c.z||c.rotate||c.rotateX||c.rotateY||c.rotateZ||c.skewX||c.skewY)&&(o=!0),!o)return;const u={};c.z&&fy("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(KN),this.root.sharedNodes.clear()}}}function Z$(e){e.updateLayout()}function J$(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"?hs(f=>{const h=a?n.measuredBox[f]:n.layoutBox[f],p=rs(h);h.min=r[f].min,h.max=h.min+p}):oL(i,n.layoutBox,r)&&hs(f=>{const h=a?n.measuredBox[f]:n.layoutBox[f],p=rs(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=Pl();rd(o,r,n.layoutBox);const c=Pl();a?rd(c,e.applyTransform(s,!0),n.measuredBox):rd(c,r,n.layoutBox);const u=!rL(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=xn();sd(m,n.layoutBox,h.layoutBox);const y=xn();sd(y,r,p.layoutBox),sL(m,y)||(d=!0),f.options.layoutRoot&&(e.relativeTarget=y,e.relativeTargetOrigin=m,e.relativeParent=f)}}}e.notifyListeners("didUpdate",{layout:r,snapshot:n,delta:c,layoutDelta:o,hasLayoutChanged:u,hasRelativeTargetChanged:d})}else if(e.isLead()){const{onExitComplete:r}=e.options;r&&r()}e.options.transition=void 0}function e7(e){Du&&oo.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 t7(e){e.isProjectionDirty=e.isSharedProjectionDirty=e.isTransformDirty=!1}function n7(e){e.clearSnapshot()}function KN(e){e.clearMeasurements()}function r7(e){e.isLayoutDirty=!1}function s7(e){const{visualElement:t}=e.options;t&&t.getProps().onBeforeLayoutMeasure&&t.notify("BeforeLayoutMeasure"),e.resetTransform()}function YN(e){e.finishAnimation(),e.targetDelta=e.relativeTarget=e.target=void 0,e.isProjectionDirty=!0}function i7(e){e.resolveTargetDelta()}function a7(e){e.calcProjection()}function o7(e){e.resetSkewAndRotation()}function l7(e){e.removeLeadSnapshot()}function WN(e,t,n){e.translate=cn(t.translate,0,n),e.scale=cn(t.scale,1,n),e.origin=t.origin,e.originPoint=t.originPoint}function GN(e,t,n,r){e.min=cn(t.min,n.min,r),e.max=cn(t.max,n.max,r)}function c7(e,t,n,r){GN(e.x,t.x,n.x,r),GN(e.y,t.y,n.y,r)}function u7(e){return e.animationValues&&e.animationValues.opacityExit!==void 0}const d7={duration:.45,ease:[.4,0,.1,1]},qN=e=>typeof navigator<"u"&&navigator.userAgent&&navigator.userAgent.toLowerCase().includes(e),XN=qN("applewebkit/")&&!qN("chrome/")?Math.round:es;function QN(e){e.min=XN(e.min),e.max=XN(e.max)}function f7(e){QN(e.x),QN(e.y)}function oL(e,t,n){return e==="position"||e==="preserve-aspect"&&!m$(HN(t),HN(n),.2)}function h7(e){var t;return e!==e.root&&((t=e.scroll)===null||t===void 0?void 0:t.wasRoot)}const p7=aL({attachResizeListener:(e,t)=>zd(e,"resize",t),measureScroll:()=>({x:document.documentElement.scrollLeft||document.body.scrollLeft,y:document.documentElement.scrollTop||document.body.scrollTop}),checkIsScrollRoot:()=>!0}),hy={current:void 0},lL=aL({measureScroll:e=>({x:e.scrollLeft,y:e.scrollTop}),defaultParent:()=>{if(!hy.current){const e=new p7({});e.mount(window),e.setOptions({layoutScroll:!0}),hy.current=e}return hy.current},resetTransform:(e,t)=>{e.style.transform=t!==void 0?t:"none"},checkIsScrollRoot:e=>window.getComputedStyle(e).position==="fixed"}),m7={pan:{Feature:O$},drag:{Feature:I$,ProjectionNode:lL,MeasureLayout:eL}};function g7(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 cL(e,t){const n=g7(e),r=new AbortController,s={passive:!0,...t,signal:r.signal};return[n,s,()=>r.abort()]}function ZN(e){return t=>{t.pointerType==="touch"||VR()||e(t)}}function y7(e,t,n={}){const[r,s,i]=cL(e,n),a=ZN(o=>{const{target:c}=o,u=t(o);if(typeof u!="function"||!c)return;const d=ZN(f=>{u(f),c.removeEventListener("pointerleave",d)});c.addEventListener("pointerleave",d,s)});return r.forEach(o=>{o.addEventListener("pointerenter",a,s)}),i}function JN(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&&Gt.postRender(()=>i(t,_f(t)))}class b7 extends Va{mount(){const{current:t}=this.node;t&&(this.unmount=y7(t,n=>(JN(this.node,n,"Start"),r=>JN(this.node,r,"End"))))}unmount(){}}class E7 extends Va{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=vf(zd(this.node.current,"focus",()=>this.onFocus()),zd(this.node.current,"blur",()=>this.onBlur()))}unmount(){}}const uL=(e,t)=>t?e===t?!0:uL(e,t.parentElement):!1,x7=new Set(["BUTTON","INPUT","SELECT","TEXTAREA","A"]);function w7(e){return x7.has(e.tagName)||e.tabIndex!==-1}const Pu=new WeakSet;function eS(e){return t=>{t.key==="Enter"&&e(t)}}function py(e,t){e.dispatchEvent(new PointerEvent("pointer"+t,{isPrimary:!0,bubbles:!0}))}const v7=(e,t)=>{const n=e.currentTarget;if(!n)return;const r=eS(()=>{if(Pu.has(n))return;py(n,"down");const s=eS(()=>{py(n,"up")}),i=()=>py(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 tS(e){return Nw(e)&&!VR()}function _7(e,t,n={}){const[r,s,i]=cL(e,n),a=o=>{const c=o.currentTarget;if(!tS(o)||Pu.has(c))return;Pu.add(c);const u=t(o),d=(p,m)=>{window.removeEventListener("pointerup",f),window.removeEventListener("pointercancel",h),!(!tS(p)||!Pu.has(c))&&(Pu.delete(c),typeof u=="function"&&u(p,{success:m}))},f=p=>{d(p,n.useGlobalTarget||uL(c,p.target))},h=p=>{d(p,!1)};window.addEventListener("pointerup",f,s),window.addEventListener("pointercancel",h,s)};return r.forEach(o=>{!w7(o)&&o.getAttribute("tabindex")===null&&(o.tabIndex=0),(n.useGlobalTarget?window:o).addEventListener("pointerdown",a,s),o.addEventListener("focus",u=>v7(u,s),s)}),i}function nS(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&&Gt.postRender(()=>i(t,_f(t)))}class k7 extends Va{mount(){const{current:t}=this.node;t&&(this.unmount=_7(t,n=>(nS(this.node,n,"Start"),(r,{success:s})=>nS(this.node,r,s?"End":"Cancel")),{useGlobalTarget:this.node.props.globalTapTarget}))}unmount(){}}const D1=new WeakMap,my=new WeakMap,N7=e=>{const t=D1.get(e.target);t&&t(e)},S7=e=>{e.forEach(N7)};function T7({root:e,...t}){const n=e||document;my.has(n)||my.set(n,{});const r=my.get(n),s=JSON.stringify(t);return r[s]||(r[s]=new IntersectionObserver(S7,{root:e,...t})),r[s]}function A7(e,t,n){const r=T7(t);return D1.set(e,n),r.observe(e),()=>{D1.delete(e),r.unobserve(e)}}const C7={some:0,all:1};class I7 extends Va{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:C7[s]},o=c=>{const{isIntersecting:u}=c;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(c)};return A7(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(O7(t,n))&&this.startObserver()}unmount(){}}function O7({viewport:e={}},{viewport:t={}}={}){return n=>e[n]!==t[n]}const R7={inView:{Feature:I7},tap:{Feature:k7},focus:{Feature:E7},hover:{Feature:b7}},L7={layout:{ProjectionNode:lL,MeasureLayout:eL}},P1={current:null},dL={current:!1};function M7(){if(dL.current=!0,!!qx)if(window.matchMedia){const e=window.matchMedia("(prefers-reduced-motion)"),t=()=>P1.current=e.matches;e.addListener(t),t()}else P1.current=!1}const j7=[...RR,dr,Ua],D7=e=>j7.find(OR(e)),rS=new WeakMap;function P7(e,t,n){for(const r in t){const s=t[r],i=n[r];if(hr(s))e.addValue(r,s);else if(hr(i))e.addValue(r,$d(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,$d(a!==void 0?a:s,{owner:e}))}}for(const r in n)t[r]===void 0&&e.removeValue(r);return t}const sS=["AnimationStart","AnimationComplete","Update","BeforeLayoutMeasure","LayoutMeasure","LayoutAnimationStart","LayoutAnimationComplete"];class B7{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=ww,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=Ei.now();this.renderScheduledAtthis.bindToMotionValue(r,n)),dL.current||M7(),this.shouldReduceMotion=this.reducedMotionConfig==="never"?!1:this.reducedMotionConfig==="always"?!0:P1.current,this.parent&&this.parent.children.add(this),this.update(this.props,this.presenceContext)}unmount(){rS.delete(this.current),this.projection&&this.projection.unmount(),Fa(this.notifyUpdate),Fa(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=Go.has(t),s=n.on("change",o=>{this.latestValues[t]=o,this.props.onUpdate&&Gt.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 gc){const n=gc[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):xn()}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=$d(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"&&(CR(s)||xR(s))?s=parseFloat(s):!D7(s)&&Ua.test(n)&&(s=SR(t,n)),this.setBaseTarget(t,hr(s)?s.get():s)),hr(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=tw(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&&!hr(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 fw),this.events[t].add(n)}notify(t,...n){this.events[t]&&this.events[t].notify(...n)}}class fL extends B7{constructor(){super(...arguments),this.KeyframeResolver=LR}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;hr(t)&&(this.childSubscription=t.on("change",n=>{this.current&&(this.current.textContent=`${n}`)}))}}function F7(e){return window.getComputedStyle(e)}class U7 extends fL{constructor(){super(...arguments),this.type="html",this.renderInstance=JO}readValueFromInstance(t,n){if(Go.has(n)){const r=xw(n);return r&&r.default||0}else{const r=F7(t),s=(XO(n)?r.getPropertyValue(n):r[n])||0;return typeof s=="string"?s.trim():s}}measureInstanceViewportBox(t,{transformPagePoint:n}){return ZR(t,n)}build(t,n,r){sw(t,n,r.transformTemplate)}scrapeMotionValuesFromProps(t,n,r){return lw(t,n,r)}}class $7 extends fL{constructor(){super(...arguments),this.type="svg",this.isSVGTag=!1,this.measureInstanceViewportBox=xn}getBaseTargetFromProps(t,n){return t[n]}readValueFromInstance(t,n){if(Go.has(n)){const r=xw(n);return r&&r.default||0}return n=eR.has(n)?n:Zx(n),t.getAttribute(n)}scrapeMotionValuesFromProps(t,n,r){return rR(t,n,r)}build(t,n,r){iw(t,n,this.isSVGTag,r.transformTemplate)}renderInstance(t,n,r,s){tR(t,n,r,s)}mount(t){this.isSVGTag=ow(t.tagName),super.mount(t)}}const H7=(e,t)=>ew(e)?new $7(t):new U7(t,{allowProjection:e!==w.Fragment}),z7=p9({...i$,...R7,...m7,...L7},H7),$t=CF(z7);function Pn(){return Pn=Object.assign?Object.assign.bind():function(e){for(var t=1;t"u"||/ServerSideRendering/.test(navigator&&navigator.userAgent)?w.useEffect:w.useLayoutEffect;function bl(e,t,n){var r=w.useRef(t);r.current=t,w.useEffect(function(){function s(i){r.current(i)}return e&&window.addEventListener(e,s,n),function(){e&&window.removeEventListener(e,s)}},[e])}var V7=["container"];function K7(e){var t=e.container,n=t===void 0?document.body:t,r=Tg(e,V7);return Ss.createPortal(dt.createElement("div",Pn({},r)),n)}function Y7(e){return dt.createElement("svg",Pn({width:"44",height:"44",viewBox:"0 0 768 768"},e),dt.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 W7(e){return dt.createElement("svg",Pn({width:"44",height:"44",viewBox:"0 0 768 768"},e),dt.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 G7(e){return dt.createElement("svg",Pn({width:"44",height:"44",viewBox:"0 0 768 768"},e),dt.createElement("path",{d:"M384 127.5l256.5 256.5-256.5 256.5-45-45 178.5-180h-390v-63h390l-178.5-180z"}))}function q7(){return w.useEffect(function(){var e=document.body.style,t=e.overflow;return e.overflow="hidden",function(){e.overflow=t}},[]),null}function aS(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 ba=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 gy(e,t,n,r,s,i,a,o,c,u){a===void 0&&(a=innerWidth/2),o===void 0&&(o=innerHeight/2),c===void 0&&(c=0),u===void 0&&(u=0);var d=ba(e,i,n,innerWidth)[0],f=ba(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?c/2:c),y:o-i/s*(o-(p+t))-p+(f[0]?u/2:u),lastCX:a,lastCY:o}}function U1(e,t,n){var r=e%180!=0;return r?[n,t,r]:[t,n,r]}function yy(e,t,n){var r=U1(n,innerWidth,innerHeight),s=r[0],i=r[1],a=0,o=s,c=i,u=e/t*i,d=t/e*s;return e=i?o=u:e>=s&&ts/i?c=d:t/e>=3&&!r[2]?a=((c=d)-i)/2:o=u,{width:o,height:c,x:0,y:a,pause:!0}}function Ih(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=w.useRef(e);o.current=e;var c=w.useRef(0),u=w.useRef(),d=function(){return u.current&&clearTimeout(u.current)},f=w.useCallback(function(){var h=[].slice.call(arguments),p=Date.now();function m(){c.current=p,d(),o.current.apply(null,h)}var y=c.current,E=p-y;if(y===0&&(r&&m(),c.current=p),s!==void 0){if(E>s)return void m()}else E=1&&i&&i())};d()}function d(){c=requestAnimationFrame(u)}}var Q7={T:0,L:0,W:0,H:0,FIT:void 0},pL=function(){var e=w.useRef(!1);return w.useEffect(function(){return e.current=!0,function(){e.current=!1}},[]),e},Z7=["className"];function J7(e){var t=e.className,n=t===void 0?"":t,r=Tg(e,Z7);return dt.createElement("div",Pn({className:"PhotoView__Spinner "+n},r),dt.createElement("svg",{viewBox:"0 0 32 32",width:"36",height:"36",fill:"white"},dt.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"}),dt.createElement("path",{d:"M16 0 A16 16 0 0 1 32 16 L28 16 A12 12 0 0 0 16 4z"})))}var eH=["src","loaded","broken","className","onPhotoLoad","loadingElement","brokenElement"];function tH(e){var t=e.src,n=e.loaded,r=e.broken,s=e.className,i=e.onPhotoLoad,a=e.loadingElement,o=e.brokenElement,c=Tg(e,eH),u=pL();return t&&!r?dt.createElement(dt.Fragment,null,dt.createElement("img",Pn({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:""},c)),!n&&(a?dt.createElement("span",{className:"PhotoView__icon"},a):dt.createElement(J7,{className:"PhotoView__icon"}))):o?dt.createElement("span",{className:"PhotoView__icon"},typeof o=="function"?o({src:t}):o):null}var nH={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 rH(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,c=t.originRef,u=e.visible,d=e.speed,f=e.easing,h=e.wrapClassName,p=e.className,m=e.style,y=e.loadingElement,E=e.brokenElement,g=e.onPhotoTap,x=e.onMaskTap,b=e.onReachMove,_=e.onReachUp,k=e.onPhotoResize,N=e.isActive,C=e.expose,S=Em(nH),A=S[0],O=S[1],D=w.useRef(0),U=pL(),X=A.naturalWidth,M=X===void 0?i:X,j=A.naturalHeight,T=j===void 0?o:j,L=A.width,R=L===void 0?i:L,F=A.height,I=F===void 0?o:F,V=A.loaded,W=V===void 0?!n:V,P=A.broken,ie=A.x,G=A.y,re=A.touched,ue=A.stopRaf,ee=A.maskTouched,le=A.rotate,ne=A.scale,me=A.CX,ye=A.CY,te=A.lastX,de=A.lastY,Ee=A.lastCX,Te=A.lastCY,Ke=A.lastScale,Ne=A.touchTime,it=A.touchLength,He=A.pause,Ue=A.reach,Et=So({onScale:function(fe){return rt(Ch(fe))},onRotate:function(fe){le!==fe&&(C({rotate:fe}),O(Pn({rotate:fe},yy(M,T,fe))))}});function rt(fe,$e,nt){ne!==fe&&(C({scale:fe}),O(Pn({scale:fe},gy(ie,G,R,I,ne,fe,$e,nt),fe<=1&&{x:0,y:0})))}var St=Ih(function(fe,$e,nt){if(nt===void 0&&(nt=0),(re||ee)&&N){var qt=U1(le,R,I),fn=qt[0],Lt=qt[1];if(nt===0&&D.current===0){var J=Math.abs(fe-me)<=20,he=Math.abs($e-ye)<=20;if(J&&he)return void O({lastCX:fe,lastCY:$e});D.current=J?$e>ye?3:2:1}var Le,Be=fe-Ee,ot=$e-Te;if(nt===0){var It=ba(Be+te,ne,fn,innerWidth)[0],st=ba(ot+de,ne,Lt,innerHeight);Le=function(we,_e,We,Ve){return _e&&we===1||Ve==="x"?"x":We&&we>1||Ve==="y"?"y":void 0}(D.current,It,st[0],Ue),Le!==void 0&&b(Le,fe,$e,ne)}if(Le==="x"||ee)return void O({reach:"x"});var Z=Ch(ne+(nt-it)/100/2*ne,M/R,.2);C({scale:Z}),O(Pn({touchLength:nt,reach:Le,scale:Z},gy(ie,G,R,I,ne,Z,fe,$e,Be,ot)))}},{maxWait:8});function ct(fe){return!ue&&!re&&(U.current&&O(Pn({},fe,{pause:u})),U.current)}var B,Q,oe,be,Oe,Ye,tt,ze,Tt=(Oe=function(fe){return ct({x:fe})},Ye=function(fe){return ct({y:fe})},tt=function(fe){return U.current&&(C({scale:fe}),O({scale:fe})),!re&&U.current},ze=So({X:function(fe){return Oe(fe)},Y:function(fe){return Ye(fe)},S:function(fe){return tt(fe)}}),function(fe,$e,nt,qt,fn,Lt,J,he,Le,Be,ot){var It=U1(Be,fn,Lt),st=It[0],Z=It[1],we=ba(fe,he,st,innerWidth),_e=we[0],We=we[1],Ve=ba($e,he,Z,innerHeight),Je=Ve[0],ut=Ve[1],Vt=Date.now()-ot;if(Vt>=200||he!==J||Math.abs(Le-J)>1){var Ft=gy(fe,$e,fn,Lt,J,he),hn=Ft.x,Tn=Ft.y,Kt=_e?We:hn!==fe?hn:null,os=Je?ut:Tn!==$e?Tn:null;return Kt!==null&&fo(fe,Kt,ze.X),os!==null&&fo($e,os,ze.Y),void(he!==J&&fo(J,he,ze.S))}var Er=(fe-nt)/Vt,Xn=($e-qt)/Vt,Or=Math.sqrt(Math.pow(Er,2)+Math.pow(Xn,2)),Qn=!1,ar=!1;(function(An,Xt){var En,Un=An,or=0,nn=0,ls=function(Jn){En||(En=Jn);var Is=Jn-En,Rr=Math.sign(An),xr=-.001*Rr,cs=Math.sign(-Un)*Math.pow(Un,2)*2e-4,Kr=Un*Is+(xr+cs)*Math.pow(Is,2)/2;or+=Kr,En=Jn,Rr*(Un+=(xr+cs)*Is)<=0?$n():Xt(or)?Zn():$n()};function Zn(){nn=requestAnimationFrame(ls)}function $n(){cancelAnimationFrame(nn)}Zn()})(Or,function(An){var Xt=fe+An*(Er/Or),En=$e+An*(Xn/Or),Un=ba(Xt,J,st,innerWidth),or=Un[0],nn=Un[1],ls=ba(En,J,Z,innerHeight),Zn=ls[0],$n=ls[1];if(or&&!Qn&&(Qn=!0,_e?fo(Xt,nn,ze.X):oS(nn,Xt+(Xt-nn),ze.X)),Zn&&!ar&&(ar=!0,Je?fo(En,$n,ze.Y):oS($n,En+(En-$n),ze.Y)),Qn&&ar)return!1;var Jn=Qn||ze.X(nn),Is=ar||ze.Y($n);return Jn&&Is})}),Re=(B=g,Q=function(fe,$e){Ue||rt(ne!==1?1:Math.max(2,M/R),fe,$e)},oe=w.useRef(0),be=Ih(function(){oe.current=0,B.apply(void 0,[].slice.call(arguments))},{wait:300}),function(){var fe=[].slice.call(arguments);oe.current+=1,be.apply(void 0,fe),oe.current>=2&&(be.cancel(),oe.current=0,Q.apply(void 0,fe))});function kt(fe,$e){if(D.current=0,(re||ee)&&N){O({touched:!1,maskTouched:!1,pause:!1,stopRaf:!1,reach:void 0});var nt=Ch(ne,M/R);if(Tt(ie,G,te,de,R,I,ne,nt,Ke,le,Ne),_(fe,$e),me===fe&&ye===$e){if(re)return void Re(fe,$e);ee&&x(fe,$e)}}}function Pt(fe,$e,nt){nt===void 0&&(nt=0),O({touched:!0,CX:fe,CY:$e,lastCX:fe,lastCY:$e,lastX:ie,lastY:G,lastScale:ne,touchLength:nt,touchTime:Date.now()})}function Bt(fe){O({maskTouched:!0,CX:fe.clientX,CY:fe.clientY,lastX:ie,lastY:G})}bl(Pi?void 0:"mousemove",function(fe){fe.preventDefault(),St(fe.clientX,fe.clientY)}),bl(Pi?void 0:"mouseup",function(fe){kt(fe.clientX,fe.clientY)}),bl(Pi?"touchmove":void 0,function(fe){fe.preventDefault();var $e=aS(fe);St.apply(void 0,$e)},{passive:!1}),bl(Pi?"touchend":void 0,function(fe){var $e=fe.changedTouches[0];kt($e.clientX,$e.clientY)},{passive:!1}),bl("resize",Ih(function(){W&&!re&&(O(yy(M,T,le)),k())},{maxWait:8})),F1(function(){N&&C(Pn({scale:ne,rotate:le},Et))},[N]);var bn=function(fe,$e,nt,qt,fn,Lt,J,he,Le,Be){var ot=function(hn,Tn,Kt,os,Er){var Xn=w.useRef(!1),Or=Em({lead:!0,scale:Kt}),Qn=Or[0],ar=Qn.lead,An=Qn.scale,Xt=Or[1],En=Ih(function(Un){try{return Er(!0),Xt({lead:!1,scale:Un}),Promise.resolve()}catch(or){return Promise.reject(or)}},{wait:os});return F1(function(){Xn.current?(Er(!1),Xt({lead:!0}),En(Kt)):Xn.current=!0},[Kt]),ar?[hn*An,Tn*An,Kt/An]:[hn*Kt,Tn*Kt,1]}(Lt,J,he,Le,Be),It=ot[0],st=ot[1],Z=ot[2],we=function(hn,Tn,Kt,os,Er){var Xn=w.useState(Q7),Or=Xn[0],Qn=Xn[1],ar=w.useState(0),An=ar[0],Xt=ar[1],En=w.useRef(),Un=So({OK:function(){return hn&&Xt(4)}});function or(nn){Er(!1),Xt(nn)}return w.useEffect(function(){if(En.current||(En.current=Date.now()),Kt){if(function(nn,ls){var Zn=nn&&nn.current;if(Zn&&Zn.nodeType===1){var $n=Zn.getBoundingClientRect();ls({T:$n.top,L:$n.left,W:$n.width,H:$n.height,FIT:Zn.tagName==="IMG"?getComputedStyle(Zn).objectFit:void 0})}}(Tn,Qn),hn)return Date.now()-En.current<250?(Xt(1),requestAnimationFrame(function(){Xt(2),requestAnimationFrame(function(){return or(3)})}),void setTimeout(Un.OK,os)):void Xt(4);or(5)}},[hn,Kt]),[An,Or]}(fe,$e,nt,Le,Be),_e=we[0],We=we[1],Ve=We.W,Je=We.FIT,ut=innerWidth/2,Vt=innerHeight/2,Ft=_e<3||_e>4;return[Ft?Ve?We.L:ut:qt+(ut-Lt*he/2),Ft?Ve?We.T:Vt:fn+(Vt-J*he/2),It,Ft&&Je?It*(We.H/Ve):st,_e===0?Z:Ft?Ve/(Lt*he)||.01:Z,Ft?Je?1:0:1,_e,Je]}(u,c,W,ie,G,R,I,ne,d,function(fe){return O({pause:fe})}),Xe=bn[4],ft=bn[6],xt="transform "+d+"ms "+f,vt={className:p,onMouseDown:Pi?void 0:function(fe){fe.stopPropagation(),fe.button===0&&Pt(fe.clientX,fe.clientY,0)},onTouchStart:Pi?function(fe){fe.stopPropagation(),Pt.apply(void 0,aS(fe))}:void 0,onWheel:function(fe){if(!Ue){var $e=Ch(ne-fe.deltaY/100/2,M/R);O({stopRaf:!0}),rt($e,fe.clientX,fe.clientY)}},style:{width:bn[2]+"px",height:bn[3]+"px",opacity:bn[5],objectFit:ft===4?void 0:bn[7],transform:le?"rotate("+le+"deg)":void 0,transition:ft>2?xt+", opacity "+d+"ms ease, height "+(ft<4?d/2:ft>4?d:0)+"ms "+f:void 0}};return dt.createElement("div",{className:"PhotoView__PhotoWrap"+(h?" "+h:""),style:m,onMouseDown:!Pi&&N?Bt:void 0,onTouchStart:Pi&&N?function(fe){return Bt(fe.touches[0])}:void 0},dt.createElement("div",{className:"PhotoView__PhotoBox",style:{transform:"matrix("+Xe+", 0, 0, "+Xe+", "+bn[0]+", "+bn[1]+")",transition:re||He?void 0:xt,willChange:N?"transform":void 0}},n?dt.createElement(tH,Pn({src:n,loaded:W,broken:P},vt,{onPhotoLoad:function(fe){O(Pn({},fe,fe.loaded&&yy(fe.naturalWidth||0,fe.naturalHeight||0,le)))},loadingElement:y,brokenElement:E})):r&&r({attrs:vt,scale:Xe,rotate:le})))}var lS={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 sH(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,c=e.maskOpacity,u=c===void 0?1:c,d=e.pullClosable,f=d===void 0||d,h=e.bannerVisible,p=h===void 0||h,m=e.overlayRender,y=e.toolbarRender,E=e.className,g=e.maskClassName,x=e.photoClassName,b=e.photoWrapClassName,_=e.loadingElement,k=e.brokenElement,N=e.images,C=e.index,S=C===void 0?0:C,A=e.onIndexChange,O=e.visible,D=e.onClose,U=e.afterClose,X=e.portalContainer,M=Em(lS),j=M[0],T=M[1],L=w.useState(0),R=L[0],F=L[1],I=j.x,V=j.touched,W=j.pause,P=j.lastCX,ie=j.lastCY,G=j.bg,re=G===void 0?u:G,ue=j.lastBg,ee=j.overlay,le=j.minimal,ne=j.scale,me=j.rotate,ye=j.onScale,te=j.onRotate,de=e.hasOwnProperty("index"),Ee=de?S:R,Te=de?A:F,Ke=w.useRef(Ee),Ne=N.length,it=N[Ee],He=typeof n=="boolean"?n:Ne>n,Ue=function(Xe,ft){var xt=w.useReducer(function(nt){return!nt},!1)[1],vt=w.useRef(0),fe=function(nt){var qt=w.useRef(nt);function fn(Lt){qt.current=Lt}return w.useMemo(function(){(function(Lt){Xe?(Lt(Xe),vt.current=1):vt.current=2})(fn)},[nt]),[qt.current,fn]}(Xe),$e=fe[1];return[fe[0],vt.current,function(){xt(),vt.current===2&&($e(!1),ft&&ft()),vt.current=0}]}(O,U),Et=Ue[0],rt=Ue[1],St=Ue[2];F1(function(){if(Et)return T({pause:!0,x:Ee*-(innerWidth+ul)}),void(Ke.current=Ee);T(lS)},[Et]);var ct=So({close:function(Xe){te&&te(0),T({overlay:!0,lastBg:re}),D(Xe)},changeIndex:function(Xe,ft){ft===void 0&&(ft=!1);var xt=He?Ke.current+(Xe-Ee):Xe,vt=Ne-1,fe=B1(xt,0,vt),$e=He?xt:fe,nt=innerWidth+ul;T({touched:!1,lastCX:void 0,lastCY:void 0,x:-nt*$e,pause:ft}),Ke.current=$e,Te&&Te(He?Xe<0?vt:Xe>vt?0:Xe:fe)}}),B=ct.close,Q=ct.changeIndex;function oe(Xe){return Xe?B():T({overlay:!ee})}function be(){T({x:-(innerWidth+ul)*Ee,lastCX:void 0,lastCY:void 0,pause:!0}),Ke.current=Ee}function Oe(Xe,ft,xt,vt){Xe==="x"?function(fe){if(P!==void 0){var $e=fe-P,nt=$e;!He&&(Ee===0&&$e>0||Ee===Ne-1&&$e<0)&&(nt=$e/2),T({touched:!0,lastCX:P,x:-(innerWidth+ul)*Ke.current+nt,pause:!1})}else T({touched:!0,lastCX:fe,x:I,pause:!1})}(ft):Xe==="y"&&function(fe,$e){if(ie!==void 0){var nt=u===null?null:B1(u,.01,u-Math.abs(fe-ie)/100/4);T({touched:!0,lastCY:ie,bg:$e===1?nt:u,minimal:$e===1})}else T({touched:!0,lastCY:fe,bg:re,minimal:!0})}(xt,vt)}function Ye(Xe,ft){var xt=Xe-(P??Xe),vt=ft-(ie??ft),fe=!1;if(xt<-40)Q(Ee+1);else if(xt>40)Q(Ee-1);else{var $e=-(innerWidth+ul)*Ke.current;Math.abs(vt)>100&&le&&f&&(fe=!0,B()),T({touched:!1,x:$e,lastCX:void 0,lastCY:void 0,bg:u,overlay:!!fe||ee})}}bl("keydown",function(Xe){if(O)switch(Xe.key){case"ArrowLeft":Q(Ee-1,!0);break;case"ArrowRight":Q(Ee+1,!0);break;case"Escape":B()}});var tt=function(Xe,ft,xt){return w.useMemo(function(){var vt=Xe.length;return xt?Xe.concat(Xe).concat(Xe).slice(vt+ft-1,vt+ft+2):Xe.slice(Math.max(ft-1,0),Math.min(ft+2,vt+1))},[Xe,ft,xt])}(N,Ee,He);if(!Et)return null;var ze=ee&&!rt,Tt=O?re:ue,Re=ye&&te&&{images:N,index:Ee,visible:O,onClose:B,onIndexChange:Q,overlayVisible:ze,overlay:it&&it.overlay,scale:ne,rotate:me,onScale:ye,onRotate:te},kt=r?r(rt):400,Pt=s?s(rt):iS,Bt=r?r(3):600,bn=s?s(3):iS;return dt.createElement(K7,{className:"PhotoView-Portal"+(ze?"":" PhotoView-Slider__clean")+(O?"":" PhotoView-Slider__willClose")+(E?" "+E:""),role:"dialog",onClick:function(Xe){return Xe.stopPropagation()},container:X},O&&dt.createElement(q7,null),dt.createElement("div",{className:"PhotoView-Slider__Backdrop"+(g?" "+g:"")+(rt===1?" PhotoView-Slider__fadeIn":rt===2?" PhotoView-Slider__fadeOut":""),style:{background:Tt?"rgba(0, 0, 0, "+Tt+")":void 0,transitionTimingFunction:Pt,transitionDuration:(V?0:kt)+"ms",animationDuration:kt+"ms"},onAnimationEnd:St}),p&&dt.createElement("div",{className:"PhotoView-Slider__BannerWrap"},dt.createElement("div",{className:"PhotoView-Slider__Counter"},Ee+1," / ",Ne),dt.createElement("div",{className:"PhotoView-Slider__BannerRight"},y&&Re&&y(Re),dt.createElement(Y7,{className:"PhotoView-Slider__toolbarIcon",onClick:B}))),tt.map(function(Xe,ft){var xt=He||Ee!==0?Ke.current-1+ft:Ee+ft;return dt.createElement(rH,{key:He?Xe.key+"/"+Xe.src+"/"+xt:Xe.key,item:Xe,speed:kt,easing:Pt,visible:O,onReachMove:Oe,onReachUp:Ye,onPhotoTap:function(){return oe(i)},onMaskTap:function(){return oe(o)},wrapClassName:b,className:x,style:{left:(innerWidth+ul)*xt+"px",transform:"translate3d("+I+"px, 0px, 0)",transition:V||W?void 0:"transform "+Bt+"ms "+bn},loadingElement:_,brokenElement:k,onPhotoResize:be,isActive:Ke.current===xt,expose:T})}),!Pi&&p&&dt.createElement(dt.Fragment,null,(He||Ee!==0)&&dt.createElement("div",{className:"PhotoView-Slider__ArrowLeft",onClick:function(){return Q(Ee-1,!0)}},dt.createElement(W7,null)),(He||Ee+1-1){var g=u.slice();return g.splice(E,1,y),void o({images:g})}o(function(x){return{images:x.images.concat(y)}})},remove:function(y){o(function(E){var g=E.images.filter(function(x){return x.key!==y});return{images:g,index:Math.min(g.length-1,f)}})},show:function(y){var E=u.findIndex(function(g){return g.key===y});o({visible:!0,index:E}),r&&r(!0,E,a)}}),p=So({close:function(){o({visible:!1}),r&&r(!1,f,a)},changeIndex:function(y){o({index:y}),n&&n(y,a)}}),m=w.useMemo(function(){return Pn({},a,h)},[a,h]);return dt.createElement(hL.Provider,{value:m},t,dt.createElement(sH,Pn({images:u,visible:d,index:f,onIndexChange:p.changeIndex,onClose:p.close},s)))}var mL=function(e){var t,n,r=e.src,s=e.render,i=e.overlay,a=e.width,o=e.height,c=e.triggers,u=c===void 0?["onClick"]:c,d=e.children,f=w.useContext(hL),h=(t=function(){return f.nextId()},(n=w.useRef({sign:!1,fn:void 0}).current).sign||(n.sign=!0,n.fn=t()),n.fn),p=w.useRef(null);w.useImperativeHandle(d==null?void 0:d.ref,function(){return p.current}),w.useEffect(function(){return function(){f.remove(h)}},[]);var m=So({render:function(E){return s&&s(E)},show:function(E,g){f.show(h),function(x,b){if(d){var _=d.props[x];_&&_(b)}}(E,g)}}),y=w.useMemo(function(){var E={};return u.forEach(function(g){E[g]=m.show.bind(null,g)}),E},[]);return w.useEffect(function(){f.update({key:h,src:r,originRef:p,render:m.render,overlay:i,width:a,height:o})},[r]),d?w.Children.only(w.cloneElement(d,Pn({},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 lH=e=>e.replace(/([a-z0-9])([A-Z])/g,"$1-$2").toLowerCase(),gL=(...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 cH={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 uH=w.forwardRef(({color:e="currentColor",size:t=24,strokeWidth:n=2,absoluteStrokeWidth:r,className:s="",children:i,iconNode:a,...o},c)=>w.createElement("svg",{ref:c,...cH,width:t,height:t,stroke:e,strokeWidth:r?Number(n)*24/Number(t):n,className:gL("lucide",s),...o},[...a.map(([u,d])=>w.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 Ie=(e,t)=>{const n=w.forwardRef(({className:r,...s},i)=>w.createElement(uH,{ref:i,iconNode:t,className:gL(`lucide-${lH(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 dH=Ie("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 yL=Ie("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 bL=Ie("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 id=Ie("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 EL=Ie("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 xL=Ie("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 fH=Ie("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 Do=Ie("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 wL=Ie("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 hH=Ie("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 pH=Ie("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 Js=Ie("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 Sw=Ie("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 mH=Ie("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 ws=Ie("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 Ag=Ie("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 vL=Ie("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 $1=Ie("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 gH=Ie("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 Tw=Ie("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 Aw=Ie("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 yH=Ie("CornerDownRight",[["polyline",{points:"15 10 20 15 15 20",key:"1q7qjw"}],["path",{d:"M4 4v7a4 4 0 0 0 4 4h12",key:"z08zvw"}]]);/** - * @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 bH=Ie("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 vp=Ie("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 Cw=Ie("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 EH=Ie("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. - * See the LICENSE file in the root directory of this source tree. - */const Iw=Ie("ExternalLink",[["path",{d:"M15 3h6v6",key:"1q9fwt"}],["path",{d:"M10 14 21 3",key:"gplh6r"}],["path",{d:"M18 13v6a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2V8a2 2 0 0 1 2-2h6",key:"a6xqqp"}]]);/** - * @license lucide-react v0.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 xH=Ie("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. - * See the LICENSE file in the root directory of this source tree. - */const _L=Ie("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. - * See the LICENSE file in the root directory of this source tree. - */const wH=Ie("FileArchive",[["path",{d:"M10 12v-1",key:"v7bkov"}],["path",{d:"M10 18v-2",key:"1cjy8d"}],["path",{d:"M10 7V6",key:"dljcrl"}],["path",{d:"M14 2v4a2 2 0 0 0 2 2h4",key:"tnqrlb"}],["path",{d:"M15.5 22H18a2 2 0 0 0 2-2V7l-5-5H6a2 2 0 0 0-2 2v16a2 2 0 0 0 .274 1.01",key:"gkbcor"}],["circle",{cx:"10",cy:"20",r:"2",key:"1xzdoj"}]]);/** - * @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 cS=Ie("FileCode2",[["path",{d:"M4 22h14a2 2 0 0 0 2-2V7l-5-5H6a2 2 0 0 0-2 2v4",key:"1pf5j1"}],["path",{d:"M14 2v4a2 2 0 0 0 2 2h4",key:"tnqrlb"}],["path",{d:"m5 12-3 3 3 3",key:"oke12k"}],["path",{d:"m9 18 3-3-3-3",key:"112psh"}]]);/** - * @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 vH=Ie("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 _H=Ie("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 kL=Ie("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 kH=Ie("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 NL=Ie("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 NH=Ie("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 SH=Ie("FlaskConical",[["path",{d:"M10 2v7.527a2 2 0 0 1-.211.896L4.72 20.55a1 1 0 0 0 .9 1.45h12.76a1 1 0 0 0 .9-1.45l-5.069-10.127A2 2 0 0 1 14 9.527V2",key:"pzvekw"}],["path",{d:"M8.5 2h7",key:"csnxdl"}],["path",{d:"M7 16h10",key:"wp8him"}]]);/** - * @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 TH=Ie("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 Ow=Ie("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 SL=Ie("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 AH=Ie("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 CH=Ie("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 Cg=Ie("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 IH=Ie("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 OH=Ie("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 TL=Ie("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 Ka=Ie("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 RH=Ie("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 AL=Ie("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 LH=Ie("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 CL=Ie("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 MH=Ie("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 Rt=Ie("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 jH=Ie("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 DH=Ie("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 tc=Ie("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 IL=Ie("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 PH=Ie("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 BH=Ie("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 FH=Ie("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 OL=Ie("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 UH=Ie("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 $H=Ie("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 HH=Ie("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 zH=Ie("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 rr=Ie("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 H1=Ie("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. - * See the LICENSE file in the root directory of this source tree. - */const Rw=Ie("Repeat",[["path",{d:"m17 2 4 4-4 4",key:"nntrym"}],["path",{d:"M3 11v-1a4 4 0 0 1 4-4h14",key:"84bu3i"}],["path",{d:"m7 22-4-4 4-4",key:"1wqhfi"}],["path",{d:"M21 13v1a4 4 0 0 1-4 4H3",key:"1rx37r"}]]);/** - * @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 VH=Ie("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 KH=Ie("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 Vd=Ie("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 YH=Ie("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 WH=Ie("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. - * See the LICENSE file in the root directory of this source tree. - */const uS=Ie("ShieldCheck",[["path",{d:"M20 13c0 5-3.5 7.5-7.66 8.95a1 1 0 0 1-.67-.01C7.5 20.5 4 18 4 13V6a1 1 0 0 1 1-1c2 0 4.5-1.2 6.24-2.72a1.17 1.17 0 0 1 1.52 0C14.51 3.81 17 5 19 5a1 1 0 0 1 1 1z",key:"oel41y"}],["path",{d:"m9 12 2 2 4-4",key:"dzmm74"}]]);/** - * @license lucide-react v0.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 Po=Ie("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 GH=Ie("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 ea=Ie("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 qH=Ie("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 XH=Ie("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 QH=Ie("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 ZH=Ie("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 JH=Ie("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. - * See the LICENSE file in the root directory of this source tree. - */const RL=Ie("Wrench",[["path",{d:"M14.7 6.3a1 1 0 0 0 0 1.4l1.6 1.6a1 1 0 0 0 1.4 0l3.77-3.77a6 6 0 0 1-7.94 7.94l-6.91 6.91a2.12 2.12 0 0 1-3-3l6.91-6.91a6 6 0 0 1 7.94-7.94l-3.76 3.76z",key:"cbrjhi"}]]);/** - * @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 zr=Ie("X",[["path",{d:"M18 6 6 18",key:"1bl5f8"}],["path",{d:"m6 6 12 12",key:"d8bk6v"}]]),dS="veadk_auth_qs";let yu=null;function ez(){if(yu!==null)return yu;const e=window.location.search.replace(/^\?/,"");return e?(sessionStorage.setItem(dS,e),window.history.replaceState(null,"",window.location.pathname+window.location.hash),yu=e):yu=sessionStorage.getItem(dS)??"",yu}function xi(e){const t=ez();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 Kc=3e4,Lw=12e4,LL=1e4;function Gs(e,t=Kc){if(t<=0)return e??void 0;const n=AbortSignal.timeout(t);return e?AbortSignal.any([e,n]):n}const xm="veadk_local_user",wm="veadk_local_user_tab",tz=/^[A-Za-z0-9]{1,16}$/;function ML(){try{const e=sessionStorage.getItem(wm);if(e)return e;const t=localStorage.getItem(xm);return t&&sessionStorage.setItem(wm,t),t}catch{try{return localStorage.getItem(xm)}catch{return null}}}function fS(e){try{sessionStorage.setItem(wm,e)}catch{}try{localStorage.setItem(xm,e)}catch{}}function nz(){try{sessionStorage.removeItem(wm)}catch{}try{localStorage.removeItem(xm)}catch{}}function Ig(e){const t=new Headers(e),n=ML();return n&&t.set("X-VeADK-Local-User",n),t}async function jL(){let e;try{e=await fetch("/web/auth-config",{headers:{Accept:"application/json"},signal:Gs(void 0,LL)})}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 rz(e){const t=window.location.pathname+window.location.search+window.location.hash,n=e.includes("?")?"&":"?";window.location.assign(`${e}${n}redirect=${encodeURIComponent(t)}`)}function sz(){const e=window.location.pathname+window.location.search+window.location.hash,t=window.open("about:blank","_blank","popup,width=520,height=720");if(!t)return null;try{t.opener=null,t.location.replace(`/oauth2/login?redirect=${encodeURIComponent(e)}`)}catch{return t.close(),null}return t}async function iz(){const[e,t]=await Promise.all([z1(),jL()]);return e.status==="unauthenticated"&&t.length>0}function az(){window.location.assign("/oauth2/logout")}async function z1(){let e;try{e=await fetch("/oauth2/userinfo",{headers:{Accept:"application/json"},signal:Gs(void 0,LL)})}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=ML();return t?{status:"authenticated",userId:t,info:{name:t},local:!0}:{status:"unauthenticated",userId:"",local:!0}}function oz(e){return e?String(e.name??e.preferred_username??e.email??e.sub??""):""}function lz(e){const t=e==null?void 0:e.picture;return typeof t=="string"?t.trim():""}const V1="veadk:authentication-required";let ad=null,Bu=null;function cz(e){if(!e.redirected||!e.url)return!1;try{const t=new URL(e.url);return t.pathname.includes("/authorize")||t.pathname.includes("/oauth2/login")||t.hostname.includes(".userpool.auth.")}catch{return!1}}function uz(e){ad||(ad=new Promise(n=>{Bu=n}),window.dispatchEvent(new Event(V1)));const t=ad;return e?e.aborted?Promise.reject(e.reason??new Error("Request aborted")):new Promise((n,r)=>{const s=()=>r(e.reason??new Error("Request aborted"));e.addEventListener("abort",s,{once:!0}),t.then(()=>{e.removeEventListener("abort",s),n()},i=>{e.removeEventListener("abort",s),r(i)})}):t}function dz(){return ad!==null}function fz(){Bu==null||Bu(),Bu=null,ad=null}async function DL(e,t){var r;const n=await e.text().catch(()=>"");try{return JSON.parse(n)}catch{const s=((r=e.headers.get("content-type"))==null?void 0:r.split(";",1)[0])||"Content-Type 缺失",i=n.trim().slice(0,2e3),a=i?` -响应:${i}`:"";throw new Error(`${t}:服务端返回非 JSON 响应(HTTP ${e.status},${s})${a}`)}}const hz=/\brun_sse\s*failed\s*:\s*404\b/i,hS="提示:该 404 可能是多实例部署使用 in-memory 或 SQLite 短期记忆导致的:请求落到不同实例后,会话无法找到。请改用基于数据库的持久化短期记忆存储。";function Oh(e){const t=String(e);return!hz.test(t)||t.includes(hS)?t:`${t} - -${hS}`}async function*Mw(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 c=o.split(/\r?\n/).filter(u=>u.startsWith("data:")).map(u=>u.slice(5).trimStart()).join(` -`);if(c)try{yield JSON.parse(c)}catch{c!=="[DONE]"&&c!=="ping"&&console.debug(`parseSSE: dropping unparseable frame (${c.length} chars):`,c.slice(0,200))}a=r.match(/\r?\n\r?\n/)}}}finally{try{await t.cancel()}catch{}finally{t.releaseLock()}}}const PL="veadk.messageFeedback.v1";function BL(e,t,n,r){return[e,t,n,r].join(":")}function FL(){if(typeof window>"u")return{};try{const e=JSON.parse(localStorage.getItem(PL)??"{}");return e&&typeof e=="object"?e:{}}catch{return{}}}function pz(e,t,n){if(typeof window>"u")return;const r=FL();r[e]={...r[e]??{},[`veadk_feedback:${t}`]:n},localStorage.setItem(PL,JSON.stringify(r))}const _p="",jw=new Map;function UL(e,t){jw.set(e,t)}function $L(){jw.clear()}function Fn(e){const t=jw.get(e);return t?{app:t.app,ep:{base:t.base,apiKey:t.apiKey,runtimeId:t.runtimeId,region:t.region}}:{app:e,ep:{}}}async function pt(e,t={},n={},r=Kc){const s={...t,headers:Ig(t.headers)},i=()=>{const c={...s,signal:Gs(t.signal,r)};if(n.runtimeId){const u=n.region?`${e.includes("?")?"&":"?"}region=${encodeURIComponent(n.region)}`:"";return fetch(xi(`${_p}/web/runtime-proxy/${n.runtimeId}${e}${u}`),c)}if(n.base){const u=new Headers(c.headers);return u.set("X-AgentKit-Base",n.base),n.apiKey&&u.set("X-AgentKit-Key",n.apiKey),fetch(xi(`${_p}/agentkit-proxy${e}`),{...c,headers:u})}return fetch(xi(`${_p}${e}`),c)},a=async c=>{if(cz(c))return!0;if(c.status!==401)return!1;try{return await iz()}catch{return!1}};let o=await i();for(;await a(o);)await uz(t.signal),o=await i();return o}function mz(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 Sn(e,t){const n=await e.text().catch(()=>"");if(!n)return`${t} (${e.status})`;try{const r=JSON.parse(n);return mz(r.detail??r.error)||n||`${t} (${e.status})`}catch{return n||`${t} (${e.status})`}}async function HL(){const e=await pt("/list-apps");if(!e.ok)throw new Error(`list-apps failed: ${e.status}`);return e.json()}class kf extends Error{constructor(){super("当前账号无权访问该 Runtime,请刷新列表或重新登录后重试。"),this.name="RuntimeAccessDeniedError"}}class Kd extends Error{constructor(t,n=!1){super(t),this.unsupported=n,this.name="RuntimeProbeError"}}async function gz(e){try{const t=await e.clone().json();return typeof t.detail=="string"?t.detail:""}catch{return""}}async function Og(e,t,n){const r=await pt("/list-apps",{},n??{base:e,apiKey:t}),s=n!=null&&n.runtimeId?await gz(r):"";if(n!=null&&n.runtimeId&&s==="runtime_access_denied")throw new kf;if(n!=null&&n.runtimeId&&r.status===404)throw new Kd("该 Runtime 的 Agent Server 未提供连接接口,请确认 Runtime 已就绪且版本兼容。",!0);if(n!=null&&n.runtimeId&&(r.status===401||r.status===403))throw new Kd("Runtime 服务拒绝了连接请求,请检查 Runtime 的鉴权配置。");if(!r.ok)throw new Error(await Sn(r,"读取 Agent 列表失败"));return r.json()}async function vm(e,t){const{app:n,ep:r}=Fn(e),s=await pt(`/apps/${n}/users/${encodeURIComponent(t)}/sessions`,{method:"POST",headers:{"Content-Type":"application/json"},body:"{}"},r);if(!s.ok){const a=`创建会话失败 (${s.status})`,o=await Sn(s,"创建会话失败");throw new Error(o===a?a:`${a}:${o}`)}return(await s.json()).id}async function Dw(e,t){const{app:n,ep:r}=Fn(e),s=await pt(`/apps/${n}/users/${encodeURIComponent(t)}/sessions`,{},r);if(!s.ok)throw new Error(`list sessions failed: ${s.status}`);return s.json()}async function _m(e,t,n){const{app:r,ep:s}=Fn(e),i=await pt(`/apps/${r}/users/${encodeURIComponent(t)}/sessions/${n}`,{},s);if(!i.ok)throw new Error(`get session failed: ${i.status}`);const a=await i.json();if(s.runtimeId){const o=BL(s.runtimeId,r,t,n);a.state={...FL()[o]??{},...a.state??{}}}return a}async function zL(e){const{app:t,ep:n}=Fn(e.appName);if(!n.runtimeId)throw new Error("只有连接到 AgentKit Runtime 的会话支持反馈回流");const r=await pt("/web/evaluation/feedback",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({runtimeId:n.runtimeId,region:n.region??"cn-beijing",appName:t,userId:e.userId,sessionId:e.sessionId,eventId:e.eventId,rating:e.rating,comment:e.comment??""})},{},Lw);if(!r.ok)throw new Error(await Sn(r,"提交反馈失败"));const s=await r.json(),i=BL(n.runtimeId,t,e.userId,e.sessionId);return pz(i,e.eventId,s),s}async function K1(e,t,n){const{app:r,ep:s}=Fn(e),i=await pt(`/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 yz(e){const t=await pt("/web/media/capabilities");if(!t.ok)throw new Error(await Sn(t,"media capabilities failed"));return t.json()}async function VL(e,t,n,r){const{app:s}=Fn(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 pt("/web/media",{method:"POST",body:i},{},Lw);if(!a.ok)throw new Error(await Sn(a,"文件上传失败"));return{...await a.json(),status:"ready"}}async function Y1(e,t,n){const{app:r}=Fn(e),s=`/web/media/${encodeURIComponent(r)}/${encodeURIComponent(t)}/${encodeURIComponent(n)}`,i=await pt(s,{method:"DELETE"});if(!i.ok&&i.status!==404)throw new Error(await Sn(i,"media cleanup failed"))}function KL(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 kp(e,t){const n=KL(t);if(!n)throw new Error("Invalid VeADK media URI");const r=await pt(n,{method:"DELETE"});if(!r.ok&&r.status!==404)throw new Error(await Sn(r,"media cleanup failed"))}function YL(e,t){if(t.startsWith("data:")||t.startsWith("blob:")||/^https?:/.test(t))return t;const n=KL(t);if(!n)return t;const r=`${n}/content`;return xi(`${_p}${r}`)}async function WL(e,t){const{app:n,ep:r}=Fn(e),s=await pt(`/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}function Pw(e){const t=n=>({id:String(n.id??""),kind:n.kind==="skill"?"skill":"tool",name:String(n.name??""),custom:n.custom===!0,description:typeof n.description=="string"?n.description:void 0,skillSourceId:typeof n.skill_source_id=="string"?n.skill_source_id:void 0,version:typeof n.version=="string"?n.version:void 0});return{schemaVersion:Number(e.schema_version??1),revision:Number(e.revision??0),tools:Array.isArray(e.tools)?e.tools.map(n=>t(n)):[],skills:Array.isArray(e.skills)?e.skills.map(n=>t(n)):[]}}function Bw(e,t,n){return`/harness/apps/${encodeURIComponent(e)}/users/${encodeURIComponent(t)}/sessions/${encodeURIComponent(n)}/capabilities`}async function GL(e,t,n){const{app:r,ep:s}=Fn(e),i=await pt(Bw(r,t,n),{},s);if(!i.ok)throw new Error(await Sn(i,"读取会话能力失败"));return Pw(await i.json())}async function qL(e){const{ep:t}=Fn(e),n=await pt("/harness/capabilities/tools",{},t);if(!n.ok)throw new Error(await Sn(n,"读取内置工具失败"));return((await n.json()).tools??[]).map(s=>{var i;return((i=s.name)==null?void 0:i.trim())??""}).filter(Boolean)}async function bz(e){const{ep:t}=Fn(e),n=await pt("/harness/skills/spaces?region=all",{},t);if(!n.ok)throw new Error(await Sn(n,"读取 Skill Space 失败"));return(await n.json()).items??[]}async function Ez(e,t,n){const{ep:r}=Fn(e),s=new URLSearchParams({region:n||"cn-beijing"}),i=`/harness/skills/spaces/${encodeURIComponent(t)}/skills?${s.toString()}`,a=await pt(i,{},r);if(!a.ok)throw new Error(await Sn(a,"读取 Skill 列表失败"));return(await a.json()).items??[]}async function XL(e,t,n=1,r=20){const{ep:s}=Fn(e),i=new URLSearchParams({query:t,page_number:String(n),page_size:String(r)}),a=await pt(`/harness/skills/findskill?${i.toString()}`,{},s);if(!a.ok)throw new Error(await Sn(a,"搜索 Skill Hub 失败"));const o=await a.json();return{items:o.items??[],totalCount:Number(o.totalCount??0)}}async function QL(e,t,n,r,s){const{app:i,ep:a}=Fn(e),o=await pt(Bw(i,t,n),{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({kind:r.kind,name:r.name,skill_source_id:r.skillSourceId,description:r.description,version:r.version,expected_revision:s})},a);if(!o.ok)throw new Error(await Sn(o,"添加会话能力失败"));return Pw(await o.json())}async function ZL(e,t,n,r,s){const{app:i,ep:a}=Fn(e),o=`${Bw(i,t,n)}/${encodeURIComponent(r)}?expected_revision=${s}`,c=await pt(o,{method:"DELETE"},a);if(!c.ok)throw new Error(await Sn(c,"移除会话能力失败"));return Pw(await c.json())}async function JL(e,t){const n=await pt(`/web/agent-info/${e}`,{},t);if(!n.ok)throw new Error(`agent-info failed: ${n.status}`);const r=await n.json();if(!r.draft)try{const s=await pt(`/web/agent-draft/${e}`,{},t);if(s.ok){const i=await s.json();r.draft=i.draft}}catch{}return{name:r.name??e,description:r.description??"",type:r.type,model:r.model??"",tools:r.tools??[],skillsPreviewSupported:Array.isArray(r.skills),skills:r.skills??[],subAgents:r.subAgents??[],components:r.components??[],searchSources:r.searchSources??[],graph:r.graph,draft:r.draft}}async function Fw(e){const{app:t,ep:n}=Fn(e);return JL(t,n)}async function eM(e,t){const n={runtimeId:e,region:t},s=(await Og("","",n))[0];if(!s)throw new Error("该 Runtime 未提供可预览的 Agent。");return JL(s,n)}async function tM(e,t,n,r){const{app:s,ep:i}=Fn(e),a=new URLSearchParams({source:t,app_name:s,q:n,user_id:r}),o=await pt(`/web/search?${a.toString()}`,{},i);if(!o.ok)throw new Error(await Sn(o,"Agent 检索失败"));return o.json()}async function nM(e,t){const{app:n}=Fn(e),r=await pt(`/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*Yd({appName:e,userId:t,sessionId:n,text:r,attachments:s=[],invocation:i,functionResponses:a=[],signal:o,sessionCapabilities:c=!1}){const{app:u,ep:d}=Fn(e),f=s.flatMap(y=>y.status&&y.status!=="ready"?[]:y.uri?[{fileData:{mimeType:y.mimeType,fileUri:y.uri,displayName:y.name},partMetadata:{veadkMedia:{id:y.id,uri:y.uri,name:y.name,mimeType:y.mimeType,sizeBytes:y.sizeBytes}}}]:y.data?[{inlineData:{mimeType:y.mimeType,data:y.data,displayName:y.name}}]:[]),h=i&&(i.skills.length>0||i.targetAgent)?i:void 0,p=[...f,...a.map(y=>({functionResponse:{id:y.id,name:y.name,response:y.response}})),...r.trim()?[{text:r}]:[]];if(h&&p.length>0){const y=p[0],E=y.partMetadata;p[0]={...y,partMetadata:{...E,veadkInvocation:h}}}const m=await pt(c?"/harness/run_sse":"/run_sse",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({app_name:u,user_id:t,session_id:n,new_message:{role:"user",parts:p},streaming:!0,custom_metadata:h?{veadkInvocation:h}:void 0}),signal:o},d,0);if(!m.ok)throw new Error(Oh(`run_sse failed: ${m.status}`));for await(const y of Mw(m)){const E=y;typeof E.error=="string"&&(E.error=Oh(E.error)),typeof E.errorMessage=="string"&&(E.errorMessage=Oh(E.errorMessage)),typeof E.error_message=="string"&&(E.error_message=Oh(E.error_message)),yield E}}const od=new Map;async function Rg(e,t,n,r){var u,d,f;const s=r==null?void 0:r.taskId,i=s?new AbortController:void 0;s&&i&&od.set(s,i);const a=()=>{s&&od.get(s)===i&&od.delete(s)};let o;try{(u=r==null?void 0:r.onStage)==null||u.call(r,{level:"info",phase:"upload",message:"正在上传代码包",pct:0}),o=await pt("/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,runtimeId:r==null?void 0:r.runtimeId,description:r==null?void 0:r.description,im:r==null?void 0:r.im,envs:r==null?void 0:r.envs})},{},0),(d=r==null?void 0:r.onStage)==null||d.call(r,{level:"success",phase:"upload",message:"代码包上传完成",pct:100})}catch(h){throw a(),h}if(!o.ok){const h=await o.text().catch(()=>"");throw a(),new Error(h||`部署失败 (${o.status})`)}let c=null;try{for await(const h of Mw(o)){const p=h;if(p&&p.done){c=p;break}p&&p.message&&((f=r==null?void 0:r.onStage)==null||f.call(r,p))}}catch(h){throw a(),h}if(a(),!c)throw new Error("部署失败:连接中断");if(!c.success)throw new Error(c.error||"部署失败");if(!c.agentName)throw new Error("部署失败:返回缺少 Agent 名称");if(!c.runtimeId&&!c.url)throw new Error("部署失败:返回缺少 AgentKit 连接信息");return{apikey:c.apikey??"",url:c.url??"",agentName:c.agentName,runtimeId:c.runtimeId,consoleUrl:c.consoleUrl,region:c.region,version:c.version,feishuChannel:c.feishuChannel}}async function rM(e){var n;const t=await pt("/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=od.get(e))==null||n.abort(),od.delete(e)}async function xz(e="cn-beijing"){const t=await pt(`/web/my-runtimes?region=${encodeURIComponent(e)}`);if(!t.ok)throw new Error(`加载失败 (${t.status})`);return(await t.json()).runtimes??[]}const Wd={title:"VeADK Studio",logoUrl:""},by={studio:!1,version:"",branding:Wd,features:{newChat:!0,search:!0,skillCenter:!0,history:!0,addAgent:!0,manageAgents:!0,addAgentkit:!0,generatedAgentTestRun:!0},defaultView:"chat",agentsSource:"local"};async function sM(){var e,t;try{const n=await pt("/web/ui-config");if(!n.ok)return by;const r=await n.json(),s=typeof((e=r.branding)==null?void 0:e.logoUrl)=="string"?r.branding.logoUrl:Wd.logoUrl;return{studio:r.studio??!1,version:typeof r.version=="string"?r.version:"",branding:{title:typeof((t=r.branding)==null?void 0:t.title)=="string"?r.branding.title:Wd.title,logoUrl:s?xi(s):""},features:{...by.features,...r.features??{}},defaultView:r.defaultView??"chat",agentsSource:r.agentsSource==="cloud"?"cloud":"local"}}catch{return by}}const iM={role:"user",capabilities:{createAgents:!1,manageAgents:!1,runtimeScope:"mine"}};async function aM(){var n,r,s;const e=await pt("/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 oM(e,t){const n=new URLSearchParams;e&&n.set("targetVersion",e),t&&n.set("startedAt",String(t));const r=n.size?`?${n.toString()}`:"",s=await pt(`/web/studio-update${r}`);if(!s.ok)throw new Error(`检查 Studio 更新失败 (${s.status})`);return await s.json()}async function lM(e){const t=await pt("/web/studio-update",{method:"POST",headers:{"Content-Type":"application/json","X-VeADK-Studio-Update":"1"},body:JSON.stringify({version:e})},{},Lw);if(!t.ok){let n="";try{const r=await t.json();n=typeof r.detail=="string"?r.detail:""}catch{n=""}throw new Error(n||`提交 Studio 更新失败 (${t.status})`)}return await t.json()}async function ld(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 pt(`/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 cM(e,t="cn-beijing"){try{return await Og("","",{runtimeId:e,region:t})}catch(n){if(n instanceof kf||n instanceof Kd)throw n;return null}}async function uM(e,t="cn-beijing"){const n=await pt("/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 Uw(e,t="cn-beijing"){const n=await pt(`/web/runtime-detail?runtimeId=${encodeURIComponent(e)}®ion=${encodeURIComponent(t)}`);if(!n.ok)throw new Error(await Sn(n,"加载 Runtime 详情失败"));return n.json()}async function $w(e){const t=await pt("/web/generated-agent-projects",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({draft:e})});if(!t.ok)throw new Error(await Sn(t,"生成项目失败"));return t.json()}async function dM(e){const t=await pt("/web/generated-agent-test-runs",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({draft:e})});if(!t.ok)throw new Error(await Sn(t,"创建调试运行失败"));return DL(t,"创建调试运行失败")}async function fM(e,t){const n=await pt(`/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 Sn(n,"创建调试会话失败"));return(await DL(n,"创建调试会话失败")).id}async function*hM({runId:e,userId:t,sessionId:n,text:r,signal:s}){const i=r.trim()?[{text:r}]:[],a=await pt(`/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 Sn(a,"调试运行失败"));for await(const o of Mw(a))yield o}async function Fu(e){const t=await pt(`/web/generated-agent-test-runs/${e}`,{method:"DELETE"});if(!t.ok&&t.status!==404)throw new Error(await Sn(t,"清理调试运行失败"))}const wz=Object.freeze(Object.defineProperty({__proto__:null,DEFAULT_SITE_BRANDING:Wd,DEFAULT_STUDIO_ACCESS:iM,RuntimeAccessDeniedError:kf,RuntimeProbeError:Kd,addSessionCapability:QL,cancelAgentkitDeployment:rM,clearRemoteApps:$L,componentSearch:tM,createGeneratedAgentTestRun:dM,createGeneratedAgentTestSession:fM,createSession:vm,deleteGeneratedAgentTestRun:Fu,deleteMedia:kp,deleteRuntime:uM,deleteSession:K1,deleteSessionMedia:Y1,deployAgentkitProject:Rg,fetchRemoteApps:Og,generateAgentProject:$w,getAgentInfo:Fw,getMediaCapabilities:yz,getMyRuntimes:xz,getRuntimeAgentInfo:eM,getRuntimeDetail:Uw,getRuntimes:ld,getSession:_m,getSessionCapabilities:GL,getSessionTrace:WL,getStudioAccess:aM,getStudioUpdateStatus:oM,getUiConfig:sM,listApps:HL,listSessionBuiltinTools:qL,listSessionSkillSpaces:bz,listSessionSkillsInSpace:Ez,listSessions:Dw,mediaContentUrl:YL,probeRuntimeApps:cM,registerRemoteApp:UL,removeSessionCapability:ZL,runGeneratedAgentTestSSE:hM,runSSE:Yd,searchSessionPublicSkills:XL,startStudioUpdate:lM,submitMessageFeedback:zL,uploadMedia:VL,webSearch:nM},Symbol.toStringTag,{value:"Module"})),vz="send_a2ui_json_to_client",_z="validated_a2ui_json",W1="adk_request_credential",pS="transfer_to_agent";function kz(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 zs(){return{blocks:[],liveStart:0}}const mS=e=>e.functionCall??e.function_call,G1=e=>e.functionResponse??e.function_response;function Nz(e){if(!e||typeof e!="object")return"";const t=e,n=t.agentName??t.agent_name;return typeof n=="string"?n:""}function Sz(e){return e.replace(/-/g,"+").replace(/_/g,"/")}function pM(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:Sz(o.data),name:o.displayName??o.display_name});continue}const c=r.fileData??r.file_data,u=(c==null?void 0:c.fileUri)??(c==null?void 0:c.file_uri);c&&u&&t.push({id:u,mimeType:c.mimeType??c.mime_type,uri:u,name:c.displayName??c.display_name})}return t}function q1(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 Tz=new Set(["llm","sequential","parallel","loop","a2a"]);function Az(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(c=>{if(!c||typeof c!="object")return[];const u=c;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 c=o,u=c.type;typeof c.name=="string"&&typeof u=="string"&&Tz.has(u)&&Array.isArray(c.path)&&(a={name:c.name,description:typeof c.description=="string"?c.description:"",type:u,path:c.path.filter(d=>typeof d=="string")})}if(i.length>0||a)return{skills:i,targetAgent:a}}}function Cz(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 gS(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 Rh(e){for(const t of e)t.kind==="thinking"&&(t.done=!0)}function Ec(e,t){var a,o,c,u;const n=e.blocks.map(d=>({...d}));let r=e.liveStart;const s=((a=t.content)==null?void 0:a.parts)??[],i=s.some(d=>mS(d)||G1(d));if(t.partial&&!i){for(const d of s){const f=q1(d);typeof f=="string"&&f&&gS(n,d.thought?"thinking":"text",f)}return{blocks:n,liveStart:r}}n.length=r;for(const d of s){const f=mS(d),h=G1(d),p=pM([d]),m=q1(d);if(typeof m=="string"&&m)gS(n,d.thought?"thinking":"text",m);else if(p.length)Rh(n),Cz(n,p);else if(f)if(Rh(n),f.name===pS){const y=Nz(f.args)||((o=t.actions)==null?void 0:o.transferToAgent)||((c=t.actions)==null?void 0:c.transfer_to_agent)||"未知 Agent";n.push({kind:"agent-transfer",agentName:y,done:!1})}else if(f.name===W1){const y=f.args??{},E=y.authConfig??y.auth_config??y,x=String(y.functionCallId??y.function_call_id??"").replace(/^_adk_toolset_auth_/,"")||void 0;n.push({kind:"auth",callId:f.id??"",label:x,authUri:kz(E),authConfig:E,done:!1})}else n.push({kind:"tool",name:f.name??"",args:f.args,done:!1});else if(h){if(Rh(n),h.name===pS)for(let y=n.length-1;y>=0;y--){const E=n[y];if(E.kind==="agent-transfer"&&!E.done){E.done=!0;break}}if(h.name===W1)for(let y=n.length-1;y>=0;y--){const E=n[y];if(E.kind==="auth"&&!E.done){E.done=!0;break}}for(let y=n.length-1;y>=0;y--){const E=n[y];if(E.kind==="tool"&&!E.done&&E.name===h.name){E.done=!0,E.response=h.response;break}}if(h.name===vz){const y=((u=h.response)==null?void 0:u[_z])??[];if(y.length){const E=n[n.length-1];E&&E.kind==="a2ui"?E.messages.push(...y):n.push({kind:"a2ui",messages:y})}}}}return Rh(n),r=n.length,{blocks:n,liveStart:r}}function Iz(e,t={}){var s,i;const n=[];let r=zs();for(const a of e)if(a.author==="user"){const c=((s=a.content)==null?void 0:s.parts)??[];if(c.some(p=>{var m;return((m=G1(p))==null?void 0:m.name)===W1})){for(let p=n.length-1;p>=0;p--)if(n[p].role==="assistant"){for(let m=n[p].blocks.length-1;m>=0;m--){const y=n[p].blocks[m];if(y.kind==="auth"){y.done=!0;break}}break}}const u=c.map(q1).filter(p=>!!p).join(""),d=pM(c),f=Az(c);if(!u&&!d.length&&!f){r=zs();continue}const h=[];f&&h.push({kind:"invocation",value:f}),d.length&&h.push({kind:"attachment",files:d}),u&&h.push({kind:"text",text:u}),n.push({role:"user",blocks:h,meta:{ts:a.timestamp}}),r=zs()}else{const c=a.author??"";let u=n[n.length-1];(!u||u.role!=="assistant"||c&&((i=u.meta)==null?void 0:i.author)!==c)&&(u={role:"assistant",blocks:[],meta:{author:c||void 0}},n.push(u),r=zs()),r=Ec(r,a),u.blocks=r.blocks;const d=a.usageMetadata??a.usage_metadata,f=u.meta??(u.meta={});c&&(f.author=c),d!=null&&d.totalTokenCount&&(f.tokens=d.totalTokenCount),a.timestamp&&(f.ts=a.timestamp),a.id&&(f.eventId=a.id);const h=a.invocationId??a.invocation_id;h&&(f.invocationId=h)}for(const a of n){const o=a.meta,c=o==null?void 0:o.eventId;if(!c)continue;const u=t[`veadk_feedback:${c}`];if(!u||typeof u!="object")continue;const d=u;d.rating!=="good"&&d.rating!=="bad"||(o.feedback=u)}return n}function Oz(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"新会话"}const Rz=50,yS=48;function Lz(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 Mz(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 jz(e,t,n){const r=Math.max(0,t-yS),s=Math.min(e.length,t+n+yS);return(r>0?"…":"")+e.slice(r,s).trim()+(s{var c;if((c=o.events)!=null&&c.length)return o;try{return await _m(t,e,o.id)}catch{return o}})),a=[];for(const o of i)for(const{text:c,role:u,ts:d}of Lz(o)){const f=c.toLowerCase().indexOf(r);if(f!==-1){a.push({type:"session",appId:t,sessionId:o.id,title:Mz(o),snippet:jz(c,f,r.length),role:u,ts:d??o.lastUpdateTime});break}}return a.sort((o,c)=>(c.ts??0)-(o.ts??0)),a.slice(0,Rz)}async function Pz(e,t){if(!e||!t.trim())return{results:[]};let n;try{n=await nM(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 Bz(e,t,n,r){if(!t||!r.trim())return{results:[]};const s=await tM(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 Fz(e,t,n){return e==="session"?{results:await Dz(n.userId,n.appId,t)}:e==="web"?Pz(n.appId,t):Bz(e,n.appId,n.userId,t)}function mM({className:e="icon"}){return l.jsxs("svg",{className:e,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"1.7",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":!0,children:[l.jsx("path",{d:"M16.4 10.7a5.7 5.7 0 1 1-1.67-4.03"}),l.jsx("path",{d:"M15.25 15.25 19.6 19.6"})]})}function Uz({open:e}){return l.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:l.jsx("path",{d:"m3.25 4.75 2.75 2.5 2.75-2.5"})})}function $z({onClick:e}){return l.jsxs("button",{className:"new-chat",onClick:e,"aria-label":"搜索",title:"搜索",children:[l.jsx(mM,{}),l.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 km(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 bS(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 zz({userId:e,appId:t,agentInfo:n,capabilitiesLoading:r,agentLabel:s,onOpenSession:i}){var j,T;const[a,o]=w.useState("session"),[c,u]=w.useState(""),[d,f]=w.useState([]),[h,p]=w.useState(),[m,y]=w.useState(!1),[E,g]=w.useState(!1),[x,b]=w.useState(!1),_=w.useRef(0),k=w.useRef(null),N=Hz(t,n,r),C=N.find(L=>L.id===a),S=a==="knowledge"?(j=n==null?void 0:n.components)==null?void 0:j.find(L=>L.source==="knowledgebase"||L.kind==="knowledgebase"):a==="memory"?(T=n==null?void 0:n.components)==null?void 0:T.find(L=>L.source==="long_term_memory"||L.kind==="memory"):void 0;w.useEffect(()=>{_.current+=1,o("session"),f([]),p(void 0),g(!1),y(!1),b(!1)},[t]),w.useEffect(()=>{if(!x)return;function L(R){var F;(F=k.current)!=null&&F.contains(R.target)||b(!1)}return document.addEventListener("pointerdown",L),()=>document.removeEventListener("pointerdown",L)},[x]);async function A(L,R){var W;const F=L.trim();if(!F||!((W=N.find(P=>P.id===R))!=null&&W.ready))return;const I=++_.current;y(!0),g(!0);let V;try{V=await Fz(R,F,{userId:e,appId:t})}catch(P){const ie=P instanceof Error?P.message:String(P);V={results:[],note:`搜索失败:${ie}`}}I===_.current&&(f(V.results),p(V.note),y(!1))}function O(L){_.current+=1,u(L),f([]),p(void 0),g(!1),y(!1)}function D(L){_.current+=1,o(L),b(!1),f([]),p(void 0),g(!1),y(!1)}const U=!!(C!=null&&C.ready),X=t?a==="web"?"在网络中检索":a==="knowledge"?`在 ${(S==null?void 0:S.name)??"当前 Agent 的知识库"} 中检索`:a==="memory"?`在 ${(S==null?void 0:S.name)??"当前用户的长期记忆"} 中检索`:"在当前 Agent 的会话中检索":"请先选择 Agent",M=S!=null&&S.backend?km(S.backend):"";return l.jsxs("div",{className:"search",children:[l.jsxs("div",{className:"search-box",children:[l.jsxs("div",{className:"search-source-picker-wrap",ref:k,children:[l.jsxs("button",{className:"search-source-picker",type:"button","aria-label":`搜索类型:${(C==null?void 0:C.label)??"未选择"}`,"aria-haspopup":"listbox","aria-expanded":x,onClick:()=>b(L=>!L),children:[l.jsx("span",{children:(C==null?void 0:C.label)??"搜索类型"}),M&&l.jsx("small",{children:M}),l.jsx(Uz,{open:x})]}),x&&l.jsx("div",{className:"search-source-menu",role:"listbox","aria-label":"选择搜索类型",children:N.map(L=>{var I,V;const R=L.id==="knowledge"?(I=n==null?void 0:n.components)==null?void 0:I.find(W=>W.source==="knowledgebase"||W.kind==="knowledgebase"):L.id==="memory"?(V=n==null?void 0:n.components)==null?void 0:V.find(W=>W.source==="long_term_memory"||W.kind==="memory"):void 0,F=R?[R.name,R.backend?km(R.backend):""].filter(Boolean).join(" · "):L.ready?L.description:L.unavailableLabel;return l.jsxs("button",{type:"button",role:"option","aria-selected":a===L.id,disabled:!L.ready,onClick:()=>D(L.id),children:[l.jsx("span",{children:L.label}),F&&l.jsx("small",{children:F})]},L.id)})})]}),l.jsx("span",{className:"search-box-divider","aria-hidden":!0}),l.jsx("input",{className:"search-input",value:c,onChange:L=>O(L.target.value),onKeyDown:L=>{L.key==="Enter"&&(L.preventDefault(),A(c,a))},placeholder:X,disabled:!U,autoFocus:!0}),l.jsx("button",{className:"search-go",onClick:()=>void A(c,a),disabled:!c.trim()||m,"aria-label":"搜索",children:m?l.jsx(Rt,{className:"icon spin"}):l.jsx(mM,{className:"icon"})})]}),l.jsx("div",{className:"search-results",children:U?E?m?null:h?l.jsx("div",{className:"search-empty",children:h}):d.length===0&&E?l.jsxs("div",{className:"search-empty",children:["未找到匹配「",c.trim(),"」的结果。"]}):d.map((L,R)=>l.jsx(Vz,{result:L,agentLabel:s,onOpen:i},R)):l.jsx("div",{className:"search-empty",children:a==="web"?"输入关键词后回车或点击按钮,通过 web_search 工具检索。":a==="knowledge"?"输入问题,检索当前 Agent 挂载的知识库。":a==="memory"?"输入线索,检索当前用户跨会话保存的长期记忆。":"输入关键词后回车或点击按钮,搜索当前 Agent 的会话。"}):l.jsx("div",{className:"search-empty",children:t?r?"正在读取当前 Agent 的检索能力…":(C==null?void 0:C.unavailableLabel)??"当前 Agent 未挂载该数据源":"选择一个 Agent 后,即可检索会话、网络及其挂载的数据源。"})})]})}function Vz({result:e,agentLabel:t,onOpen:n}){switch(e.type){case"session":return l.jsxs("button",{className:"search-result",onClick:()=>n(e.appId,e.sessionId),children:[l.jsx(IL,{className:"search-result-icon"}),l.jsxs("div",{className:"search-result-body",children:[l.jsxs("div",{className:"search-result-head",children:[l.jsx("span",{className:"search-result-title",children:e.title}),l.jsxs("span",{className:"search-result-meta",children:[t(e.appId),e.ts?` · ${bS(e.ts)}`:""]})]}),l.jsx("div",{className:"search-result-snippet",children:e.snippet})]})]});case"web":return l.jsxs("a",{className:"search-result",href:e.url||void 0,target:"_blank",rel:"noreferrer noopener",children:[l.jsx(Cg,{className:"search-result-icon"}),l.jsxs("div",{className:"search-result-body",children:[l.jsxs("div",{className:"search-result-head",children:[l.jsx("span",{className:"search-result-title",children:e.title||e.url}),l.jsxs("span",{className:"search-result-meta",children:[e.siteName,e.url&&l.jsx(Iw,{className:"search-result-ext"})]})]}),e.summary&&l.jsx("div",{className:"search-result-snippet",children:e.summary})]})]});case"knowledge":return l.jsxs("div",{className:"search-result search-result-static",children:[l.jsx(ES,{source:"knowledge"}),l.jsxs("div",{className:"search-result-body",children:[l.jsxs("div",{className:"search-result-head",children:[l.jsxs("span",{className:"search-result-title",children:["知识片段 ",e.index+1]}),l.jsxs("span",{className:"search-result-meta",children:[e.sourceName,e.sourceType?` · ${km(e.sourceType)}`:""]})]}),l.jsx("div",{className:"search-result-snippet search-result-snippet-expanded",children:e.content})]})]});case"memory":return l.jsxs("div",{className:"search-result search-result-static",children:[l.jsx(ES,{source:"memory"}),l.jsxs("div",{className:"search-result-body",children:[l.jsxs("div",{className:"search-result-head",children:[l.jsxs("span",{className:"search-result-title",children:["记忆片段 ",e.index+1]}),l.jsxs("span",{className:"search-result-meta",children:[e.sourceName,e.sourceType?` · ${km(e.sourceType)}`:"",e.ts?` · ${bS(e.ts)}`:""]})]}),l.jsx("div",{className:"search-result-snippet search-result-snippet-expanded",children:e.content})]})]});default:return null}}function ES({source:e,className:t="search-result-icon"}){return e==="knowledge"?l.jsxs("svg",{className:t,viewBox:"0 0 24 24",fill:"none","aria-hidden":!0,children:[l.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"}),l.jsx("path",{d:"M8.25 9h7.5M8.25 12.25h6"})]}):l.jsxs("svg",{className:t,viewBox:"0 0 24 24",fill:"none","aria-hidden":!0,children:[l.jsx("path",{d:"M12 4.5a7.5 7.5 0 1 0 7.5 7.5"}),l.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 Hw="/assets/volcengine-DM14a-L-.svg",xS="(max-width: 860px)";function Kz(){return l.jsxs("svg",{className:"icon sidebar-agent-face",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"1.7",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":!0,children:[l.jsx("rect",{x:"4.25",y:"5.25",width:"15.5",height:"13.5",rx:"4.75"}),l.jsx("path",{className:"sidebar-agent-face__eye sidebar-agent-face__eye--left",d:"M8.5 10.7v2"}),l.jsx("path",{className:"sidebar-agent-face__eye sidebar-agent-face__eye--right",d:"M15.5 10.7v2"})]})}function Yz(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 Wz={admin:"管理员",developer:"开发者",user:"普通用户"};function wS({role:e}){const t=Wz[e];return l.jsx("span",{className:`studio-role-badge studio-role-badge--${e}`,title:t,children:t})}function Gz({version:e,onClose:t}){return w.useEffect(()=>{const n=r=>{r.key==="Escape"&&t()};return window.addEventListener("keydown",n),()=>window.removeEventListener("keydown",n)},[t]),Ss.createPortal(l.jsx("div",{className:"confirm-scrim",onMouseDown:t,children:l.jsxs("section",{className:"confirm-box system-info-dialog",role:"dialog","aria-modal":"true","aria-labelledby":"system-info-title",onMouseDown:n=>n.stopPropagation(),children:[l.jsxs("header",{className:"system-info-head",children:[l.jsx("h2",{id:"system-info-title",children:"系统信息"}),l.jsx("button",{type:"button",className:"icon-btn",onClick:t,"aria-label":"关闭系统信息",autoFocus:!0,children:l.jsx(zr,{className:"icon","aria-hidden":"true"})})]}),l.jsx("dl",{className:"system-info-meta",children:l.jsxs("div",{children:[l.jsx("dt",{children:"当前版本"}),l.jsx("dd",{children:e||"—"})]})})]})}),document.body)}function qz({access:e,userInfo:t,version:n,onLogout:r}){const[s,i]=w.useState(!1),[a,o]=w.useState(!1),[c,u]=w.useState("");if(!t)return null;const d=oz(t),f=typeof t.email=="string"?t.email:"",h=(d||"U").slice(0,1).toUpperCase(),p=Yz(d||f||h),m=lz(t),y=m===c?"":m;return l.jsxs("div",{className:"sidebar-user",children:[l.jsxs("button",{className:"sidebar-user-btn",onClick:()=>i(E=>!E),title:f?`${d} -${f}`:d,children:[l.jsxs("span",{className:`account-avatar${y?" has-image":""}`,style:p,children:[h,y?l.jsx("img",{className:"account-avatar-image",src:y,alt:"","aria-hidden":"true",referrerPolicy:"no-referrer",onError:()=>u(y)}):null]}),l.jsxs("span",{className:"sidebar-user-identity",children:[l.jsxs("span",{className:"sidebar-user-primary",children:[l.jsx("span",{className:"sidebar-user-name",children:d}),l.jsx(wS,{role:e.role})]}),f&&f!==d&&l.jsx("span",{className:"sidebar-user-email",children:f})]})]}),s&&l.jsxs(l.Fragment,{children:[l.jsx("div",{className:"menu-scrim",onClick:()=>i(!1)}),l.jsxs("div",{className:"account-pop sidebar-user-pop",children:[l.jsxs("div",{className:"account-head",children:[l.jsxs("span",{className:`account-avatar account-avatar--lg${y?" has-image":""}`,style:p,children:[h,y?l.jsx("img",{className:"account-avatar-image",src:y,alt:"","aria-hidden":"true",referrerPolicy:"no-referrer",onError:()=>u(y)}):null]}),l.jsxs("div",{className:"account-id",children:[l.jsxs("div",{className:"account-name-row",children:[l.jsx("div",{className:"account-name",children:d}),l.jsx(wS,{role:e.role})]}),f&&f!==d&&l.jsx("div",{className:"account-sub",children:f})]})]}),l.jsxs("button",{type:"button",className:"account-action",onClick:()=>{i(!1),o(!0)},children:[l.jsx(Ka,{className:"icon"})," 系统信息"]}),l.jsxs("button",{type:"button",className:"account-action",onClick:()=>{i(!1),r()},children:[l.jsx(DH,{className:"icon"})," 退出登录"]})]})]}),a?l.jsx(Gz,{version:n,onClose:()=>o(!1)}):null]})}function Xz({branding:e,sessions:t,currentSessionId:n,features:r,access:s,streamingSids:i,onNewChat:a,onSearch:o,onQuickCreate:c,onSkillCenter:u,onAddAgent:d,onManageAgents:f,onPickSession:h,onDeleteSession:p,userInfo:m,version:y,onLogout:E}){const g=A=>(r==null?void 0:r[A])!==!1,[x,b]=w.useState(null),_=w.useRef(typeof window<"u"&&window.matchMedia(xS).matches),[k,N]=w.useState(_.current),C=[...t].sort((A,O)=>(O.lastUpdateTime??0)-(A.lastUpdateTime??0)),S=()=>{_.current=!1,N(A=>!A),b(null)};return w.useEffect(()=>{const A=window.matchMedia(xS),O=D=>{D.matches?N(U=>U||(_.current=!0,!0)):_.current&&(_.current=!1,N(!1))};return A.addEventListener("change",O),()=>A.removeEventListener("change",O)},[]),l.jsxs("aside",{className:`sidebar ${k?"is-collapsed":""}`,children:[l.jsxs("div",{className:"sidebar-top",children:[l.jsxs("div",{className:"sidebar-brand-row",children:[l.jsxs("button",{type:"button",className:"brand",onClick:a,"aria-label":"返回首页",title:"返回首页",children:[l.jsx("img",{className:"brand-logo",src:e.logoUrl||Hw,width:20,height:20,alt:"","aria-hidden":!0}),l.jsx("span",{className:"brand-title",children:e.title})]}),l.jsx("button",{type:"button",className:"sidebar-collapse-toggle",onClick:S,"aria-label":k?"展开侧边栏":"收起侧边栏",title:k?"展开侧边栏":"收起侧边栏",children:k?l.jsx($H,{className:"icon"}):l.jsx(UH,{className:"icon"})})]}),g("newChat")&&l.jsxs("button",{className:"new-chat new-chat--conversation",onClick:a,"aria-label":"新会话",title:"新会话",children:[l.jsx(rr,{className:"icon"}),l.jsx("span",{className:"sidebar-nav-label",children:"新会话"})]}),l.jsxs("button",{className:"new-chat new-chat--agents",onClick:f,"aria-label":"智能体",title:"智能体",children:[l.jsx(Kz,{}),l.jsx("span",{className:"sidebar-nav-label",children:"智能体"})]}),g("search")&&l.jsx($z,{onClick:o})]}),g("history")&&l.jsxs("div",{className:"sidebar-history",children:[l.jsxs("div",{className:"history-head",children:[l.jsx("span",{children:"历史会话"}),g("newChat")&&l.jsx("button",{type:"button",className:"history-new-chat",onClick:a,"aria-label":"新建会话",title:"新建会话",children:l.jsx(rr,{className:"icon"})})]}),l.jsxs("div",{className:"history-list",children:[C.length===0&&l.jsx("div",{className:"history-empty",children:"暂无会话"}),C.map(A=>{const O=Oz(A.events);return l.jsxs("div",{className:`history-item ${A.id===n?"active":""}`,children:[l.jsxs("button",{className:"history-item-btn",onClick:()=>h(A.id),title:O,children:[(i==null?void 0:i.has(A.id))&&l.jsx("span",{className:"history-streaming",title:"正在生成…","aria-label":"正在生成"}),l.jsx("span",{className:"history-title",children:O})]}),l.jsx("button",{className:"history-more",title:"更多",onClick:()=>b(D=>D===A.id?null:A.id),children:l.jsx(EH,{className:"icon"})}),x===A.id&&l.jsxs(l.Fragment,{children:[l.jsx("div",{className:"menu-scrim",onClick:()=>b(null)}),l.jsx("div",{className:"history-menu",children:l.jsxs("button",{className:"menu-item menu-item--danger",onClick:()=>{b(null),p(A.id)},children:[l.jsx(ea,{className:"icon"})," 删除"]})})]})]},A.id)})]})]}),l.jsx(qz,{access:s,userInfo:m,version:y,onLogout:E})]})}const gM="veadk_agentkit_connections";function ps(){try{const e=localStorage.getItem(gM);return e?JSON.parse(e):[]}catch{return[]}}function Lg(e){try{localStorage.setItem(gM,JSON.stringify(e))}catch{}}function Bo(e,t){return`agentkit:${e}:${t}`}function yM(e){try{return new URL(e).host}catch{return e}}function Yc(e){$L();for(const t of e)for(const n of t.apps)UL(Bo(t.id,n),t.runtimeId?{app:n,runtimeId:t.runtimeId,region:t.region}:{app:n,base:t.base,apiKey:t.apiKey})}function bM(e,t,n,r,s,i){const a={id:`rt_${e}`,name:t||e,runtimeId:e,region:n,apps:r,appLabels:s,currentVersion:i},o=[...ps().filter(c=>c.runtimeId!==e),a];return Lg(o),Yc(o),a}async function Nm(e,t,n,r){let s;try{s=await cM(e,n)}catch(o){throw o instanceof kf&&Sm(e),o}if(!s||s.length===0)throw Sm(e),new Error("该 Runtime 暂不支持连接,请确认服务已正常运行。");const i=Object.fromEntries(s.map(o=>[o,t])),a=bM(e,t,n,s,i,r);return Bo(a.id,s[0])}async function EM(e,t,n,r){const s=t.trim().replace(/\/+$/,""),i=await Og(s,n.trim()),a={id:Date.now().toString(36),name:e.trim()||yM(s),base:s,apiKey:n.trim(),apps:i,appLabels:r&&i.length>0?{[i[0]]:r}:void 0},o=[...ps().filter(c=>c.base!==s),a];return Lg(o),Yc(o),a}function Qz(e){const t=ps().filter(n=>n.id!==e);return Lg(t),Yc(t),t}function Sm(e){const t=ps().filter(n=>n.runtimeId!==e);return Lg(t),Yc(t),t}function xM(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:Bo(s.id,i),label:a,app:i,remote:!0,host:s.runtimeId?s.name:yM(s.base??""),runtimeId:s.runtimeId,region:s.region,currentVersion:s.currentVersion}}));return[...n,...r]}const vS=Object.freeze(Object.defineProperty({__proto__:null,addConnection:EM,addRuntimeConnection:bM,buildAgentEntries:xM,connectRuntime:Nm,loadConnections:ps,registerConnections:Yc,remoteAppId:Bo,removeConnection:Qz,removeRuntimeConnection:Sm},Symbol.toStringTag,{value:"Module"}));function xc({className:e="icon"}){return l.jsxs("svg",{className:e,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"1.8",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":!0,children:[l.jsx("path",{d:"m10.05 3.7 1.95-1.12 1.95 1.12"}),l.jsx("path",{d:"m16.25 5.03 3.9 2.25v4.5"}),l.jsx("path",{d:"M20.15 15.08v1.64l-3.9 2.25"}),l.jsx("path",{d:"m13.95 20.3-1.95 1.12-1.95-1.12"}),l.jsx("path",{d:"m7.75 18.97-3.9-2.25v-4.5"}),l.jsx("path",{d:"M3.85 8.92V7.28l3.9-2.25"}),l.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 X1({className:e="icon"}){return l.jsxs("svg",{className:e,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"1.7",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":!0,children:[l.jsx("path",{d:"M4.5 6.7h4.2M12.3 6.7h7.2"}),l.jsx("path",{d:"M4.5 12h8.2M16.3 12h3.2"}),l.jsx("path",{d:"M4.5 17.3h2.7M10.8 17.3h8.7"}),l.jsx("circle",{cx:"10.5",cy:"6.7",r:"1.8",fill:"currentColor",stroke:"none"}),l.jsx("circle",{cx:"14.5",cy:"12",r:"1.8",fill:"currentColor",stroke:"none"}),l.jsx("circle",{cx:"9",cy:"17.3",r:"1.8",fill:"currentColor",stroke:"none"})]})}function Zz({className:e="icon"}){return l.jsx("svg",{className:e,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"1.7",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":!0,children:l.jsxs("g",{transform:"translate(0 2)",children:[l.jsx("path",{d:"M11.6 3.5c.45 3.75 2.75 6.05 6.5 6.5-3.75.45-6.05 2.75-6.5 6.5-.45-3.75-2.75-6.05-6.5-6.5 3.75-.45 6.05-2.75 6.5-6.5Z"}),l.jsx("path",{d:"M18.7 3.8v3.4M20.4 5.5H17"})]})})}function wM({className:e="icon"}){return l.jsxs("svg",{className:e,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"1.7",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":!0,children:[l.jsx("path",{d:"M18.7 8.15A7.55 7.55 0 0 0 5.35 7.1"}),l.jsx("path",{d:"m18.7 8.15-.2-3.05-3.02.3"}),l.jsx("path",{d:"M5.3 15.85A7.55 7.55 0 0 0 18.65 16.9"}),l.jsx("path",{d:"m5.3 15.85.2 3.05 3.02-.3"}),l.jsx("path",{d:"M6.85 12h2.8l1.4-2.9 1.9 5.8 1.42-2.9h2.78"})]})}const _S=15,Jz=1e4,eV=[{value:"cn-beijing",label:"北京"},{value:"cn-shanghai",label:"上海"}];function tV(e){return e==="cn-beijing"?"北京":e==="cn-shanghai"?"上海":e}function vM(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 Ey(e,t=Jz){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 nV({open:e,onClose:t,variant:n="drawer",anchorTop:r=0,agentsSource:s,localApps:i,currentId:a,currentRuntime:o,runtimeScope:c,onSelect:u}){const[d,f]=w.useState([]),[h,p]=w.useState([""]),[m,y]=w.useState(0),[E,g]=w.useState(c==="mine"),[x,b]=w.useState(null),[_,k]=w.useState("cn-beijing"),[N,C]=w.useState(!1),[S,A]=w.useState(""),[O,D]=w.useState(""),[U,X]=w.useState(null),[M,j]=w.useState(new Set),[T,L]=w.useState(),[R,F]=w.useState("agent"),I=w.useRef(!1);function V(ne){L(me=>(me==null?void 0:me.runtimeId)===ne.runtimeId?void 0:{runtimeId:ne.runtimeId,name:ne.name,region:ne.region})}const W=w.useCallback(async ne=>{if(d[ne]){y(ne);return}const me=h[ne];if(me!==void 0){C(!0),A("");try{const ye=await Ey(ld({nextToken:me,pageSize:_S,region:_,scope:"all"}));f(te=>{const de=[...te];return de[ne]=ye.runtimes,de}),p(te=>{const de=[...te];return ye.nextToken&&(de[ne+1]=ye.nextToken),de}),y(ne)}catch(ye){A(ye instanceof Error?ye.message:String(ye))}finally{C(!1)}}},[h,d,_]),P=w.useCallback(async()=>{C(!0),A("");try{const ne=[];let me="";do{const ye=await Ey(ld({scope:"mine",nextToken:me,pageSize:100,region:_}));ne.push(...ye.runtimes),me=ye.nextToken}while(me&&ne.length<2e3);b(ne)}catch(ne){A(ne instanceof Error?ne.message:String(ne))}finally{C(!1)}},[_]);w.useEffect(()=>{g(c==="mine"),f([]),p([""]),y(0),b(null),I.current=!1},[c]),w.useEffect(()=>{e&&s==="cloud"&&!E&&!I.current&&(I.current=!0,W(0))},[e,s,E,W]),w.useEffect(()=>{E&&x===null&&s==="cloud"&&P()},[E,x,s,P]),w.useEffect(()=>{e&&(L(void 0),F("agent"))},[e]);function ie(){j(new Set),E?(b(null),P()):(f([]),p([""]),y(0),I.current=!0,C(!0),A(""),Ey(ld({nextToken:"",pageSize:_S,region:_,scope:"all"})).then(ne=>{f([ne.runtimes]),p(ne.nextToken?["",ne.nextToken]:[""])}).catch(ne=>A(ne instanceof Error?ne.message:String(ne))).finally(()=>C(!1)))}function G(ne){ne!==_&&(k(ne),f([]),p([""]),y(0),b(null),j(new Set),I.current=!1)}const re=!E&&(d[m+1]!==void 0||h[m+1]!==void 0);function ue(ne){X(ne.runtimeId),Nm(ne.runtimeId,ne.name,ne.region).then(me=>{u(me),t()}).catch(me=>{if(me instanceof kf){A(me.message);return}if(me instanceof Kd){me.unsupported&&j(ye=>new Set(ye).add(ne.runtimeId)),A(me.message);return}j(ye=>new Set(ye).add(ne.runtimeId))}).finally(()=>X(null))}if(!e)return null;const le=(E?x??[]:d[m]??[]).filter(ne=>O?ne.name.toLowerCase().includes(O.toLowerCase()):!0);return l.jsxs(l.Fragment,{children:[n==="drawer"?l.jsx("div",{className:"menu-scrim",onClick:t}):null,l.jsxs("div",{className:`agentsel agentsel--${n}${T&&n==="drawer"?" has-detail":""}`,role:"dialog","aria-label":"选择 Agent",style:n==="drawer"?{top:r,height:`min(640px, calc(100dvh - ${r}px - 10px))`}:void 0,children:[l.jsxs("div",{className:"agentsel-main",children:[l.jsxs("div",{className:"agentsel-head",children:[l.jsxs("span",{className:"agentsel-title",children:[l.jsx(xc,{})," 选择 Agent"]}),l.jsxs("div",{className:"agentsel-head-actions",children:[s==="cloud"&&l.jsx("button",{className:"agentsel-refresh",onClick:ie,title:"刷新",disabled:N,children:l.jsx(H1,{className:`icon ${N?"spin":""}`})}),l.jsx("button",{className:"agentsel-refresh",onClick:t,title:"关闭",children:l.jsx(zr,{className:"icon"})})]})]}),s==="local"?l.jsx("div",{className:"agentsel-body",children:i.length===0?l.jsx("div",{className:"agentsel-empty",children:"暂无本地 Agent。"}):l.jsx("ul",{className:"agentsel-list",children:i.map(ne=>l.jsx("li",{children:l.jsxs("button",{className:`agentsel-item ${ne===a?"active":""}`,onClick:()=>{u(ne),t()},children:[l.jsx(xc,{}),l.jsx("span",{className:"agentsel-item-name",children:ne})]})},ne))})}):l.jsxs("div",{className:"agentsel-body agentsel-body--cloud",children:[l.jsxs("div",{className:"agentsel-tools",children:[l.jsxs("div",{className:"agentsel-search",children:[l.jsx(Vd,{className:"icon"}),l.jsx("input",{value:O,onChange:ne=>D(ne.target.value),placeholder:"搜索 Runtime 名称"})]}),l.jsx("div",{className:"agentsel-regions","aria-label":"按部署地域筛选",children:eV.map(ne=>l.jsx("button",{type:"button",className:_===ne.value?"active":"","aria-pressed":_===ne.value,onClick:()=>G(ne.value),children:ne.label},ne.value))}),c==="all"&&l.jsxs("label",{className:"agentsel-mine",children:[l.jsx("input",{type:"checkbox",checked:E,onChange:ne=>g(ne.target.checked)}),"只看我创建的"]})]}),S&&l.jsx("div",{className:"agentsel-error",children:S}),l.jsxs("div",{className:"agentsel-listwrap",children:[le.length===0&&!N?l.jsx("div",{className:"agentsel-empty",children:"暂无 Runtime。"}):l.jsx("ul",{className:"agentsel-list",children:le.map(ne=>{const me=M.has(ne.runtimeId),ye=U===ne.runtimeId,te=(o==null?void 0:o.runtimeId)===ne.runtimeId,de=(T==null?void 0:T.runtimeId)===ne.runtimeId;return l.jsx("li",{children:l.jsxs("div",{className:`agentsel-item agentsel-runtime-item ${te?"active":""} ${de?"is-previewed":""}`,title:ne.runtimeId,children:[l.jsx(wM,{}),l.jsxs("div",{className:"agentsel-item-main",children:[l.jsx("span",{className:"agentsel-item-name",title:ne.name,children:ne.name}),l.jsxs("div",{className:"agentsel-item-meta",children:[l.jsx("span",{className:`agentsel-status is-${me?"bad":cV(ne.status)}`,children:me?"不支持":_M(ne.status)}),ne.isMine&&l.jsx("span",{className:"agentsel-badge",children:"我创建的"})]})]}),l.jsxs("div",{className:"agentsel-item-actions",children:[l.jsx("button",{type:"button",className:"agentsel-connect",disabled:ye||te,onClick:()=>ue(ne),children:ye?"连接中…":te?"已连接":me?"重试":"连接"}),n==="drawer"?l.jsx("button",{type:"button",className:`agentsel-info ${de?"active":""}`,"aria-label":`查看 ${ne.name} 信息`,"aria-pressed":de,title:"查看信息",onClick:()=>V(ne),children:l.jsx(Ka,{className:"icon"})}):null]})]})},ne.runtimeId)})}),N&&l.jsxs("div",{className:"agentsel-loading",children:[l.jsx(Rt,{className:"icon spin"})," 加载中…"]})]}),l.jsxs("div",{className:"agentsel-pager",children:[l.jsx("button",{disabled:E||m===0||N,onClick:()=>void W(m-1),"aria-label":"上一页",children:l.jsx(mH,{className:"icon"})}),l.jsx("span",{className:"agentsel-pager-label",children:E?1:m+1}),l.jsx("button",{disabled:E||!re||N,onClick:()=>void W(m+1),"aria-label":"下一页",children:l.jsx(ws,{className:"icon"})})]})]})]}),n==="drawer"&&s==="cloud"&&T&&l.jsx(aV,{runtime:T,tab:R,onTabChange:F})]})]})}const rV={knowledgebase:"知识库",memory:"记忆",prompt_manager:"提示词管理",example_store:"样例库",run_processor:"运行处理器",tracer:"链路追踪",toolset:"工具集",plugin:"插件",other:"其他"};function sV(e){return rV[e.toLowerCase()]??e}function iV(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 aV({runtime:e,tab:t,onTabChange:n}){return l.jsxs("section",{className:"agentsel-detail agentsel-preview","aria-label":"Agent 与 Runtime 信息",children:[l.jsx("div",{className:"agentsel-head agentsel-preview-head",children:l.jsxs("div",{className:`agentsel-detail-tabs is-${t}`,role:"tablist","aria-label":"详情类型",children:[l.jsx("span",{className:"agentsel-detail-tabs-slider","aria-hidden":!0}),l.jsx("button",{id:"agentsel-agent-tab",type:"button",role:"tab","aria-selected":t==="agent","aria-controls":"agentsel-agent-panel",onClick:()=>n("agent"),children:"Agent 信息"}),l.jsx("button",{id:"agentsel-runtime-tab",type:"button",role:"tab","aria-selected":t==="runtime","aria-controls":"agentsel-runtime-panel",onClick:()=>n("runtime"),children:"Runtime 信息"})]})}),l.jsx("div",{id:"agentsel-agent-panel",className:"agentsel-tab-panel",role:"tabpanel","aria-labelledby":"agentsel-agent-tab",hidden:t!=="agent",children:l.jsx(oV,{runtime:e})}),l.jsx("div",{id:"agentsel-runtime-panel",className:"agentsel-tab-panel",role:"tabpanel","aria-labelledby":"agentsel-runtime-tab",hidden:t!=="runtime",children:l.jsx(lV,{runtime:e})})]})}function oV({runtime:e}){const[t,n]=w.useState(null),[r,s]=w.useState(!0),[i,a]=w.useState(""),o=e.runtimeId,c=e.region;w.useEffect(()=>{let d=!0;return n(null),s(!0),a(""),eM(o,c).then(f=>d&&n(f)).catch(f=>{if(!d)return;const h=f instanceof Error?f.message:String(f);a(vM(h))}).finally(()=>d&&s(!1)),()=>{d=!1}},[o,c]);const u=(t==null?void 0:t.components)??[];return l.jsx("div",{className:"agentsel-detail-body",children:r?l.jsxs("div",{className:"agentsel-panel-state",children:[l.jsx(Rt,{className:"icon spin"})," 读取 Agent 信息…"]}):i?l.jsxs("div",{className:"agentsel-panel-empty",children:[l.jsx("span",{children:"暂时无法读取 Agent 信息"}),l.jsx("small",{title:i,children:i})]}):t?l.jsxs(l.Fragment,{children:[l.jsxs("div",{className:"agentsel-identity",children:[l.jsx(xc,{className:"agentsel-identity-icon"}),l.jsxs("div",{className:"agentsel-identity-copy",children:[l.jsx("strong",{title:t.name,children:t.name||"未命名 Agent"}),t.model&&l.jsx("span",{title:t.model,children:t.model})]})]}),t.description&&l.jsxs("section",{className:"agentsel-info-section",children:[l.jsx("h3",{children:"描述"}),l.jsx("p",{className:"agentsel-description",title:t.description,children:t.description})]}),t.subAgents.length>0&&l.jsx(kS,{icon:l.jsx(OL,{className:"icon"}),title:"子 Agent",values:t.subAgents}),t.tools.length>0&&l.jsx(kS,{icon:l.jsx(X1,{}),title:"工具",values:t.tools}),l.jsxs("section",{className:"agentsel-info-section",children:[l.jsxs("h3",{children:[l.jsx(Zz,{})," 技能"]}),t.skillsPreviewSupported?t.skills.length>0?l.jsx("div",{className:"agentsel-info-list",children:t.skills.map(d=>l.jsxs("div",{className:"agentsel-info-list-item",children:[l.jsx("strong",{title:d.name,children:d.name}),d.description&&l.jsx("span",{title:d.description,children:d.description})]},d.name))}):l.jsx("div",{className:"agentsel-info-empty",children:"未配置"}):l.jsx("div",{className:"agentsel-info-empty",children:"暂不支持预览"})]}),u.length>0&&l.jsxs("section",{className:"agentsel-info-section",children:[l.jsxs("h3",{children:[l.jsx(wL,{className:"icon"})," 挂载组件"]}),l.jsx("div",{className:"agentsel-info-list",children:u.map((d,f)=>l.jsxs("div",{className:"agentsel-info-list-item agentsel-component",children:[l.jsxs("div",{className:"agentsel-component-head",children:[l.jsx("strong",{title:d.name,children:d.name}),l.jsxs("span",{children:[sV(d.kind),d.backend?` · ${iV(d.backend)}`:""]})]}),d.description&&l.jsx("span",{title:d.description,children:d.description})]},`${d.kind}:${d.name}:${f}`))})]}),!t.description&&t.subAgents.length===0&&t.tools.length===0&&t.skillsPreviewSupported&&t.skills.length===0&&u.length===0&&l.jsx("div",{className:"agentsel-panel-empty",children:"暂无更多 Agent 配置信息。"})]}):null})}function kS({icon:e,title:t,values:n}){return l.jsxs("section",{className:"agentsel-info-section",children:[l.jsxs("h3",{children:[e,t]}),l.jsx("div",{className:"agentsel-chips",children:n.map((r,s)=>l.jsx("span",{className:"agentsel-chip",title:r,children:r},`${r}:${s}`))})]})}function lV({runtime:e}){const[t,n]=w.useState(null),[r,s]=w.useState(!0),[i,a]=w.useState(""),o=e.runtimeId,c=e.region;w.useEffect(()=>{let d=!0;return s(!0),a(""),n(null),Uw(o,c).then(f=>d&&n(f)).catch(f=>d&&a(vM(f instanceof Error?f.message:String(f)))).finally(()=>d&&s(!1)),()=>{d=!1}},[o,c]);const u=[];if(t){t.model&&u.push(["模型",t.model]),t.description&&u.push(["描述",t.description]),t.status&&u.push(["状态",_M(t.status)]),t.region&&u.push(["区域",tV(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 l.jsxs("div",{className:"agentsel-detail-body",children:[l.jsxs("div",{className:"agentsel-runtime-identity",children:[l.jsx(wM,{}),l.jsxs("div",{children:[l.jsx("strong",{title:e.name,children:e.name}),l.jsx("span",{title:e.runtimeId,children:e.runtimeId})]})]}),r?l.jsxs("div",{className:"agentsel-apps-note",children:[l.jsx(Rt,{className:"icon spin"})," 读取详情…"]}):i?l.jsx("div",{className:"agentsel-error",children:i}):t?l.jsxs(l.Fragment,{children:[l.jsx("dl",{className:"agentsel-kv",children:u.map(([d,f])=>l.jsxs("div",{className:"agentsel-kv-row",children:[l.jsx("dt",{children:d}),l.jsx("dd",{children:f})]},d))}),t.envs.length>0&&l.jsxs("div",{className:"agentsel-envs",children:[l.jsx("div",{className:"agentsel-envs-head",children:"环境变量"}),t.envs.map(d=>l.jsxs("div",{className:"agentsel-env",children:[l.jsx("span",{className:"agentsel-env-k",children:d.key}),l.jsx("span",{className:"agentsel-env-v",children:d.value})]},d.key))]})]}):null]})}function cV(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 uV={ready:"就绪",unreleased:"未发布",running:"运行中",active:"运行中",creating:"创建中",pending:"等待中",deploying:"部署中",updating:"更新中",failed:"失败",error:"异常",stopping:"停止中",stopped:"已停止",deleting:"删除中",deleted:"已删除"};function _M(e){const t=e.toLowerCase().replace(/[\s_-]/g,"");return uV[t]??(e||"-")}function dV({appName:e,onAppChange:t,agentLabel:n,agentsSource:r,localApps:s,currentRuntime:i,runtimeScope:a,title:o,titleLeading:c,crumbs:u,rightContent:d}){return l.jsxs("div",{className:"navbar",children:[l.jsxs("div",{className:"navbar-left",children:[l.jsx("div",{className:"navbar-default",children:u&&u.length>0?l.jsx("nav",{className:"navbar-crumbs","aria-label":"面包屑",children:u.map((f,h)=>l.jsxs(w.Fragment,{children:[h>0&&l.jsx(ws,{className:"crumb-sep"}),f.onClick?l.jsx("button",{className:"crumb crumb-link",onClick:f.onClick,children:f.label}):l.jsx("span",{className:"crumb crumb-current",children:f.label})]},h))}):o?l.jsxs("div",{className:"navbar-title-group",children:[c,l.jsx("div",{className:"navbar-title",title:o,children:o})]}):l.jsxs("div",{className:"navbar-title-group",children:[c,l.jsx(fV,{appName:e,onAppChange:t,agentLabel:n,agentsSource:r,localApps:s,currentRuntime:i,runtimeScope:a})]})}),l.jsx("div",{id:"veadk-page-header-left",className:"navbar-portal-slot"})]}),l.jsxs("div",{className:"navbar-right",children:[l.jsx("div",{id:"veadk-page-header-actions",className:"navbar-portal-actions"}),d]})]})}function fV({appName:e,onAppChange:t,agentLabel:n,agentsSource:r,localApps:s,currentRuntime:i,runtimeScope:a}){const[o,c]=w.useState(!1),u=f=>n?n(f):f;function d(){c(!1)}return l.jsxs("div",{className:"agent-dd",children:[l.jsxs("button",{className:"agent-dd-trigger",onClick:()=>c(f=>!f),children:[l.jsx("span",{className:"agent-dd-current",children:e?u(e):"选择 Agent"}),l.jsx(Sw,{className:`agent-dd-chev ${o?"open":""}`})]}),o&&l.jsxs(l.Fragment,{children:[l.jsx("div",{className:"menu-scrim",onClick:d}),l.jsx(nV,{open:!0,variant:"navbar",agentsSource:r,localApps:s,currentId:e,currentRuntime:i,runtimeScope:a,onSelect:f=>{t(f),d()},onClose:d})]})]})}async function Nf(e){const t=await fetch(e,{headers:{accept:"application/json"},signal:Gs(void 0,Kc)});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 kM(){return(await Nf("/web/skill-spaces?region=all")).items||[]}async function hV(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),Nf(`/web/skill-spaces?${t.toString()}`)}async function NM(e,t){const n=t?`?region=${encodeURIComponent(t)}`:"";return(await Nf(`/web/skill-spaces/${encodeURIComponent(e)}/skills${n}`)).items||[]}async function pV(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),Nf(`/web/skill-spaces/${encodeURIComponent(e)}/skills?${n.toString()}`)}async function mV(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 Nf(`/web/skill-spaces/${encodeURIComponent(e)}/skills/${encodeURIComponent(t)}${a}`)}function gV(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 yV(e,t){return`https://console.volcengine.com/agentkit/${(t||"cn-beijing")==="cn-beijing"?"cn":"cn-shanghai"}/skillspace/detail/${encodeURIComponent(e)}`}const bV="https://ark.cn-beijing.volces.com/api/v3/",Np=[{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:bV}],wc=[],bu=[{key:"FEISHU_APP_ID",required:!0,placeholder:"cli_xxx",comment:"飞书应用 App ID"},{key:"FEISHU_APP_SECRET",required:!0,placeholder:"输入 App Secret",comment:"飞书应用 App Secret"}],qs={topK:"3",region:"cn-beijing",endpoint:"https://open.volcengineapi.com/"},SM=[{key:"REGISTRY_SPACE_ID",required:!0,placeholder:"请选择智能体中心",comment:"AgentKit 智能体中心"},{key:"REGISTRY_TOP_K",required:!1,placeholder:qs.topK,comment:"召回 Agent 数量"},{key:"REGISTRY_REGION",required:!1,placeholder:qs.region,comment:"AgentKit 智能体中心地域"},{key:"REGISTRY_ENDPOINT",required:!1,placeholder:qs.endpoint,comment:"AgentKit 智能体中心 OpenAPI 地址"}],vc=[{id:"web_search",label:"联网搜索",desc:"火山引擎 Web Search,获取实时信息。",importLine:"from veadk.tools.builtin_tools.web_search import web_search",toolNames:["web_search"],env:wc},{id:"parallel_web_search",label:"并行联网搜索",desc:"并行发起多条搜索查询,更快汇总。",importLine:"from veadk.tools.builtin_tools.parallel_web_search import parallel_web_search",toolNames:["parallel_web_search"],env:wc},{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:"run_code",label:"代码执行",desc:"在沙箱中执行代码",importLine:"from veadk.tools.builtin_tools.run_code import run_code",toolNames:["run_code"],env:[{key:"AGENTKIT_TOOL_ID",required:!0,placeholder:"t-xxxx",comment:"代码执行沙箱 ID"},{key:"AGENTKIT_TOOL_REGION",required:!1,placeholder:"cn-beijing",comment:"AgentKit Tools 地域"}]},{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"}]}],Q1=[{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}]}],Z1=[{id:"local",label:"本地向量库",desc:"进程内 llama-index 向量库。",env:Np,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},...Np],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},...Np],pipExtra:"extensions",needsEmbedding:!0},{id:"viking",label:"VikingDB Memory",desc:"火山 VikingDB 记忆库(支持用户画像)。",env:wc},{id:"mem0",label:"Mem0",desc:"Mem0 托管记忆服务。",env:[{key:"DATABASE_MEM0_API_KEY",required:!0},{key:"DATABASE_MEM0_BASE_URL",required:!1}]}],Gd="viking",J1=[{id:"viking",label:"VikingDB Knowledge",desc:"火山 VikingDB 知识库。",env:wc},{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},...Np],pipExtra:"extensions",needsEmbedding:!0},{id:"context_search",label:"Context Search",desc:"火山 Context Search 引擎(无需向量化)。",env:[...wc,{key:"DATABASE_CONTEXT_SEARCH_ENGINE_ID",required:!0},{key:"DATABASE_CONTEXT_SEARCH_ENGINE_ENDPOINT",required:!0},{key:"DATABASE_CONTEXT_SEARCH_ENGINE_APIKEY",required:!0}]}],eE=[{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:[...wc,{key:"OBSERVABILITY_OPENTELEMETRY_TLS_SERVICE_NAME",required:!1,comment:"TLS topic_id,留空自动创建"}]}],EV={coding:"智能编程",get_city_weather:"城市天气查询",get_location_weather:"位置天气查询",web_fetch:"网页内容获取"};function tE(e){const t=vc.find(n=>n.id===e||n.toolNames.includes(e));return EV[e]??(t==null?void 0:t.label)??e}function NS(e){const t=vc.find(r=>r.id===e||r.toolNames.includes(e));return((t==null?void 0:t.desc)??"由 VeADK 提供的内置工具").replace(/[。.]+$/,"")}function xV(){return l.jsx("svg",{viewBox:"0 0 24 24",fill:"none","aria-hidden":"true",children:l.jsx("path",{d:"m7 7 10 10M17 7 7 17",stroke:"currentColor",strokeWidth:"1.7",strokeLinecap:"round"})})}function wV(){return l.jsxs("svg",{viewBox:"0 0 24 24",fill:"none","aria-hidden":"true",children:[l.jsx("circle",{cx:"10.8",cy:"10.8",r:"5.8",stroke:"currentColor",strokeWidth:"1.7"}),l.jsx("path",{d:"m15.2 15.2 4 4",stroke:"currentColor",strokeWidth:"1.7",strokeLinecap:"round"})]})}function SS(){return l.jsx("svg",{viewBox:"0 0 24 24",fill:"none","aria-hidden":"true",children:l.jsx("path",{d:"M12 5.5v13M5.5 12h13",stroke:"currentColor",strokeWidth:"1.7",strokeLinecap:"round"})})}function TM({title:e,description:t,icon:n,wide:r=!1,onClose:s,children:i}){const a=w.useRef(`session-capability-${Math.random().toString(36).slice(2)}`);return w.useEffect(()=>{const o=document.body.style.overflow;document.body.style.overflow="hidden";const c=u=>{u.key==="Escape"&&s()};return document.addEventListener("keydown",c),()=>{document.removeEventListener("keydown",c),document.body.style.overflow=o}},[s]),Ss.createPortal(l.jsxs("div",{className:"session-capability-dialog-layer",children:[l.jsx("button",{type:"button",className:"session-capability-dialog-scrim","aria-label":"关闭弹窗",onClick:s}),l.jsxs("section",{className:`session-capability-dialog${r?" is-wide":""}`,role:"dialog","aria-modal":"true","aria-labelledby":a.current,children:[l.jsxs("header",{className:`session-capability-dialog-head${n?"":" is-iconless"}`,children:[n&&l.jsx("span",{className:"session-capability-dialog-mark",children:n}),l.jsxs("div",{children:[l.jsx("h2",{id:a.current,children:e}),l.jsx("p",{children:t})]}),l.jsx("button",{type:"button",className:"session-capability-dialog-close","aria-label":`关闭${e}`,onClick:s,children:l.jsx(xV,{})})]}),i]})]}),document.body)}function Sp({value:e,placeholder:t,label:n,onChange:r,autoFocus:s=!1}){return l.jsxs("label",{className:"session-capability-search",children:[l.jsx(wV,{}),l.jsx("input",{value:e,"aria-label":n,placeholder:t,autoFocus:s,onChange:i=>r(i.target.value)})]})}function vV({agentName:e,tools:t,selectedNames:n,mutating:r,onAdd:s,onClose:i}){const[a,o]=w.useState(""),[c,u]=w.useState(""),d=w.useMemo(()=>new Set(n),[n]),f=w.useMemo(()=>{const p=a.trim().toLowerCase();return t.filter(m=>p?`${tE(m)} ${m} ${NS(m)}`.toLowerCase().includes(p):!0)},[a,t]),h=async p=>{u(p);const m=await s({kind:"tool",name:p});u(""),m&&i()};return l.jsx(TM,{title:"添加内置工具",description:`添加后仅对 ${e} 的当前会话生效`,icon:l.jsx(X1,{}),onClose:i,children:l.jsxs("div",{className:"session-tool-dialog-body",children:[l.jsx(Sp,{value:a,label:"搜索内置工具",placeholder:"搜索中文名称或工具标识",onChange:o,autoFocus:!0}),l.jsx("div",{className:"session-tool-picker",role:"list","aria-label":"可用内置工具",children:f.length===0?l.jsx("div",{className:"session-capability-empty",children:"没有匹配的内置工具"}):f.map(p=>{const m=d.has(p),y=c===p;return l.jsxs("article",{className:"session-tool-option",role:"listitem",children:[l.jsx("span",{className:"session-tool-option-icon",children:l.jsx(X1,{})}),l.jsxs("span",{className:"session-tool-option-copy",children:[l.jsx("strong",{children:tE(p)}),l.jsx("code",{children:p}),l.jsx("span",{children:NS(p)})]}),l.jsx("button",{type:"button",disabled:m||r||!!c,onClick:()=>void h(p),children:m?"已添加":y?"添加中…":"添加"})]},p)})})]})})}function _V({appName:e,agentName:t,selectedNames:n,mutating:r,onAdd:s,onClose:i}){const[a,o]=w.useState("public"),[c,u]=w.useState(""),[d,f]=w.useState([]),[h,p]=w.useState(0),[m,y]=w.useState(!0),[E,g]=w.useState(""),[x,b]=w.useState([]),[_,k]=w.useState(null),[N,C]=w.useState([]),[S,A]=w.useState(""),[O,D]=w.useState(""),[U,X]=w.useState(!0),[M,j]=w.useState(!1),[T,L]=w.useState(""),[R,F]=w.useState(""),I=w.useMemo(()=>new Set(n),[n]);w.useEffect(()=>{if(a!=="public")return;let G=!0;const re=window.setTimeout(()=>{y(!0),g(""),XL(e,c.trim()).then(ue=>{G&&(f(ue.items),p(ue.totalCount))}).catch(ue=>{G&&(f([]),p(0),g(ue instanceof Error?ue.message:"搜索 Skill Hub 失败"))}).finally(()=>{G&&y(!1)})},250);return()=>{G=!1,window.clearTimeout(re)}},[e,c,a]),w.useEffect(()=>{if(a!=="agentkit")return;let G=!0;return X(!0),L(""),kM().then(re=>{G&&(b(re),k(re[0]??null))}).catch(re=>{G&&L(re instanceof Error?re.message:"读取 Skill Space 失败")}).finally(()=>{G&&X(!1)}),()=>{G=!1}},[a]),w.useEffect(()=>{if(a!=="agentkit")return;if(!_){C([]);return}let G=!0;return j(!0),L(""),NM(_.id,_.region).then(re=>{G&&C(re)}).catch(re=>{G&&L(re instanceof Error?re.message:"读取技能失败")}).finally(()=>{G&&j(!1)}),()=>{G=!1}},[_,a]);const V=w.useMemo(()=>{const G=S.trim().toLowerCase();return G?x.filter(re=>`${re.name} ${re.id} ${re.description}`.toLowerCase().includes(G)):x},[S,x]),W=w.useMemo(()=>{const G=O.trim().toLowerCase();return G?N.filter(re=>`${re.skillName} ${re.skillDescription}`.toLowerCase().includes(G)):N},[O,N]),P=async G=>{if(!_)return;F(G.skillId);const re=await s({kind:"skill",name:G.skillName,skillSourceId:_.id,description:G.skillDescription,version:G.version});F(""),re&&i()},ie=async G=>{F(G.slug);const re=await s({kind:"skill",name:G.name,skillSourceId:`findskill:${G.slug}`,description:G.description,version:G.version||G.updatedAt});F(""),re&&i()};return l.jsx(TM,{title:"添加技能",description:`从公域 Skill Hub 或 AgentKit Skill 中心添加到 ${t} 当前会话`,wide:!0,onClose:i,children:l.jsxs("div",{className:"session-skill-dialog-body",children:[l.jsxs("div",{className:"session-skill-source-tabs",role:"tablist","aria-label":"技能来源",children:[l.jsxs("button",{type:"button",role:"tab","aria-selected":a==="public",className:a==="public"?"is-active":"",onClick:()=>o("public"),children:["Skill Hub",l.jsx("span",{children:"公域"})]}),l.jsx("button",{type:"button",role:"tab","aria-selected":a==="agentkit",className:a==="agentkit"?"is-active":"",onClick:()=>o("agentkit"),children:"AgentKit Skill 中心"})]}),a==="public"?l.jsxs("section",{className:"session-public-skill-browser","aria-label":"Skill Hub 公域技能",children:[l.jsxs("div",{className:"session-public-skill-head",children:[l.jsx(Sp,{value:c,label:"搜索 Skill Hub",placeholder:"搜索技能名称、用途或关键词",onChange:u,autoFocus:!0}),l.jsxs("span",{children:[h.toLocaleString()," 个公域技能"]})]}),l.jsx("div",{className:"session-public-skill-list",children:E?l.jsx("div",{className:"session-capability-error",children:E}):m?l.jsx("div",{className:"session-capability-loading",children:"正在搜索 Skill Hub…"}):d.length===0?l.jsx("div",{className:"session-capability-empty",children:"没有匹配的公域技能"}):d.map(G=>{const re=I.has(G.name),ue=R===G.slug;return l.jsxs("article",{className:"session-skill-option session-public-skill-option",children:[l.jsxs("span",{className:"session-skill-option-copy",children:[l.jsx("strong",{children:G.name}),l.jsx("span",{children:G.description||"暂无描述"}),l.jsxs("small",{children:[G.sourceRepo||G.sourceType||"FindSkill",l.jsx("span",{"aria-hidden":"true",children:" · "}),G.downloadCount.toLocaleString()," 次下载",G.evaluationScore>0&&l.jsxs(l.Fragment,{children:[l.jsx("span",{"aria-hidden":"true",children:" · "}),G.evaluationScore.toFixed(1)," 分"]})]})]}),l.jsx("button",{type:"button",disabled:re||r||!!R,onClick:()=>void ie(G),children:re?"已添加":ue?"添加中…":l.jsxs(l.Fragment,{children:[l.jsx(SS,{}),"添加"]})})]},G.slug)})})]}):l.jsxs("div",{className:"session-skill-browser",children:[l.jsxs("section",{className:"session-skill-spaces","aria-label":"Skill Space 列表",children:[l.jsxs("div",{className:"session-skill-pane-head",children:[l.jsxs("div",{children:[l.jsx("strong",{children:"Skill Space"}),l.jsx("span",{children:x.length})]}),l.jsx(Sp,{value:S,label:"搜索 Skill Space",placeholder:"搜索空间",onChange:A,autoFocus:!0})]}),l.jsx("div",{className:"session-skill-pane-list",children:U?l.jsx("div",{className:"session-capability-loading",children:"正在读取 Skill Space…"}):V.length===0?l.jsx("div",{className:"session-capability-empty",children:"没有匹配的 Skill Space"}):V.map(G=>l.jsx("button",{type:"button",className:`session-skill-space${(_==null?void 0:_.id)===G.id?" is-active":""}`,onClick:()=>{k(G),D("")},children:l.jsxs("span",{children:[l.jsx("strong",{children:G.name||G.id}),l.jsx("small",{children:G.description||G.id}),l.jsxs("em",{children:[G.skillCount??0," 个技能"]})]})},`${G.projectName??"default"}:${G.id}`))})]}),l.jsxs("section",{className:"session-skill-results","aria-label":"AgentKit Skill 列表",children:[l.jsxs("div",{className:"session-skill-pane-head",children:[l.jsxs("div",{children:[l.jsx("strong",{title:_==null?void 0:_.name,children:(_==null?void 0:_.name)||"选择 Skill Space"}),l.jsx("span",{children:N.length})]}),l.jsx(Sp,{value:O,label:"搜索 AgentKit 技能",placeholder:"搜索技能名称或描述",onChange:D})]}),l.jsx("div",{className:"session-skill-pane-list",children:T?l.jsx("div",{className:"session-capability-error",children:T}):_?M?l.jsx("div",{className:"session-capability-loading",children:"正在读取技能…"}):W.length===0?l.jsx("div",{className:"session-capability-empty",children:"没有匹配的技能"}):W.map(G=>{const re=I.has(G.skillName),ue=R===G.skillId;return l.jsxs("article",{className:"session-skill-option",children:[l.jsxs("span",{className:"session-skill-option-copy",children:[l.jsx("strong",{children:G.skillName}),l.jsx("span",{children:G.skillDescription||"暂无描述"}),l.jsxs("small",{children:["版本 ",G.version||"—"]})]}),l.jsx("button",{type:"button",disabled:re||r||!!R,onClick:()=>void P(G),children:re?"已添加":ue?"添加中…":l.jsxs(l.Fragment,{children:[l.jsx(SS,{}),"添加"]})})]},`${G.skillId}:${G.version}`)}):l.jsx("div",{className:"session-capability-empty",children:"选择一个 Skill Space 查看技能"})})]})]})]})})}function ta({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 l.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})}const kV={llm:"LLM",sequential:"顺序",parallel:"并行",loop:"循环",a2a:"A2A"};function AM(e){return 1+e.children.reduce((t,n)=>t+AM(n),0)}function _c(e){return e.id||e.name}function NV(e,t){const n=_c(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 CM(e,t=!0){return{...e,id:_c(e),name:NV(e,t),children:e.children.map(n=>CM(n,!1))}}function IM(e,t){t.set(_c(e),e.name||_c(e)),e.children.forEach(n=>IM(n,t))}function SV(e){return[...new Set(e.map(t=>t.trim()).filter(Boolean))]}function TV(e){return[...new Map(e.filter(t=>t.name.trim()).map(t=>[t.name.trim(),{...t,name:t.name.trim()}])).values()]}function OM({node:e,activeAgent:t,seen:n,path:r}){const s=_c(e),i=!!s&&s===t,a=!!s&&!i&&r.has(s),o=!!s&&!i&&!a&&n.has(s);return l.jsxs("div",{className:"topo-branch",children:[l.jsxs("div",{className:`topo-node topo-type-${e.type} ${i?"is-active":""} ${a?"is-onpath":""} ${o?"is-done":""}`,title:e.description||e.name,children:[l.jsx(xc,{className:"topo-icon"}),l.jsx("span",{className:"topo-name",children:e.name||"未命名 Agent"}),l.jsx("span",{className:"topo-badge",children:kV[e.type]??"Agent"})]}),i&&e.type==="a2a"&&l.jsx("div",{className:"topo-remote",children:"远程执行中…"}),e.children.length>0&&l.jsx("div",{className:"topo-children",children:e.children.map(c=>l.jsx(OM,{node:c,activeAgent:t,seen:n,path:r},_c(c)))})]})}function xy({title:e,count:t}){return l.jsxs("div",{className:"topo-module-title",children:[l.jsx("span",{className:"topo-module-label",title:e,children:e}),t!==void 0&&l.jsx("span",{className:"topo-section-count","aria-label":`${t} 项`,children:t})]})}function RM({appName:e,info:t,loading:n,activeAgent:r,seenAgents:s,execPath:i=[],variant:a="rail",capabilities:o=null,capabilityLoading:c=!1,capabilityMutating:u=!1,builtinTools:d=[],onAddCapability:f,onRemoveCapability:h}){const[p,m]=w.useState(null);if(n&&!t)return l.jsx("aside",{className:`topo is-loading${a==="drawer"?" is-drawer":""}`,"aria-label":"Agent 信息","aria-live":"polite",children:l.jsx(ta,{as:"span",className:"topo-loading-label",duration:2.2,children:"正在读取 Agent 信息…"})});if(!t)return null;const y=CM(t.graph??{id:t.name,name:t.name,description:t.description,type:t.type??"llm",model:t.model,tools:t.tools,skills:t.skills,path:[t.name],mentionable:!1,children:[]}),E=(o==null?void 0:o.tools)??SV(t.tools).map(k=>({id:`base:tool:${k}`,kind:"tool",name:k,custom:!1})),g=(o==null?void 0:o.skills)??TV(t.skills).map(k=>({id:`base:skill:${k.name}`,kind:"skill",name:k.name,description:k.description,custom:!1})),x=!!(o&&f&&h),b=new Set(i),_=new Map;return IM(y,_),l.jsxs("aside",{className:`topo${a==="drawer"?" is-drawer":""}`,"aria-label":"Agent 信息与拓扑",children:[l.jsxs("section",{className:"topo-agent-card","aria-label":"Agent 信息",children:[l.jsxs("div",{className:"topo-agent-heading",children:[l.jsx("h2",{title:t.name,children:t.name||"未命名 Agent"}),t.model&&l.jsx("span",{title:t.model,children:t.model})]}),t.description&&l.jsx("p",{className:"topo-description",title:t.description,children:t.description})]}),l.jsxs("div",{className:"topo-module-stack",children:[l.jsxs("section",{className:"topo-module-card topo-tools-card","aria-label":"工具",children:[l.jsx(xy,{title:"工具",count:E.length}),l.jsx("div",{className:"topo-module-scroll topo-tools-scroll",role:"region","aria-label":"工具列表",tabIndex:0,children:E.length>0?l.jsx("div",{className:"topo-tool-list",children:E.map(k=>l.jsxs("div",{className:"topo-tool",title:k.name,children:[l.jsxs("span",{className:"topo-capability-title",children:[l.jsxs("span",{className:"topo-capability-copy",children:[l.jsx("span",{className:"topo-capability-name",children:tE(k.name)}),l.jsx("code",{children:k.name})]}),k.custom&&l.jsx("span",{className:"topo-custom-badge",children:"自定义"})]}),k.custom&&l.jsx("button",{type:"button",className:"topo-remove-capability","aria-label":`移除工具 ${k.name}`,title:"移除",disabled:u,onClick:()=>h==null?void 0:h(k.id),children:"×"})]},k.id))}):l.jsx("div",{className:"topo-empty",children:"未配置"})}),x&&l.jsx("div",{className:"topo-capability-add-dock",children:l.jsxs("button",{type:"button",className:"topo-capability-add-slot","aria-label":"添加内置工具",disabled:c||u,onClick:()=>m("tool"),children:[l.jsx("span",{"aria-hidden":"true",children:"+"}),l.jsx("span",{children:"在此对话中添加工具"})]})})]}),l.jsxs("section",{className:"topo-module-card topo-skills-card","aria-label":"技能",children:[l.jsx(xy,{title:"技能",count:t.skillsPreviewSupported?g.length:void 0}),l.jsx("div",{className:"topo-module-scroll topo-skills-scroll",role:"region","aria-label":"技能列表",tabIndex:0,children:t.skillsPreviewSupported?g.length>0?l.jsx("div",{className:"topo-skill-list",children:g.map(k=>l.jsxs("div",{className:"topo-skill",title:k.description||k.name,children:[l.jsxs("div",{className:"topo-skill-title",children:[l.jsx("span",{className:"topo-skill-name",children:k.name}),k.custom&&l.jsx("span",{className:"topo-custom-badge",children:"自定义"}),k.custom&&l.jsx("button",{type:"button",className:"topo-remove-capability","aria-label":`移除技能 ${k.name}`,title:"移除",disabled:u,onClick:()=>h==null?void 0:h(k.id),children:"×"})]}),k.description&&l.jsx("span",{className:"topo-skill-description",children:k.description})]},`${k.name}:${k.description}`))}):l.jsx("div",{className:"topo-empty",children:"未配置"}):l.jsx("div",{className:"topo-empty",children:"暂不支持预览"})}),x&&l.jsx("div",{className:"topo-capability-add-dock",children:l.jsxs("button",{type:"button",className:"topo-capability-add-slot","aria-label":"添加技能",disabled:c||u,onClick:()=>m("skill"),children:[l.jsx("span",{"aria-hidden":"true",children:"+"}),l.jsx("span",{children:"在此对话中添加技能"})]})})]}),l.jsxs("section",{className:"topo-module-card topo-topology","aria-label":"Agent 拓扑",children:[l.jsx(xy,{title:"拓扑",count:AM(y)}),l.jsxs("div",{className:"topo-module-scroll topo-topology-scroll",role:"region","aria-label":"Agent 拓扑列表",tabIndex:0,children:[i.length>1&&l.jsx("div",{className:"topo-path","aria-label":"执行路径",children:i.map((k,N)=>l.jsx("span",{className:"topo-path-seg",children:l.jsx("span",{className:N===i.length-1?"topo-path-name is-current":"topo-path-name",children:_.get(k)??k})},`${k}-${N}`))}),l.jsx("div",{className:"topo-tree",children:l.jsx(OM,{node:y,activeAgent:r,seen:s,path:b})})]})]})]}),p==="tool"&&f&&l.jsx(vV,{agentName:t.name,tools:d,selectedNames:E.map(k=>k.name),mutating:u,onAdd:f,onClose:()=>m(null)}),p==="skill"&&f&&l.jsx(_V,{appName:e,agentName:t.name,selectedNames:g.map(k=>k.name),mutating:u,onAdd:f,onClose:()=>m(null)})]})}function AV(){return l.jsx("svg",{className:"icon",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"1.8",strokeLinecap:"round","aria-hidden":"true",children:l.jsx("path",{d:"M6 6l12 12M18 6 6 18"})})}function CV({appName:e,info:t,loading:n,activeAgent:r,seenAgents:s,execPath:i,capabilities:a,capabilityLoading:o,capabilityMutating:c,builtinTools:u,onAddCapability:d,onRemoveCapability:f,onClose:h,returnFocusRef:p}){return w.useEffect(()=>{const m=document.body.style.overflow;document.body.style.overflow="hidden";const y=E=>{E.key==="Escape"&&h()};return document.addEventListener("keydown",y),()=>{var E;document.removeEventListener("keydown",y),document.body.style.overflow=m,(E=p.current)==null||E.focus()}},[h,p]),l.jsxs(l.Fragment,{children:[l.jsx("div",{className:"drawer-scrim agent-info-scrim",onClick:h}),l.jsxs("aside",{className:"drawer drawer--agent-info",role:"dialog","aria-modal":"true","aria-labelledby":"agent-info-drawer-title",children:[l.jsxs("header",{className:"drawer-head",children:[l.jsxs("div",{children:[l.jsx("div",{id:"agent-info-drawer-title",className:"drawer-title",children:"Agent 信息"}),l.jsx("div",{className:"drawer-sub",children:"能力与协作拓扑"})]}),l.jsx("button",{type:"button",className:"drawer-close",onClick:h,"aria-label":"关闭 Agent 信息",autoFocus:!0,children:l.jsx(AV,{})})]}),l.jsx("div",{className:"agent-info-drawer-body",children:t||n?l.jsx(RM,{appName:e,info:t,loading:n,activeAgent:r,seenAgents:s,execPath:i,capabilities:a,capabilityLoading:o,capabilityMutating:c,builtinTools:u,onAddCapability:d,onRemoveCapability:f,variant:"drawer"}):l.jsx("div",{className:"drawer-empty",children:"暂时无法读取 Agent 信息。"})})]})]})}function Hye(){}function TS(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 LM(e,t){const n={};return(e[e.length-1]===""?[...e,""]:e).join((n.padRight?" ":"")+","+(n.padLeft===!1?"":" ")).trim()}const IV=/[$_\p{ID_Start}]/u,OV=/[$_\u{200C}\u{200D}\p{ID_Continue}]/u,RV=/[-$_\u{200C}\u{200D}\p{ID_Continue}]/u,LV=/^[$_\p{ID_Start}][$_\u{200C}\u{200D}\p{ID_Continue}]*$/u,MV=/^[$_\p{ID_Start}][-$_\u{200C}\u{200D}\p{ID_Continue}]*$/u,MM={};function zye(e){return e?IV.test(String.fromCodePoint(e)):!1}function Vye(e,t){const r=(t||MM).jsx?RV:OV;return e?r.test(String.fromCodePoint(e)):!1}function AS(e,t){return(MM.jsx?MV:LV).test(e)}const jV=/[ \t\n\f\r]/g;function DV(e){return typeof e=="object"?e.type==="text"?CS(e.value):!1:CS(e)}function CS(e){return e.replace(jV,"")===""}let Sf=class{constructor(t,n,r){this.normal=n,this.property=t,r&&(this.space=r)}};Sf.prototype.normal={};Sf.prototype.property={};Sf.prototype.space=void 0;function jM(e,t){const n={},r={};for(const s of e)Object.assign(n,s.property),Object.assign(r,s.normal);return new Sf(n,r,t)}function qd(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 PV=0;const lt=qo(),On=qo(),nE=qo(),Ce=qo(),Ut=qo(),nc=qo(),qr=qo();function qo(){return 2**++PV}const rE=Object.freeze(Object.defineProperty({__proto__:null,boolean:lt,booleanish:On,commaOrSpaceSeparated:qr,commaSeparated:nc,number:Ce,overloadedBoolean:nE,spaceSeparated:Ut},Symbol.toStringTag,{value:"Module"})),wy=Object.keys(rE);class zw extends Vr{constructor(t,n,r,s){let i=-1;if(super(t,n),IS(this,"space",s),typeof r=="number")for(;++i4&&n.slice(0,4)==="data"&&HV.test(t)){if(t.charAt(4)==="-"){const i=t.slice(5).replace(OS,VV);r="data"+i.charAt(0).toUpperCase()+i.slice(1)}else{const i=t.slice(4);if(!OS.test(i)){let a=i.replace($V,zV);a.charAt(0)!=="-"&&(a="-"+a),t="data"+a}}s=zw}return new s(r,t)}function zV(e){return"-"+e.toLowerCase()}function VV(e){return e.charAt(1).toUpperCase()}const Tf=jM([DM,BV,FM,UM,$M],"html"),Ya=jM([DM,FV,FM,UM,$M],"svg");function RS(e){const t=String(e||"").trim();return t?t.split(/[ \t\n\r\f]+/g):[]}function HM(e){return e.join(" ").trim()}var Vw={},LS=/\/\*[^*]*\*+([^/*][^*]*\*+)*\//g,KV=/\n/g,YV=/^\s*/,WV=/^(\*?[-#/*\\\w]+(\[[0-9a-z_-]+\])?)\s*/,GV=/^:\s*/,qV=/^((?:'(?:\\'|.)*?'|"(?:\\"|.)*?"|\([^)]*?\)|[^};])+)/,XV=/^[;\s]*/,QV=/^\s+|\s+$/g,ZV=` -`,MS="/",jS="*",ho="",JV="comment",eK="declaration";function tK(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(KV);y&&(n+=y.length);var E=m.lastIndexOf(ZV);r=~E?m.length-E: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 c(m){var y=m.exec(e);if(y){var E=y[0];return s(E),e=e.slice(E.length),y}}function u(){c(YV)}function d(m){var y;for(m=m||[];y=f();)y!==!1&&m.push(y);return m}function f(){var m=i();if(!(MS!=e.charAt(0)||jS!=e.charAt(1))){for(var y=2;ho!=e.charAt(y)&&(jS!=e.charAt(y)||MS!=e.charAt(y+1));)++y;if(y+=2,ho===e.charAt(y-1))return o("End of comment missing");var E=e.slice(2,y-2);return r+=2,s(E),e=e.slice(y),r+=2,m({type:JV,comment:E})}}function h(){var m=i(),y=c(WV);if(y){if(f(),!c(GV))return o("property missing ':'");var E=c(qV),g=m({type:eK,property:DS(y[0].replace(LS,ho)),value:E?DS(E[0].replace(LS,ho)):ho});return c(XV),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 DS(e){return e?e.replace(QV,ho):ho}var nK=tK,rK=$p&&$p.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(Vw,"__esModule",{value:!0});Vw.default=iK;const sK=rK(nK);function iK(e,t){let n=null;if(!e||typeof e!="string")return n;const r=(0,sK.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 jg={};Object.defineProperty(jg,"__esModule",{value:!0});jg.camelCase=void 0;var aK=/^--[a-zA-Z0-9_-]+$/,oK=/-([a-z])/g,lK=/^[^-]+$/,cK=/^-(webkit|moz|ms|o|khtml)-/,uK=/^-(ms)-/,dK=function(e){return!e||lK.test(e)||aK.test(e)},fK=function(e,t){return t.toUpperCase()},PS=function(e,t){return"".concat(t,"-")},hK=function(e,t){return t===void 0&&(t={}),dK(e)?e:(e=e.toLowerCase(),t.reactCompat?e=e.replace(uK,PS):e=e.replace(cK,PS),e.replace(oK,fK))};jg.camelCase=hK;var pK=$p&&$p.__importDefault||function(e){return e&&e.__esModule?e:{default:e}},mK=pK(Vw),gK=jg;function sE(e,t){var n={};return!e||typeof e!="string"||(0,mK.default)(e,function(r,s){r&&s&&(n[(0,gK.camelCase)(r,t)]=s)}),n}sE.default=sE;var yK=sE;const bK=pf(yK),Dg=zM("end"),_i=zM("start");function zM(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 EK(e){const t=_i(e),n=Dg(e);if(t&&n)return{start:t,end:n}}function cd(e){return!e||typeof e!="object"?"":"position"in e||"type"in e?BS(e.position):"start"in e||"end"in e?BS(e):"line"in e||"column"in e?iE(e):""}function iE(e){return FS(e&&e.line)+":"+FS(e&&e.column)}function BS(e){return iE(e&&e.start)+"-"+iE(e&&e.end)}function FS(e){return e&&typeof e=="number"?e:1}class yr 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 c=r.indexOf(":");c===-1?i.ruleId=r:(i.source=r.slice(0,c),i.ruleId=r.slice(c+1))}if(!i.place&&i.ancestors&&i.ancestors){const c=i.ancestors[i.ancestors.length-1];c&&(i.place=c.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=cd(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}}yr.prototype.file="";yr.prototype.name="";yr.prototype.reason="";yr.prototype.message="";yr.prototype.stack="";yr.prototype.column=void 0;yr.prototype.line=void 0;yr.prototype.ancestors=void 0;yr.prototype.cause=void 0;yr.prototype.fatal=void 0;yr.prototype.place=void 0;yr.prototype.ruleId=void 0;yr.prototype.source=void 0;const Kw={}.hasOwnProperty,xK=new Map,wK=/[A-Z]/g,vK=new Set(["table","tbody","thead","tfoot","tr"]),_K=new Set(["td","th"]),VM="https://github.com/syntax-tree/hast-util-to-jsx-runtime";function kK(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=RK(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=OK(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"?Ya:Tf,stylePropertyNameCase:t.stylePropertyNameCase||"dom",tableCellAlignToStyle:t.tableCellAlignToStyle!==!1},i=KM(s,e,void 0);return i&&typeof i!="string"?i:s.create(e,s.Fragment,{children:i||void 0},void 0)}function KM(e,t,n){if(t.type==="element")return NK(e,t,n);if(t.type==="mdxFlowExpression"||t.type==="mdxTextExpression")return SK(e,t);if(t.type==="mdxJsxFlowElement"||t.type==="mdxJsxTextElement")return AK(e,t,n);if(t.type==="mdxjsEsm")return TK(e,t);if(t.type==="root")return CK(e,t,n);if(t.type==="text")return IK(e,t)}function NK(e,t,n){const r=e.schema;let s=r;t.tagName.toLowerCase()==="svg"&&r.space==="html"&&(s=Ya,e.schema=s),e.ancestors.push(t);const i=WM(e,t.tagName,!1),a=LK(e,t);let o=Ww(e,t);return vK.has(t.tagName)&&(o=o.filter(function(c){return typeof c=="string"?!DV(c):!0})),YM(e,a,i,t),Yw(a,o),e.ancestors.pop(),e.schema=r,e.create(t,i,a,n)}function SK(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)}Xd(e,t.position)}function TK(e,t){if(t.data&&t.data.estree&&e.evaluater)return e.evaluater.evaluateProgram(t.data.estree);Xd(e,t.position)}function AK(e,t,n){const r=e.schema;let s=r;t.name==="svg"&&r.space==="html"&&(s=Ya,e.schema=s),e.ancestors.push(t);const i=t.name===null?e.Fragment:WM(e,t.name,!0),a=MK(e,t),o=Ww(e,t);return YM(e,a,i,t),Yw(a,o),e.ancestors.pop(),e.schema=r,e.create(t,i,a,n)}function CK(e,t,n){const r={};return Yw(r,Ww(e,t)),e.create(t,e.Fragment,r,n)}function IK(e,t){return t.value}function YM(e,t,n,r){typeof n!="string"&&n!==e.Fragment&&e.passNode&&(t.node=r)}function Yw(e,t){if(t.length>0){const n=t.length>1?t:t[0];n&&(e.children=n)}}function OK(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 RK(e,t){return n;function n(r,s,i,a){const o=Array.isArray(i.children),c=_i(r);return t(s,i,a,o,{columnNumber:c?c.column-1:void 0,fileName:e,lineNumber:c?c.line:void 0},void 0)}}function LK(e,t){const n={};let r,s;for(s in t.properties)if(s!=="children"&&Kw.call(t.properties,s)){const i=jK(e,s,t.properties[s]);if(i){const[a,o]=i;e.tableCellAlignToStyle&&a==="align"&&typeof o=="string"&&_K.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 MK(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 Xd(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 Xd(e,t.position);else i=r.value===null?!0:r.value;n[s]=i}return n}function Ww(e,t){const n=[];let r=-1;const s=e.passKeys?new Map:xK;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?(ts(e,e.length,0,t),e):t}const HS={}.hasOwnProperty;function qM(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 Xs(e){return e.replace(/[\t\n\r ]+/g," ").replace(/^ | $/g,"").toLowerCase().toUpperCase()}const Nr=Wa(/[A-Za-z]/),pr=Wa(/[\dA-Za-z]/),VK=Wa(/[#-'*+\--9=?A-Z^-~]/);function Tm(e){return e!==null&&(e<32||e===127)}const aE=Wa(/\d/),KK=Wa(/[\dA-Fa-f]/),YK=Wa(/[!-/:-@[-`{-~]/);function qe(e){return e!==null&&e<-2}function Dt(e){return e!==null&&(e<0||e===32)}function yt(e){return e===-2||e===-1||e===32}const Pg=Wa(new RegExp("\\p{P}|\\p{S}","u")),Fo=Wa(/\s/);function Wa(e){return t;function t(n){return n!==null&&n>-1&&e.test(String.fromCharCode(n))}}function Gc(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 _t(e,t,n,r){const s=r?r-1:Number.POSITIVE_INFINITY;let i=0;return a;function a(c){return yt(c)?(e.enter(n),o(c)):t(c)}function o(c){return yt(c)&&i++a))return;const C=t.events.length;let S=C,A,O;for(;S--;)if(t.events[S][0]==="exit"&&t.events[S][1].type==="chunkFlow"){if(A){O=t.events[S][1].end;break}A=!0}for(g(r),N=C;Nb;){const k=n[_];t.containerState=k[1],k[0].exit.call(t,e)}n.length=b}function x(){s.write([null]),i=void 0,s=void 0,t.containerState._closeFlow=void 0}}function QK(e,t,n){return _t(e,e.attempt(this.parser.constructs.document,t,n),"linePrefix",this.parser.constructs.disable.null.includes("codeIndented")?void 0:4)}function kc(e){if(e===null||Dt(e)||Fo(e))return 1;if(Pg(e))return 2}function Bg(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};VS(f,-c),VS(h,c),a={type:c>1?"strongSequence":"emphasisSequence",start:f,end:{...e[r][1].end}},o={type:c>1?"strongSequence":"emphasisSequence",start:{...e[n][1].start},end:h},i={type:c>1?"strongText":"emphasisText",start:{...e[r][1].end},end:{...e[n][1].start}},s={type:c>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=ys(u,[["enter",e[r][1],t],["exit",e[r][1],t]])),u=ys(u,[["enter",s,t],["enter",a,t],["exit",a,t],["enter",i,t]]),u=ys(u,Bg(t.parser.constructs.insideSpan.null,e.slice(r+1,n),t)),u=ys(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=ys(u,[["enter",e[n][1],t],["exit",e[n][1],t]])):d=0,ts(e,r-1,n-r+3,u),n=r+u.length-d-2;break}}for(n=-1;++n0&&yt(N)?_t(e,x,"linePrefix",i+1)(N):x(N)}function x(N){return N===null||qe(N)?e.check(KS,y,_)(N):(e.enter("codeFlowValue"),b(N))}function b(N){return N===null||qe(N)?(e.exit("codeFlowValue"),x(N)):(e.consume(N),b)}function _(N){return e.exit("codeFenced"),t(N)}function k(N,C,S){let A=0;return O;function O(j){return N.enter("lineEnding"),N.consume(j),N.exit("lineEnding"),D}function D(j){return N.enter("codeFencedFence"),yt(j)?_t(N,U,"linePrefix",r.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(j):U(j)}function U(j){return j===o?(N.enter("codeFencedFenceSequence"),X(j)):S(j)}function X(j){return j===o?(A++,N.consume(j),X):A>=a?(N.exit("codeFencedFenceSequence"),yt(j)?_t(N,M,"whitespace")(j):M(j)):S(j)}function M(j){return j===null||qe(j)?(N.exit("codeFencedFence"),C(j)):S(j)}}}function cY(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 _y={name:"codeIndented",tokenize:dY},uY={partial:!0,tokenize:fY};function dY(e,t,n){const r=this;return s;function s(u){return e.enter("codeIndented"),_t(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?c(u):qe(u)?e.attempt(uY,a,c)(u):(e.enter("codeFlowValue"),o(u))}function o(u){return u===null||qe(u)?(e.exit("codeFlowValue"),a(u)):(e.consume(u),o)}function c(u){return e.exit("codeIndented"),t(u)}}function fY(e,t,n){const r=this;return s;function s(a){return r.parser.lazy[r.now().line]?n(a):qe(a)?(e.enter("lineEnding"),e.consume(a),e.exit("lineEnding"),s):_t(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):qe(a)?s(a):n(a)}}const hY={name:"codeText",previous:mY,resolve:pY,tokenize:gY};function pY(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&&Eu(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),Eu(this.left,t)}unshift(t){this.setCursor(0),this.right.push(t)}unshiftMany(t){this.setCursor(0),Eu(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 t3(e,t,n,r,s,i,a,o,c){const u=c||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||Tm(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||qe(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||Dt(g))?(e.exit("chunkString"),e.exit(o),e.exit(a),e.exit(r),t(g)):d999||p===null||p===91||p===93&&!c||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):qe(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||qe(p)||o++>999?(e.exit("chunkString"),d(p)):(e.consume(p),c||(c=!yt(p)),p===92?h:f)}function h(p){return p===91||p===92||p===93?(e.consume(p),o++,f):f(p)}}function r3(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,c):n(h)}function c(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),c(a)):h===null?n(h):qe(h)?(e.enter("lineEnding"),e.consume(h),e.exit("lineEnding"),_t(e,u,"linePrefix")):(e.enter("chunkString",{contentType:"string"}),d(h))}function d(h){return h===a||h===null||qe(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 ud(e,t){let n;return r;function r(s){return qe(s)?(e.enter("lineEnding"),e.consume(s),e.exit("lineEnding"),n=!0,r):yt(s)?_t(e,r,n?"linePrefix":"lineSuffix")(s):t(s)}}const kY={name:"definition",tokenize:SY},NY={partial:!0,tokenize:TY};function SY(e,t,n){const r=this;let s;return i;function i(p){return e.enter("definition"),a(p)}function a(p){return n3.call(r,e,o,n,"definitionLabel","definitionLabelMarker","definitionLabelString")(p)}function o(p){return s=Xs(r.sliceSerialize(r.events[r.events.length-1][1]).slice(1,-1)),p===58?(e.enter("definitionMarker"),e.consume(p),e.exit("definitionMarker"),c):n(p)}function c(p){return Dt(p)?ud(e,u)(p):u(p)}function u(p){return t3(e,d,n,"definitionDestination","definitionDestinationLiteral","definitionDestinationLiteralMarker","definitionDestinationRaw","definitionDestinationString")(p)}function d(p){return e.attempt(NY,f,f)(p)}function f(p){return yt(p)?_t(e,h,"whitespace")(p):h(p)}function h(p){return p===null||qe(p)?(e.exit("definition"),r.parser.defined.push(s),t(p)):n(p)}}function TY(e,t,n){return r;function r(o){return Dt(o)?ud(e,s)(o):n(o)}function s(o){return r3(e,i,n,"definitionTitle","definitionTitleMarker","definitionTitleString")(o)}function i(o){return yt(o)?_t(e,a,"whitespace")(o):a(o)}function a(o){return o===null||qe(o)?t(o):n(o)}}const AY={name:"hardBreakEscape",tokenize:CY};function CY(e,t,n){return r;function r(i){return e.enter("hardBreakEscape"),e.consume(i),s}function s(i){return qe(i)?(e.exit("hardBreakEscape"),t(i)):n(i)}}const IY={name:"headingAtx",resolve:OY,tokenize:RY};function OY(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"},ts(e,r,n-r+1,[["enter",s,t],["enter",i,t],["exit",i,t],["exit",s,t]])),e}function RY(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||Dt(d)?(e.exit("atxHeadingSequence"),o(d)):n(d)}function o(d){return d===35?(e.enter("atxHeadingSequence"),c(d)):d===null||qe(d)?(e.exit("atxHeading"),t(d)):yt(d)?_t(e,o,"whitespace")(d):(e.enter("atxHeadingText"),u(d))}function c(d){return d===35?(e.consume(d),c):(e.exit("atxHeadingSequence"),o(d))}function u(d){return d===null||d===35||Dt(d)?(e.exit("atxHeadingText"),o(d)):(e.consume(d),u)}}const LY=["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"],WS=["pre","script","style","textarea"],MY={concrete:!0,name:"htmlFlow",resolveTo:PY,tokenize:BY},jY={partial:!0,tokenize:UY},DY={partial:!0,tokenize:FY};function PY(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 BY(e,t,n){const r=this;let s,i,a,o,c;return u;function u(P){return d(P)}function d(P){return e.enter("htmlFlow"),e.enter("htmlFlowData"),e.consume(P),f}function f(P){return P===33?(e.consume(P),h):P===47?(e.consume(P),i=!0,y):P===63?(e.consume(P),s=3,r.interrupt?t:I):Nr(P)?(e.consume(P),a=String.fromCharCode(P),E):n(P)}function h(P){return P===45?(e.consume(P),s=2,p):P===91?(e.consume(P),s=5,o=0,m):Nr(P)?(e.consume(P),s=4,r.interrupt?t:I):n(P)}function p(P){return P===45?(e.consume(P),r.interrupt?t:I):n(P)}function m(P){const ie="CDATA[";return P===ie.charCodeAt(o++)?(e.consume(P),o===ie.length?r.interrupt?t:U:m):n(P)}function y(P){return Nr(P)?(e.consume(P),a=String.fromCharCode(P),E):n(P)}function E(P){if(P===null||P===47||P===62||Dt(P)){const ie=P===47,G=a.toLowerCase();return!ie&&!i&&WS.includes(G)?(s=1,r.interrupt?t(P):U(P)):LY.includes(a.toLowerCase())?(s=6,ie?(e.consume(P),g):r.interrupt?t(P):U(P)):(s=7,r.interrupt&&!r.parser.lazy[r.now().line]?n(P):i?x(P):b(P))}return P===45||pr(P)?(e.consume(P),a+=String.fromCharCode(P),E):n(P)}function g(P){return P===62?(e.consume(P),r.interrupt?t:U):n(P)}function x(P){return yt(P)?(e.consume(P),x):O(P)}function b(P){return P===47?(e.consume(P),O):P===58||P===95||Nr(P)?(e.consume(P),_):yt(P)?(e.consume(P),b):O(P)}function _(P){return P===45||P===46||P===58||P===95||pr(P)?(e.consume(P),_):k(P)}function k(P){return P===61?(e.consume(P),N):yt(P)?(e.consume(P),k):b(P)}function N(P){return P===null||P===60||P===61||P===62||P===96?n(P):P===34||P===39?(e.consume(P),c=P,C):yt(P)?(e.consume(P),N):S(P)}function C(P){return P===c?(e.consume(P),c=null,A):P===null||qe(P)?n(P):(e.consume(P),C)}function S(P){return P===null||P===34||P===39||P===47||P===60||P===61||P===62||P===96||Dt(P)?k(P):(e.consume(P),S)}function A(P){return P===47||P===62||yt(P)?b(P):n(P)}function O(P){return P===62?(e.consume(P),D):n(P)}function D(P){return P===null||qe(P)?U(P):yt(P)?(e.consume(P),D):n(P)}function U(P){return P===45&&s===2?(e.consume(P),T):P===60&&s===1?(e.consume(P),L):P===62&&s===4?(e.consume(P),V):P===63&&s===3?(e.consume(P),I):P===93&&s===5?(e.consume(P),F):qe(P)&&(s===6||s===7)?(e.exit("htmlFlowData"),e.check(jY,W,X)(P)):P===null||qe(P)?(e.exit("htmlFlowData"),X(P)):(e.consume(P),U)}function X(P){return e.check(DY,M,W)(P)}function M(P){return e.enter("lineEnding"),e.consume(P),e.exit("lineEnding"),j}function j(P){return P===null||qe(P)?X(P):(e.enter("htmlFlowData"),U(P))}function T(P){return P===45?(e.consume(P),I):U(P)}function L(P){return P===47?(e.consume(P),a="",R):U(P)}function R(P){if(P===62){const ie=a.toLowerCase();return WS.includes(ie)?(e.consume(P),V):U(P)}return Nr(P)&&a.length<8?(e.consume(P),a+=String.fromCharCode(P),R):U(P)}function F(P){return P===93?(e.consume(P),I):U(P)}function I(P){return P===62?(e.consume(P),V):P===45&&s===2?(e.consume(P),I):U(P)}function V(P){return P===null||qe(P)?(e.exit("htmlFlowData"),W(P)):(e.consume(P),V)}function W(P){return e.exit("htmlFlow"),t(P)}}function FY(e,t,n){const r=this;return s;function s(a){return qe(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 UY(e,t,n){return r;function r(s){return e.enter("lineEnding"),e.consume(s),e.exit("lineEnding"),e.attempt(Af,t,n)}}const $Y={name:"htmlText",tokenize:HY};function HY(e,t,n){const r=this;let s,i,a;return o;function o(I){return e.enter("htmlText"),e.enter("htmlTextData"),e.consume(I),c}function c(I){return I===33?(e.consume(I),u):I===47?(e.consume(I),k):I===63?(e.consume(I),b):Nr(I)?(e.consume(I),S):n(I)}function u(I){return I===45?(e.consume(I),d):I===91?(e.consume(I),i=0,m):Nr(I)?(e.consume(I),x):n(I)}function d(I){return I===45?(e.consume(I),p):n(I)}function f(I){return I===null?n(I):I===45?(e.consume(I),h):qe(I)?(a=f,L(I)):(e.consume(I),f)}function h(I){return I===45?(e.consume(I),p):f(I)}function p(I){return I===62?T(I):I===45?h(I):f(I)}function m(I){const V="CDATA[";return I===V.charCodeAt(i++)?(e.consume(I),i===V.length?y:m):n(I)}function y(I){return I===null?n(I):I===93?(e.consume(I),E):qe(I)?(a=y,L(I)):(e.consume(I),y)}function E(I){return I===93?(e.consume(I),g):y(I)}function g(I){return I===62?T(I):I===93?(e.consume(I),g):y(I)}function x(I){return I===null||I===62?T(I):qe(I)?(a=x,L(I)):(e.consume(I),x)}function b(I){return I===null?n(I):I===63?(e.consume(I),_):qe(I)?(a=b,L(I)):(e.consume(I),b)}function _(I){return I===62?T(I):b(I)}function k(I){return Nr(I)?(e.consume(I),N):n(I)}function N(I){return I===45||pr(I)?(e.consume(I),N):C(I)}function C(I){return qe(I)?(a=C,L(I)):yt(I)?(e.consume(I),C):T(I)}function S(I){return I===45||pr(I)?(e.consume(I),S):I===47||I===62||Dt(I)?A(I):n(I)}function A(I){return I===47?(e.consume(I),T):I===58||I===95||Nr(I)?(e.consume(I),O):qe(I)?(a=A,L(I)):yt(I)?(e.consume(I),A):T(I)}function O(I){return I===45||I===46||I===58||I===95||pr(I)?(e.consume(I),O):D(I)}function D(I){return I===61?(e.consume(I),U):qe(I)?(a=D,L(I)):yt(I)?(e.consume(I),D):A(I)}function U(I){return I===null||I===60||I===61||I===62||I===96?n(I):I===34||I===39?(e.consume(I),s=I,X):qe(I)?(a=U,L(I)):yt(I)?(e.consume(I),U):(e.consume(I),M)}function X(I){return I===s?(e.consume(I),s=void 0,j):I===null?n(I):qe(I)?(a=X,L(I)):(e.consume(I),X)}function M(I){return I===null||I===34||I===39||I===60||I===61||I===96?n(I):I===47||I===62||Dt(I)?A(I):(e.consume(I),M)}function j(I){return I===47||I===62||Dt(I)?A(I):n(I)}function T(I){return I===62?(e.consume(I),e.exit("htmlTextData"),e.exit("htmlText"),t):n(I)}function L(I){return e.exit("htmlTextData"),e.enter("lineEnding"),e.consume(I),e.exit("lineEnding"),R}function R(I){return yt(I)?_t(e,F,"linePrefix",r.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(I):F(I)}function F(I){return e.enter("htmlTextData"),a(I)}}const Xw={name:"labelEnd",resolveAll:YY,resolveTo:WY,tokenize:GY},zY={tokenize:qY},VY={tokenize:XY},KY={tokenize:QY};function YY(e){let t=-1;const n=[];for(;++t=3&&(u===null||qe(u))?(e.exit("thematicBreak"),t(u)):n(u)}function c(u){return u===s?(e.consume(u),r++,c):(e.exit("thematicBreakSequence"),yt(u)?_t(e,o,"whitespace")(u):o(u))}}const jr={continuation:{tokenize:oW},exit:cW,name:"list",tokenize:aW},sW={partial:!0,tokenize:uW},iW={partial:!0,tokenize:lW};function aW(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:aE(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(Tp,n,u)(p):u(p);if(!r.interrupt||p===49)return e.enter("listItemPrefix"),e.enter("listItemValue"),c(p)}return n(p)}function c(p){return aE(p)&&++a<10?(e.consume(p),c):(!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(Af,r.interrupt?n:d,e.attempt(sW,h,f))}function d(p){return r.containerState.initialBlankLine=!0,i++,h(p)}function f(p){return yt(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 oW(e,t,n){const r=this;return r.containerState._closeFlow=void 0,e.check(Af,s,i);function s(o){return r.containerState.furtherBlankLines=r.containerState.furtherBlankLines||r.containerState.initialBlankLine,_t(e,t,"listItemIndent",r.containerState.size+1)(o)}function i(o){return r.containerState.furtherBlankLines||!yt(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(iW,t,a)(o))}function a(o){return r.containerState._closeFlow=!0,r.interrupt=void 0,_t(e,e.attempt(jr,t,n),"linePrefix",r.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(o)}}function lW(e,t,n){const r=this;return _t(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 cW(e){e.exit(this.containerState.type)}function uW(e,t,n){const r=this;return _t(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!yt(i)&&a&&a[1].type==="listItemPrefixWhitespace"?t(i):n(i)}}const GS={name:"setextUnderline",resolveTo:dW,tokenize:fW};function dW(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 fW(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"),yt(u)?_t(e,c,"lineSuffix")(u):c(u))}function c(u){return u===null||qe(u)?(e.exit("setextHeadingLine"),t(u)):n(u)}}const hW={tokenize:pW};function pW(e){const t=this,n=e.attempt(Af,r,e.attempt(this.parser.constructs.flowInitial,s,_t(e,e.attempt(this.parser.constructs.flow,s,e.attempt(EY,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 mW={resolveAll:i3()},gW=s3("string"),yW=s3("text");function s3(e){return{resolveAll:i3(e==="text"?bW: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),c}function c(d){return u(d)?(n.exit("data"),i(d)):(n.consume(d),c)}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 OW(e,t){let n=-1;const r=[];let s;for(;++n0){const Ye=oe.tokenStack[oe.tokenStack.length-1];(Ye[1]||XS).call(oe,void 0,Ye[0])}for(Q.position={start:ca(B.length>0?B[0][1].start:{line:1,column:1,offset:0}),end:ca(B.length>0?B[B.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 KW(e,t){const n={type:"element",tagName:"del",properties:{},children:e.all(t)};return e.patch(t,n),e.applyData(t,n)}function YW(e,t){const n={type:"element",tagName:"em",properties:{},children:e.all(t)};return e.patch(t,n),e.applyData(t,n)}function WW(e,t){const n=typeof e.options.clobberPrefix=="string"?e.options.clobberPrefix:"user-content-",r=String(t.identifier).toUpperCase(),s=Gc(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 c={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,c);const u={type:"element",tagName:"sup",properties:{},children:[c]};return e.patch(t,u),e.applyData(t,u)}function GW(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 qW(e,t){if(e.options.allowDangerousHtml){const n={type:"raw",value:t.value};return e.patch(t,n),e.applyData(t,n)}}function l3(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 XW(e,t){const n=String(t.identifier).toUpperCase(),r=e.definitionById.get(n);if(!r)return l3(e,t);const s={src:Gc(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 QW(e,t){const n={src:Gc(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 ZW(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 JW(e,t){const n=String(t.identifier).toUpperCase(),r=e.definitionById.get(n);if(!r)return l3(e,t);const s={href:Gc(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 eG(e,t){const n={href:Gc(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 tG(e,t,n){const r=e.all(t),s=n?nG(n):c3(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 rG(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=_i(t.children[1]),c=Dg(t.children[t.children.length-1]);o&&c&&(a.position={start:o,end:c}),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 lG(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 c=-1;const u=[];for(;++c0,!0),r[0]),s=r.index+r[0].length,r=n.exec(t);return i.push(JS(t.slice(s),s>0,!1)),i.join("")}function JS(e,t,n){let r=0,s=e.length;if(t){let i=e.codePointAt(r);for(;i===QS||i===ZS;)r++,i=e.codePointAt(r)}if(n){let i=e.codePointAt(s-1);for(;i===QS||i===ZS;)s--,i=e.codePointAt(s-1)}return s>r?e.slice(r,s):""}function dG(e,t){const n={type:"text",value:uG(String(t.value))};return e.patch(t,n),e.applyData(t,n)}function fG(e,t){const n={type:"element",tagName:"hr",properties:{},children:[]};return e.patch(t,n),e.applyData(t,n)}const hG={blockquote:HW,break:zW,code:VW,delete:KW,emphasis:YW,footnoteReference:WW,heading:GW,html:qW,imageReference:XW,image:QW,inlineCode:ZW,linkReference:JW,link:eG,listItem:tG,list:rG,paragraph:sG,root:iG,strong:aG,table:oG,tableCell:cG,tableRow:lG,text:dG,thematicBreak:fG,toml:Lh,yaml:Lh,definition:Lh,footnoteDefinition:Lh};function Lh(){}const u3=-1,Fg=0,dd=1,Am=2,Qw=3,Zw=4,Jw=5,ev=6,d3=7,f3=8,pG=typeof self=="object"?self:globalThis,eT=(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 pG[e](t)},mG=(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 Fg:case u3:return n(a,s);case dd:{const o=n([],s);for(const c of a)o.push(r(c));return o}case Am:{const o=n({},s);for(const[c,u]of a)o[r(c)]=r(u);return o}case Qw:return n(new Date(a),s);case Zw:{const{source:o,flags:c}=a;return n(new RegExp(o,c),s)}case Jw:{const o=n(new Map,s);for(const[c,u]of a)o.set(r(c),r(u));return o}case ev:{const o=n(new Set,s);for(const c of a)o.add(r(c));return o}case d3:{const{name:o,message:c}=a;return n(eT(o,c),s)}case f3: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(eT(i,a),s)};return r},tT=e=>mG(new Map,e)(0),dl="",{toString:gG}={},{keys:yG}=Object,xu=e=>{const t=typeof e;if(t!=="object"||!e)return[Fg,t];const n=gG.call(e).slice(8,-1);switch(n){case"Array":return[dd,dl];case"Object":return[Am,dl];case"Date":return[Qw,dl];case"RegExp":return[Zw,dl];case"Map":return[Jw,dl];case"Set":return[ev,dl];case"DataView":return[dd,n]}return n.includes("Array")?[dd,n]:n.includes("Error")?[d3,n]:[Am,n]},Mh=([e,t])=>e===Fg&&(t==="function"||t==="symbol"),bG=(e,t,n,r)=>{const s=(a,o)=>{const c=r.push(a)-1;return n.set(o,c),c},i=a=>{if(n.has(a))return n.get(a);let[o,c]=xu(a);switch(o){case Fg:{let d=a;switch(c){case"bigint":o=f3,d=a.toString();break;case"function":case"symbol":if(e)throw new TypeError("unable to serialize "+c);d=null;break;case"undefined":return s([u3],a)}return s([o,d],a)}case dd:{if(c){let h=a;return c==="DataView"?h=new Uint8Array(a.buffer):c==="ArrayBuffer"&&(h=new Uint8Array(a)),s([c,[...h]],a)}const d=[],f=s([o,d],a);for(const h of a)d.push(i(h));return f}case Am:{if(c)switch(c){case"BigInt":return s([c,a.toString()],a);case"Boolean":case"Number":case"String":return s([c,a.valueOf()],a)}if(t&&"toJSON"in a)return i(a.toJSON());const d=[],f=s([o,d],a);for(const h of yG(a))(e||!Mh(xu(a[h])))&&d.push([i(h),i(a[h])]);return f}case Qw:return s([o,a.toISOString()],a);case Zw:{const{source:d,flags:f}=a;return s([o,{source:d,flags:f}],a)}case Jw:{const d=[],f=s([o,d],a);for(const[h,p]of a)(e||!(Mh(xu(h))||Mh(xu(p))))&&d.push([i(h),i(p)]);return f}case ev:{const d=[],f=s([o,d],a);for(const h of a)(e||!Mh(xu(h)))&&d.push(i(h));return f}}const{message:u}=a;return s([o,{name:c,message:u}],a)};return i},nT=(e,{json:t,lossy:n}={})=>{const r=[];return bG(!(t||n),!!t,new Map,r)(e),r},Nc=typeof structuredClone=="function"?(e,t)=>t&&("json"in t||"lossy"in t)?tT(nT(e,t)):structuredClone(e):(e,t)=>tT(nT(e,t));function EG(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 xG(e,t){return"Back to reference "+(e+1)+(t>1?"-"+t:"")}function wG(e){const t=typeof e.options.clobberPrefix=="string"?e.options.clobberPrefix:"user-content-",n=e.options.footnoteBackContent||EG,r=e.options.footnoteBackLabel||xG,s=e.options.footnoteLabel||"Footnotes",i=e.options.footnoteLabelTagName||"h2",a=e.options.footnoteLabelProperties||{className:["sr-only"]},o=[];let c=-1;for(;++c0&&m.push({type:"text",value:" "});let x=typeof n=="string"?n:n(c,p);typeof x=="string"&&(x={type:"text",value:x}),m.push({type:"element",tagName:"a",properties:{href:"#"+t+"fnref-"+h+(p>1?"-"+p:""),dataFootnoteBackref:"",ariaLabel:typeof r=="string"?r:r(c,p),className:["data-footnote-backref"]},children:Array.isArray(x)?x:[x]})}const E=d[d.length-1];if(E&&E.type==="element"&&E.tagName==="p"){const x=E.children[E.children.length-1];x&&x.type==="text"?x.value+=" ":E.children.push({type:"text",value:" "}),E.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:{...Nc(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 Cf=function(e){if(e==null)return NG;if(typeof e=="function")return Ug(e);if(typeof e=="object")return Array.isArray(e)?vG(e):_G(e);if(typeof e=="string")return kG(e);throw new Error("Expected function, string, or object as test")};function vG(e){const t=[];let n=-1;for(;++n":""))+")"})}return h;function h(){let p=h3,m,y,E;if((!t||i(c,u,d[d.length-1]||void 0))&&(p=CG(n(c,d)),p[0]===lE))return p;if("children"in c&&c.children){const g=c;if(g.children&&p[0]!==AG)for(y=(r?g.children.length:-1)+a,E=d.concat(g);y>-1&&y0&&n.push({type:"text",value:` -`}),n}function rT(e){let t=0,n=e.charCodeAt(t);for(;n===9||n===32;)t++,n=e.charCodeAt(t);return e.slice(t)}function sT(e,t){const n=OG(e,t),r=n.one(e,void 0),s=wG(n),i=Array.isArray(r)?{type:"root",children:r}:r||{type:"root",children:[]};return s&&i.children.push({type:"text",value:` -`},s),i}function DG(e,t){return e&&"run"in e?async function(n,r){const s=sT(n,{file:r,...t});await e.run(s,r)}:function(n,r){return sT(n,{file:r,...e||t})}}function iT(e){if(e)throw e}var Ap=Object.prototype.hasOwnProperty,m3=Object.prototype.toString,aT=Object.defineProperty,oT=Object.getOwnPropertyDescriptor,lT=function(t){return typeof Array.isArray=="function"?Array.isArray(t):m3.call(t)==="[object Array]"},cT=function(t){if(!t||m3.call(t)!=="[object Object]")return!1;var n=Ap.call(t,"constructor"),r=t.constructor&&t.constructor.prototype&&Ap.call(t.constructor.prototype,"isPrototypeOf");if(t.constructor&&!n&&!r)return!1;var s;for(s in t);return typeof s>"u"||Ap.call(t,s)},uT=function(t,n){aT&&n.name==="__proto__"?aT(t,n.name,{enumerable:!0,configurable:!0,value:n.newValue,writable:!0}):t[n.name]=n.newValue},dT=function(t,n){if(n==="__proto__")if(Ap.call(t,n)){if(oT)return oT(t,n).value}else return;return t[n]},PG=function e(){var t,n,r,s,i,a,o=arguments[0],c=1,u=arguments.length,d=!1;for(typeof o=="boolean"&&(d=o,o=arguments[1]||{},c=2),(o==null||typeof o!="object"&&typeof o!="function")&&(o={});ca.length;let c;o&&a.push(s);try{c=e.apply(this,a)}catch(u){const d=u;if(o&&n)throw d;return s(d)}o||(c&&c.then&&typeof c.then=="function"?c.then(i,s):c instanceof Error?s(c):i(c))}function s(a,...o){n||(n=!0,t(a,...o))}function i(a){s(null,a)}}const ui={basename:UG,dirname:$G,extname:HG,join:zG,sep:"/"};function UG(e,t){if(t!==void 0&&typeof t!="string")throw new TypeError('"ext" argument must be a string');Of(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 $G(e){if(Of(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 HG(e){Of(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 zG(...e){let t=-1,n;for(;++t0&&e.codePointAt(e.length-1)===47&&(n+="/"),t?"/"+n:n}function KG(e,t){let n="",r=0,s=-1,i=0,a=-1,o,c;for(;++a<=e.length;){if(a2){if(c=n.lastIndexOf("/"),c!==n.length-1){c<0?(n="",r=0):(n=n.slice(0,c),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 Of(e){if(typeof e!="string")throw new TypeError("Path must be a string. Received "+JSON.stringify(e))}const YG={cwd:WG};function WG(){return"/"}function dE(e){return!!(e!==null&&typeof e=="object"&&"href"in e&&e.href&&"protocol"in e&&e.protocol&&e.auth===void 0)}function GG(e){if(typeof e=="string")e=new URL(e);else if(!dE(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 qG(e)}function qG(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];uE(y)&&uE(p)&&(p=Ny(!0,y,p)),r[h]=[u,p,...m]}}}}const JG=new tv().freeze();function Cy(e,t){if(typeof t!="function")throw new TypeError("Cannot `"+e+"` without `parser`")}function Iy(e,t){if(typeof t!="function")throw new TypeError("Cannot `"+e+"` without `compiler`")}function Oy(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 hT(e){if(!uE(e)||typeof e.type!="string")throw new TypeError("Expected node, got `"+e+"`")}function pT(e,t,n){if(!n)throw new Error("`"+e+"` finished async. Use `"+t+"` instead")}function jh(e){return eq(e)?e:new g3(e)}function eq(e){return!!(e&&typeof e=="object"&&"message"in e&&"messages"in e)}function tq(e){return typeof e=="string"||nq(e)}function nq(e){return!!(e&&typeof e=="object"&&"byteLength"in e&&"byteOffset"in e)}const rq="https://github.com/remarkjs/react-markdown/blob/main/changelog.md",mT=[],gT={allowDangerousHtml:!0},sq=/^(https?|ircs?|mailto|xmpp)$/i,iq=[{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 aq(e){const t=oq(e),n=lq(e);return cq(t.runSync(t.parse(n),n),e)}function oq(e){const t=e.rehypePlugins||mT,n=e.remarkPlugins||mT,r=e.remarkRehypeOptions?{...e.remarkRehypeOptions,...gT}:gT;return JG().use($W).use(n).use(DG,r).use(t)}function lq(e){const t=e.children||"",n=new g3;return typeof t=="string"&&(n.value=t),n}function cq(e,t){const n=t.allowedElements,r=t.allowElement,s=t.components,i=t.disallowedElements,a=t.skipHtml,o=t.unwrapDisallowed,c=t.urlTransform||uq;for(const d of iq)Object.hasOwn(t,d.from)&&(""+d.from+(d.to?"use `"+d.to+"` instead":"remove it")+rq+d.id,void 0);return t.className&&(e={type:"element",tagName:"div",properties:{className:t.className},children:e.type==="root"?e.children:[e]}),If(e,u),kK(e,{Fragment:l.Fragment,components:s,ignoreInvalidStyle:!0,jsx:l.jsx,jsxs:l.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 vy)if(Object.hasOwn(vy,p)&&Object.hasOwn(d.properties,p)){const m=d.properties[p],y=vy[p];(y===null||y.includes(d.tagName))&&(d.properties[p]=c(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 uq(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||sq.test(e.slice(0,t))?e:""}function yT(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 dq(e){if(typeof e!="string")throw new TypeError("Expected a string");return e.replace(/[|\\{}()[\]^$+*?.]/g,"\\$&").replace(/-/g,"\\x2d")}function fq(e,t,n){const s=Cf((n||{}).ignore||[]),i=hq(t);let a=-1;for(;++a0?{type:"text",value:N}:void 0),N===!1?h.lastIndex=_+1:(m!==_&&x.push({type:"text",value:u.value.slice(m,_)}),Array.isArray(N)?x.push(...N):N&&x.push(N),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=yT(e,"(");let i=yT(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 y3(e,t){const n=e.input.charCodeAt(e.index-1);return(e.index===0||Fo(n)||Pg(n))&&(!t||n!==47)}b3.peek=Dq;function Aq(){this.buffer()}function Cq(e){this.enter({type:"footnoteReference",identifier:"",label:""},e)}function Iq(){this.buffer()}function Oq(e){this.enter({type:"footnoteDefinition",identifier:"",label:"",children:[]},e)}function Rq(e){const t=this.resume(),n=this.stack[this.stack.length-1];n.type,n.identifier=Xs(this.sliceSerialize(e)).toLowerCase(),n.label=t}function Lq(e){this.exit(e)}function Mq(e){const t=this.resume(),n=this.stack[this.stack.length-1];n.type,n.identifier=Xs(this.sliceSerialize(e)).toLowerCase(),n.label=t}function jq(e){this.exit(e)}function Dq(){return"["}function b3(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 Pq(){return{enter:{gfmFootnoteCallString:Aq,gfmFootnoteCall:Cq,gfmFootnoteDefinitionLabelString:Iq,gfmFootnoteDefinition:Oq},exit:{gfmFootnoteCallString:Rq,gfmFootnoteCall:Lq,gfmFootnoteDefinitionLabelString:Mq,gfmFootnoteDefinition:jq}}}function Bq(e){let t=!1;return e&&e.firstLineBlank&&(t=!0),{handlers:{footnoteDefinition:n,footnoteReference:b3},unsafe:[{character:"[",inConstruct:["label","phrasing","reference"]}]};function n(r,s,i,a){const o=i.createTracker(a);let c=o.move("[^");const u=i.enter("footnoteDefinition"),d=i.enter("label");return c+=o.move(i.safe(i.associationId(r),{before:c,after:"]"})),d(),c+=o.move("]:"),r.children&&r.children.length>0&&(o.shift(4),c+=o.move((t?` -`:" ")+i.indentLines(i.containerFlow(r,o.current()),t?E3:Fq))),u(),c}}function Fq(e,t,n){return t===0?e:E3(e,t,n)}function E3(e,t,n){return(n?"":" ")+e}const Uq=["autolink","destinationLiteral","destinationRaw","reference","titleQuote","titleApostrophe"];x3.peek=Kq;function $q(){return{canContainEols:["delete"],enter:{strikethrough:zq},exit:{strikethrough:Vq}}}function Hq(){return{unsafe:[{character:"~",inConstruct:"phrasing",notInConstruct:Uq}],handlers:{delete:x3}}}function zq(e){this.enter({type:"delete",children:[]},e)}function Vq(e){this.exit(e)}function x3(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 Kq(){return"~"}function Yq(e){return e.length}function Wq(e,t){const n=t||{},r=(n.align||[]).concat(),s=n.stringLength||Yq,i=[],a=[],o=[],c=[];let u=0,d=-1;for(;++du&&(u=e[d].length);++gc[g])&&(c[g]=b)}y.push(x)}a[d]=y,o[d]=E}let f=-1;if(typeof r=="object"&&"length"in r)for(;++fc[f]&&(c[f]=x),p[f]=x),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()),Xq);return s(),a}function Xq(e,t,n){return">"+(n?"":" ")+e}function Qq(e,t){return xT(e,t.inConstruct,!0)&&!xT(e,t.notInConstruct,!1)}function xT(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 Jq(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 eX(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 tX(e,t,n,r){const s=eX(n),i=e.value||"",a=s==="`"?"GraveAccent":"Tilde";if(Jq(e,n)){const f=n.enter("codeIndented"),h=n.indentLines(i,nX);return f(),h}const o=n.createTracker(r),c=s.repeat(Math.max(Zq(i,s)+1,3)),u=n.enter("codeFenced");let d=o.move(c);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(c),u(),d}function nX(e,t,n){return(n?"":" ")+e}function nv(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 rX(e,t,n,r){const s=nv(n),i=s==='"'?"Quote":"Apostrophe",a=n.enter("definition");let o=n.enter("label");const c=n.createTracker(r);let u=c.move("[");return u+=c.move(n.safe(n.associationId(e),{before:u,after:"]",...c.current()})),u+=c.move("]: "),o(),!e.url||/[\0- \u007F]/.test(e.url)?(o=n.enter("destinationLiteral"),u+=c.move("<"),u+=c.move(n.safe(e.url,{before:u,after:">",...c.current()})),u+=c.move(">")):(o=n.enter("destinationRaw"),u+=c.move(n.safe(e.url,{before:u,after:e.title?" ":` -`,...c.current()}))),o(),e.title&&(o=n.enter(`title${i}`),u+=c.move(" "+s),u+=c.move(n.safe(e.title,{before:u,after:s,...c.current()})),u+=c.move(s),o()),a(),u}function sX(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 Qd(e){return"&#x"+e.toString(16).toUpperCase()+";"}function Cm(e,t,n){const r=kc(e),s=kc(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}}v3.peek=iX;function v3(e,t,n,r){const s=sX(n),i=n.enter("emphasis"),a=n.createTracker(r),o=a.move(s);let c=a.move(n.containerPhrasing(e,{after:s,before:o,...a.current()}));const u=c.charCodeAt(0),d=Cm(r.before.charCodeAt(r.before.length-1),u,s);d.inside&&(c=Qd(u)+c.slice(1));const f=c.charCodeAt(c.length-1),h=Cm(r.after.charCodeAt(0),f,s);h.inside&&(c=c.slice(0,-1)+Qd(f));const p=a.move(s);return i(),n.attentionEncodeSurroundingInfo={after:h.outside,before:d.outside},o+c+p}function iX(e,t,n){return n.options.emphasis||"*"}function aX(e,t){let n=!1;return If(e,function(r){if("value"in r&&/\r?\n|\r/.test(r.value)||r.type==="break")return n=!0,lE}),!!((!e.depth||e.depth<3)&&Gw(e)&&(t.options.setext||n))}function oX(e,t,n,r){const s=Math.max(Math.min(6,e.depth||1),1),i=n.createTracker(r);if(aX(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"),c=n.enter("phrasing");i.move(a+" ");let u=n.containerPhrasing(e,{before:"# ",after:` -`,...i.current()});return/^[\t ]/.test(u)&&(u=Qd(u.charCodeAt(0))+u.slice(1)),u=u?a+" "+u:a,n.options.closeAtx&&(u+=" "+a),c(),o(),u}_3.peek=lX;function _3(e){return e.value||""}function lX(){return"<"}k3.peek=cX;function k3(e,t,n,r){const s=nv(n),i=s==='"'?"Quote":"Apostrophe",a=n.enter("image");let o=n.enter("label");const c=n.createTracker(r);let u=c.move("![");return u+=c.move(n.safe(e.alt,{before:u,after:"]",...c.current()})),u+=c.move("]("),o(),!e.url&&e.title||/[\0- \u007F]/.test(e.url)?(o=n.enter("destinationLiteral"),u+=c.move("<"),u+=c.move(n.safe(e.url,{before:u,after:">",...c.current()})),u+=c.move(">")):(o=n.enter("destinationRaw"),u+=c.move(n.safe(e.url,{before:u,after:e.title?" ":")",...c.current()}))),o(),e.title&&(o=n.enter(`title${i}`),u+=c.move(" "+s),u+=c.move(n.safe(e.title,{before:u,after:s,...c.current()})),u+=c.move(s),o()),u+=c.move(")"),a(),u}function cX(){return"!"}N3.peek=uX;function N3(e,t,n,r){const s=e.referenceType,i=n.enter("imageReference");let a=n.enter("label");const o=n.createTracker(r);let c=o.move("![");const u=n.safe(e.alt,{before:c,after:"]",...o.current()});c+=o.move(u+"]["),a();const d=n.stack;n.stack=[],a=n.enter("reference");const f=n.safe(n.associationId(e),{before:c,after:"]",...o.current()});return a(),n.stack=d,i(),s==="full"||!u||u!==f?c+=o.move(f+"]"):s==="shortcut"?c=c.slice(0,-1):c+=o.move("]"),c}function uX(){return"!"}S3.peek=dX;function S3(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))}A3.peek=fX;function A3(e,t,n,r){const s=nv(n),i=s==='"'?"Quote":"Apostrophe",a=n.createTracker(r);let o,c;if(T3(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"),c=n.enter("label");let u=a.move("[");return u+=a.move(n.containerPhrasing(e,{before:u,after:"](",...a.current()})),u+=a.move("]("),c(),!e.url&&e.title||/[\0- \u007F]/.test(e.url)?(c=n.enter("destinationLiteral"),u+=a.move("<"),u+=a.move(n.safe(e.url,{before:u,after:">",...a.current()})),u+=a.move(">")):(c=n.enter("destinationRaw"),u+=a.move(n.safe(e.url,{before:u,after:e.title?" ":")",...a.current()}))),c(),e.title&&(c=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),c()),u+=a.move(")"),o(),u}function fX(e,t,n){return T3(e,n)?"<":"["}C3.peek=hX;function C3(e,t,n,r){const s=e.referenceType,i=n.enter("linkReference");let a=n.enter("label");const o=n.createTracker(r);let c=o.move("[");const u=n.containerPhrasing(e,{before:c,after:"]",...o.current()});c+=o.move(u+"]["),a();const d=n.stack;n.stack=[],a=n.enter("reference");const f=n.safe(n.associationId(e),{before:c,after:"]",...o.current()});return a(),n.stack=d,i(),s==="full"||!u||u!==f?c+=o.move(f+"]"):s==="shortcut"?c=c.slice(0,-1):c+=o.move("]"),c}function hX(){return"["}function rv(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 pX(e){const t=rv(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 mX(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 I3(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 gX(e,t,n,r){const s=n.enter("list"),i=n.bulletCurrent;let a=e.ordered?mX(n):rv(n);const o=e.ordered?a==="."?")":".":pX(n);let c=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&&(c=!0),I3(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 c=n.enter("listItem"),u=n.indentLines(n.containerFlow(e,o.current()),d);return c(),u;function d(f,h,p){return h?(p?"":" ".repeat(a))+f:(p?i:i+" ".repeat(a-i.length))+f}}function EX(e,t,n,r){const s=n.enter("paragraph"),i=n.enter("phrasing"),a=n.containerPhrasing(e,r);return i(),s(),a}const xX=Cf(["break","delete","emphasis","footnote","footnoteReference","image","imageReference","inlineCode","inlineMath","link","linkReference","mdxJsxTextElement","mdxTextExpression","strong","text","textDirective"]);function wX(e,t,n,r){return(e.children.some(function(a){return xX(a)})?n.containerPhrasing:n.containerFlow).call(n,e,r)}function vX(e){const t=e.options.strong||"*";if(t!=="*"&&t!=="_")throw new Error("Cannot serialize strong with `"+t+"` for `options.strong`, expected `*`, or `_`");return t}O3.peek=_X;function O3(e,t,n,r){const s=vX(n),i=n.enter("strong"),a=n.createTracker(r),o=a.move(s+s);let c=a.move(n.containerPhrasing(e,{after:s,before:o,...a.current()}));const u=c.charCodeAt(0),d=Cm(r.before.charCodeAt(r.before.length-1),u,s);d.inside&&(c=Qd(u)+c.slice(1));const f=c.charCodeAt(c.length-1),h=Cm(r.after.charCodeAt(0),f,s);h.inside&&(c=c.slice(0,-1)+Qd(f));const p=a.move(s+s);return i(),n.attentionEncodeSurroundingInfo={after:h.outside,before:d.outside},o+c+p}function _X(e,t,n){return n.options.strong||"*"}function kX(e,t,n,r){return n.safe(e.value,r)}function NX(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 SX(e,t,n){const r=(I3(n)+(n.options.ruleSpaces?" ":"")).repeat(NX(n));return n.options.ruleSpaces?r.slice(0,-1):r}const R3={blockquote:qq,break:wT,code:tX,definition:rX,emphasis:v3,hardBreak:wT,heading:oX,html:_3,image:k3,imageReference:N3,inlineCode:S3,link:A3,linkReference:C3,list:gX,listItem:bX,paragraph:EX,root:wX,strong:O3,text:kX,thematicBreak:SX};function TX(){return{enter:{table:AX,tableData:vT,tableHeader:vT,tableRow:IX},exit:{codeText:OX,table:CX,tableData:jy,tableHeader:jy,tableRow:jy}}}function AX(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 CX(e){this.exit(e),this.data.inTable=void 0}function IX(e){this.enter({type:"tableRow",children:[]},e)}function jy(e){this.exit(e)}function vT(e){this.enter({type:"tableCell",children:[]},e)}function OX(e){let t=this.resume();this.data.inTable&&(t=t.replace(/\\([\\|])/g,RX));const n=this.stack[this.stack.length-1];n.type,n.value=t,this.exit(e)}function RX(e,t){return t==="|"?t:e}function LX(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:c,tableRow:o}};function a(p,m,y,E){return u(d(p,y,E),p.align)}function o(p,m,y,E){const g=f(p,y,E),x=u([g]);return x.slice(0,x.indexOf(` -`))}function c(p,m,y,E){const g=y.enter("tableCell"),x=y.enter("phrasing"),b=y.containerPhrasing(p,{...E,before:i,after:i});return x(),g(),b}function u(p,m){return Wq(p,{align:m,alignDelimiters:r,padding:n,stringLength:s})}function d(p,m,y){const E=p.children;let g=-1;const x=[],b=m.enter("table");for(;++g0&&!n&&(e[e.length-1][1]._gfmAutolinkLiteralWalkedInto=!0),n}const QX={tokenize:iQ,partial:!0};function ZX(){return{document:{91:{name:"gfmFootnoteDefinition",tokenize:nQ,continuation:{tokenize:rQ},exit:sQ}},text:{91:{name:"gfmFootnoteCall",tokenize:tQ},93:{name:"gfmPotentialFootnoteCall",add:"after",tokenize:JX,resolveTo:eQ}}}}function JX(e,t,n){const r=this;let s=r.events.length;const i=r.parser.gfmFootnotes||(r.parser.gfmFootnotes=[]);let a;for(;s--;){const c=r.events[s][1];if(c.type==="labelImage"){a=c;break}if(c.type==="gfmFootnoteCall"||c.type==="labelLink"||c.type==="label"||c.type==="image"||c.type==="link")break}return o;function o(c){if(!a||!a._balanced)return n(c);const u=Xs(r.sliceSerialize({start:a.end,end:r.now()}));return u.codePointAt(0)!==94||!i.includes(u.slice(1))?n(c):(e.enter("gfmFootnoteCallLabelMarker"),e.consume(c),e.exit("gfmFootnoteCallLabelMarker"),t(c))}}function eQ(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 tQ(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"),c}function c(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||Dt(f))return n(f);if(f===93){e.exit("chunkString");const h=e.exit("gfmFootnoteCallString");return s.includes(Xs(r.sliceSerialize(h)))?(e.enter("gfmFootnoteCallLabelMarker"),e.consume(f),e.exit("gfmFootnoteCallLabelMarker"),e.exit("gfmFootnoteCall"),t):n(f)}return Dt(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 nQ(e,t,n){const r=this,s=r.parser.gfmFootnotes||(r.parser.gfmFootnotes=[]);let i,a=0,o;return c;function c(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||Dt(m))return n(m);if(m===93){e.exit("chunkString");const y=e.exit("gfmFootnoteDefinitionLabelString");return i=Xs(r.sliceSerialize(y)),e.enter("gfmFootnoteDefinitionLabelMarker"),e.consume(m),e.exit("gfmFootnoteDefinitionLabelMarker"),e.exit("gfmFootnoteDefinitionLabel"),h}return Dt(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),_t(e,p,"gfmFootnoteDefinitionWhitespace")):n(m)}function p(m){return t(m)}}function rQ(e,t,n){return e.check(Af,t,e.attempt(QX,t,n))}function sQ(e){e.exit("gfmFootnoteDefinition")}function iQ(e,t,n){const r=this;return _t(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 aQ(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 c=-1;for(;++c1?c(m):(a.consume(m),f++,p);if(f<2&&!n)return c(m);const E=a.exit("strikethroughSequenceTemporary"),g=kc(m);return E._open=!g||g===2&&!!y,E._close=!y||y===2&&!!g,o(m)}}}class oQ{constructor(){this.map=[]}add(t,n,r){lQ(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 lQ(e,t,n,r){let s=0;if(!(n===0&&r.length===0)){for(;s-1;){const M=r.events[D][1].type;if(M==="lineEnding"||M==="linePrefix")D--;else break}const U=D>-1?r.events[D][1].type:null,X=U==="tableHead"||U==="tableRow"?N:c;return X===N&&r.parser.lazy[r.now().line]?n(O):X(O)}function c(O){return e.enter("tableHead"),e.enter("tableRow"),u(O)}function u(O){return O===124||(a=!0,i+=1),d(O)}function d(O){return O===null?n(O):qe(O)?i>1?(i=0,r.interrupt=!0,e.exit("tableRow"),e.enter("lineEnding"),e.consume(O),e.exit("lineEnding"),p):n(O):yt(O)?_t(e,d,"whitespace")(O):(i+=1,a&&(a=!1,s+=1),O===124?(e.enter("tableCellDivider"),e.consume(O),e.exit("tableCellDivider"),a=!0,d):(e.enter("data"),f(O)))}function f(O){return O===null||O===124||Dt(O)?(e.exit("data"),d(O)):(e.consume(O),O===92?h:f)}function h(O){return O===92||O===124?(e.consume(O),f):f(O)}function p(O){return r.interrupt=!1,r.parser.lazy[r.now().line]?n(O):(e.enter("tableDelimiterRow"),a=!1,yt(O)?_t(e,m,"linePrefix",r.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(O):m(O))}function m(O){return O===45||O===58?E(O):O===124?(a=!0,e.enter("tableCellDivider"),e.consume(O),e.exit("tableCellDivider"),y):k(O)}function y(O){return yt(O)?_t(e,E,"whitespace")(O):E(O)}function E(O){return O===58?(i+=1,a=!0,e.enter("tableDelimiterMarker"),e.consume(O),e.exit("tableDelimiterMarker"),g):O===45?(i+=1,g(O)):O===null||qe(O)?_(O):k(O)}function g(O){return O===45?(e.enter("tableDelimiterFiller"),x(O)):k(O)}function x(O){return O===45?(e.consume(O),x):O===58?(a=!0,e.exit("tableDelimiterFiller"),e.enter("tableDelimiterMarker"),e.consume(O),e.exit("tableDelimiterMarker"),b):(e.exit("tableDelimiterFiller"),b(O))}function b(O){return yt(O)?_t(e,_,"whitespace")(O):_(O)}function _(O){return O===124?m(O):O===null||qe(O)?!a||s!==i?k(O):(e.exit("tableDelimiterRow"),e.exit("tableHead"),t(O)):k(O)}function k(O){return n(O)}function N(O){return e.enter("tableRow"),C(O)}function C(O){return O===124?(e.enter("tableCellDivider"),e.consume(O),e.exit("tableCellDivider"),C):O===null||qe(O)?(e.exit("tableRow"),t(O)):yt(O)?_t(e,C,"whitespace")(O):(e.enter("data"),S(O))}function S(O){return O===null||O===124||Dt(O)?(e.exit("data"),C(O)):(e.consume(O),O===92?A:S)}function A(O){return O===92||O===124?(e.consume(O),S):S(O)}}function fQ(e,t){let n=-1,r=!0,s=0,i=[0,0,0,0],a=[0,0,0,0],o=!1,c=0,u,d,f;const h=new oQ;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({},El(t.events,s)),e.add(s,0,[["exit",i,t]]),i=void 0),i}function kT(e,t,n,r,s){const i=[],a=El(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 El(e,t){const n=e[t],r=n[0]==="enter"?"start":"end";return n[1][r]}const hQ={name:"tasklistCheck",tokenize:mQ};function pQ(){return{text:{91:hQ}}}function mQ(e,t,n){const r=this;return s;function s(c){return r.previous!==null||!r._gfmTasklistFirstContentOfListItem?n(c):(e.enter("taskListCheck"),e.enter("taskListCheckMarker"),e.consume(c),e.exit("taskListCheckMarker"),i)}function i(c){return Dt(c)?(e.enter("taskListCheckValueUnchecked"),e.consume(c),e.exit("taskListCheckValueUnchecked"),a):c===88||c===120?(e.enter("taskListCheckValueChecked"),e.consume(c),e.exit("taskListCheckValueChecked"),a):n(c)}function a(c){return c===93?(e.enter("taskListCheckMarker"),e.consume(c),e.exit("taskListCheckMarker"),e.exit("taskListCheck"),o):n(c)}function o(c){return qe(c)?t(c):yt(c)?e.check({tokenize:gQ},t,n)(c):n(c)}}function gQ(e,t,n){return _t(e,r,"whitespace");function r(s){return s===null?n(s):t(s)}}function yQ(e){return qM([HX(),ZX(),aQ(e),uQ(),pQ()])}const bQ={};function EQ(e){const t=this,n=e||bQ,r=t.data(),s=r.micromarkExtensions||(r.micromarkExtensions=[]),i=r.fromMarkdownExtensions||(r.fromMarkdownExtensions=[]),a=r.toMarkdownExtensions||(r.toMarkdownExtensions=[]);s.push(yQ(n)),i.push(BX()),a.push(FX(n))}const NT=function(e,t,n){const r=Cf(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&&c.push(` -`.repeat(u)||" "),u=-1,c.push(d))}return c.join("")}function H3(e,t,n){return e.type==="element"?TQ(e,t,n):e.type==="text"?n.whitespace==="normal"?z3(e,n):AQ(e):[]}function TQ(e,t,n){const r=V3(e,n),s=e.children||[];let i=-1,a=[];if(NQ(e))return a;let o,c;for(hE(e)||CT(e)&&NT(t,e,CT)?c=` -`:kQ(e)?(o=2,c=2):$3(e)&&(o=1,c=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"],E=["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:E},k={className:"function.dispatch",relevance:0,keywords:{_hint:g},begin:t.concat(/\b/,/(?!decltype)/,/(?!if)/,/(?!for)/,/(?!switch)/,/(?!while)/,e.IDENT_RE,t.lookahead(/(<[^<>]+>|)\s*\(/))},N=[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:N.concat([{begin:/\(/,end:/\)/,keywords:_,contains:N.concat(["self"]),relevance:0}]),relevance:0},S={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 jQ(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=MQ(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 K3(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 c={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"],E=["true","false"],g={match:/(\/[a-z._-]+)+/},x=["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:E,built_in:[...x,...b,"set","shopt",..._,...k]},contains:[p,e.SHEBANG(),m,f,i,a,g,o,c,u,d,n]}}function DQ(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*\\(",E={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],x={variants:[{begin:/=/,end:/;/},{begin:/\(/,end:/\)/},{beginKeywords:"new throw return else",end:/;/}],keywords:E,contains:g.concat([{begin:/\(/,end:/\)/,keywords:E,contains:g.concat(["self"]),relevance:0}]),relevance:0},b={begin:"("+a+"[\\*&\\s]+)+"+p,returnBegin:!0,end:/[{;=]/,excludeEnd:!0,keywords:E,illegal:/[^\w\s\*&:<>.]/,contains:[{begin:r,keywords:E,relevance:0},{begin:p,returnBegin:!0,contains:[e.inherit(h,{className:"title.function"})],relevance:0},{relevance:0,match:/,/},{className:"params",begin:/\(/,end:/\)/,keywords:E,relevance:0,contains:[n,e.C_BLOCK_COMMENT_MODE,u,d,o,{begin:/\(/,end:/\)/,keywords:E,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:E,disableAutodetect:!0,illegal:"=]/,contains:[{beginKeywords:"final class struct"},e.TITLE_MODE]}]),exports:{preprocessor:f,strings:u,keywords:E}}}function PQ(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"],E=["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:E},k={className:"function.dispatch",relevance:0,keywords:{_hint:g},begin:t.concat(/\b/,/(?!decltype)/,/(?!if)/,/(?!for)/,/(?!switch)/,/(?!while)/,e.IDENT_RE,t.lookahead(/(<[^<>]+>|)\s*\(/))},N=[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:N.concat([{begin:/\(/,end:/\)/,keywords:_,contains:N.concat(["self"]),relevance:0}]),relevance:0},S={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 BQ(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)*"}),c={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]},E=e.inherit(y,{illegal:/\n/,contains:[{begin:/\{\{/},{begin:/\}\}/},{begin:'""'},p]});h.contains=[y,m,d,e.APOS_STRING_MODE,e.QUOTE_STRING_MODE,c,e.C_BLOCK_COMMENT_MODE],p.contains=[E,m,f,e.APOS_STRING_MODE,e.QUOTE_STRING_MODE,c,e.inherit(e.C_BLOCK_COMMENT_MODE,{illegal:/\n/})];const g={variants:[u,y,m,d,e.APOS_STRING_MODE,e.QUOTE_STRING_MODE]},x={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,c,{beginKeywords:"class interface",relevance:0,end:/[{;=]/,illegal:/[^\s:,]/,contains:[{beginKeywords:"where class"},o,x,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,x,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,x],relevance:0},{match:/\(\)/},{className:"params",begin:/\(/,end:/\)/,excludeBegin:!0,excludeEnd:!0,keywords:a,relevance:0,contains:[g,c,e.C_BLOCK_COMMENT_MODE]},e.C_LINE_COMMENT_MODE,e.C_BLOCK_COMMENT_MODE]},_]}}const FQ=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_-]*/}}),UQ=["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"],$Q=["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"],HQ=[...UQ,...$Q],zQ=["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(),VQ=["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(),KQ=["after","backdrop","before","cue","cue-region","first-letter","first-line","grammar-error","marker","part","placeholder","selection","slotted","spelling-error"].sort().reverse(),YQ=["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 WQ(e){const t=e.regex,n=FQ(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:":("+VQ.join("|")+")"},{begin:":(:)?("+KQ.join("|")+")"}]},n.CSS_VARIABLE,{className:"attribute",begin:"\\b("+YQ.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:zQ.join(" ")},contains:[{begin:/[a-z-]+(?=:)/,className:"attribute"},...o,n.CSS_NUMBER_MODE]}]},{className:"selector-tag",begin:"\\b("+HQ.join("|")+")\\b"}]}}function GQ(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 qQ(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:"W3(e,t,n-1))}function QQ(e){const t=e.regex,n="[À-ʸa-zA-Z_$][À-ʸa-zA-Z_$0-9]*",r=n+W3("(?:<"+n+"~~~(?:\\s*,\\s*"+n+"~~~)*>)?",/~~~/g,2),c={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:c,relevance:0,contains:[e.C_BLOCK_COMMENT_MODE],endsParent:!0};return{name:"Java",aliases:["jsp"],keywords:c,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:c,contains:[{className:"params",begin:/\(/,end:/\)/,keywords:c,relevance:0,contains:[u,e.APOS_STRING_MODE,e.QUOTE_STRING_MODE,IT,e.C_BLOCK_COMMENT_MODE]},e.C_LINE_COMMENT_MODE,e.C_BLOCK_COMMENT_MODE]},IT,u]}}const OT="[A-Za-z$_][0-9A-Za-z$_]*",ZQ=["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"],JQ=["true","false","null","undefined","NaN","Infinity"],G3=["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"],q3=["Error","EvalError","InternalError","RangeError","ReferenceError","SyntaxError","TypeError","URIError"],X3=["setInterval","setTimeout","clearInterval","clearTimeout","require","exports","eval","isFinite","isNaN","parseFloat","parseInt","decodeURI","decodeURIComponent","encodeURI","encodeURIComponent","escape","unescape"],eZ=["arguments","this","super","console","window","document","localStorage","sessionStorage","module","global"],tZ=[].concat(X3,G3,q3);function Q3(e){const t=e.regex,n=(R,{after:F})=>{const I="",end:""},i=/<[A-Za-z0-9\\._:-]+\s*\/>/,a={begin:/<[A-Za-z0-9\\._:-]+/,end:/\/[A-Za-z0-9\\._:-]+>|\/>/,isTrulyOpeningTag:(R,F)=>{const I=R[0].length+R.index,V=R.input[I];if(V==="<"||V===","){F.ignoreMatch();return}V===">"&&(n(R,{after:I})||F.ignoreMatch());let W;const P=R.input.substring(I);if(W=P.match(/^\s*=/)){F.ignoreMatch();return}if((W=P.match(/^\s+extends\s+/))&&W.index===0){F.ignoreMatch();return}}},o={$pattern:OT,keyword:ZQ,literal:JQ,built_in:tZ,"variable.language":eZ},c="[0-9](_?[0-9])*",u=`\\.(${c})`,d="0|[1-9](_?[0-9])*|0[0-7]*[89][0-9]*",f={className:"number",variants:[{begin:`(\\b(${d})((${u})|\\.)?|(${u}))[eE][+-]?(${c})\\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"}},E={className:"string",begin:"`",end:"`",contains:[e.BACKSLASH_ESCAPE,h]},x={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,E,{match:/\$\d+/},f];h.contains=b.concat({begin:/\{/,end:/\}/,keywords:o,contains:["self"].concat(b)});const _=[].concat(x,h.contains),k=_.concat([{begin:/(\s*)\(/,end:/\)/,keywords:o,contains:["self"].concat(_)}]),N={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"}}]},S={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:{_:[...G3,...q3]}},A={label:"use_strict",className:"meta",relevance:10,begin:/^\s*['"]use (strict|asm)['"]/},O={variants:[{match:[/function/,/\s+/,r,/(?=\s*\()/]},{match:[/function/,/\s*(?=\()/]}],className:{1:"keyword",3:"title.function"},label:"func.def",contains:[N],illegal:/%/},D={relevance:0,match:/\b[A-Z][A-Z_0-9]+\b/,className:"variable.constant"};function U(R){return t.concat("(?!",R.join("|"),")")}const X={match:t.concat(/\b/,U([...X3,"super","import"].map(R=>`${R}\\s*\\(`)),r,t.lookahead(/\s*\(/)),className:"title.function",relevance:0},M={begin:t.concat(/\./,t.lookahead(t.concat(r,/(?![0-9A-Za-z$_(])/))),end:r,excludeBegin:!0,keywords:"prototype",className:"property",relevance:0},j={match:[/get|set/,/\s+/,r,/(?=\()/],className:{1:"keyword",3:"title.function"},contains:[{begin:/\(\)/},N]},T="(\\([^()]*(\\([^()]*(\\([^()]*\\)[^()]*)*\\)[^()]*)*\\)|"+e.UNDERSCORE_IDENT_RE+")\\s*=>",L={match:[/const|var|let/,/\s+/,r,/\s*/,/=\s*/,/(async\s*)?/,t.lookahead(T)],keywords:"async",className:{1:"keyword",3:"title.function"},contains:[N]};return{name:"JavaScript",aliases:["js","jsx","mjs","cjs"],keywords:o,exports:{PARAMS_CONTAINS:k,CLASS_REFERENCE:S},illegal:/#(?![$_A-z])/,contains:[e.SHEBANG({label:"shebang",binary:"node",relevance:5}),A,e.APOS_STRING_MODE,e.QUOTE_STRING_MODE,p,m,y,E,x,{match:/\$\d+/},f,S,{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:[x,e.REGEXP_MODE,{className:"function",begin:T,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"]}]}]},O,{beginKeywords:"while if switch catch for"},{begin:"\\b(?!function)"+e.UNDERSCORE_IDENT_RE+"\\([^()]*(\\([^()]*(\\([^()]*\\)[^()]*)*\\)[^()]*)*\\)\\s*\\{",returnBegin:!0,label:"func.def",contains:[N,e.inherit(e.TITLE_MODE,{begin:r,className:"title.function"})]},{match:/\.\.\./,relevance:0},M,{match:"\\$"+r,relevance:0},{match:[/\bconstructor(?=\s*\()/],className:{1:"title.function"},contains:[N]},X,D,C,j,{match:/\$[(.]/}]}}function Z3(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 wl="[0-9](_*[0-9])*",Fh=`\\.(${wl})`,Uh="[0-9a-fA-F](_*[0-9a-fA-F])*",nZ={className:"number",variants:[{begin:`(\\b(${wl})((${Fh})|\\.)?|(${Fh}))[eE][+-]?(${wl})[fFdD]?\\b`},{begin:`\\b(${wl})((${Fh})[fFdD]?\\b|\\.([fFdD]\\b)?)`},{begin:`(${Fh})[fFdD]?\\b`},{begin:`\\b(${wl})[fFdD]\\b`},{begin:`\\b0[xX]((${Uh})\\.?|(${Uh})?\\.(${Uh}))[pP][+-]?(${wl})[fFdD]?\\b`},{begin:"\\b(0|[1-9](_*[0-9])*)[lL]?\\b"},{begin:`\\b0[xX](${Uh})[lL]?\\b`},{begin:"\\b0(_*[0-7])*[lL]?\\b"},{begin:"\\b0[bB][01](_*[01])*[lL]?\\b"}],relevance:0};function rZ(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+")?"},c={className:"meta",begin:"@"+e.UNDERSCORE_IDENT_RE,contains:[{begin:/\(/,end:/\)/,contains:[e.inherit(a,{className:"string"}),"self"]}]},u=nZ,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,c,{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,c,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,c]},a,{className:"meta",begin:"^#!/usr/bin/env",end:"$",illegal:` -`},u]}}const sZ=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_-]*/}}),iZ=["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"],aZ=["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"],oZ=[...iZ,...aZ],lZ=["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(),J3=["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(),ej=["after","backdrop","before","cue","cue-region","first-letter","first-line","grammar-error","marker","part","placeholder","selection","slotted","spelling-error"].sort().reverse(),cZ=["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(),uZ=J3.concat(ej).sort().reverse();function dZ(e){const t=sZ(e),n=uZ,r="and or not only",s="[\\w-]+",i="("+s+"|@\\{"+s+"\\})",a=[],o=[],c=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:lZ.join(" ")},f={begin:"\\(",end:"\\)",contains:o,keywords:d,relevance:0};o.push(e.C_LINE_COMMENT_MODE,e.C_BLOCK_COMMENT_MODE,c("'"),c('"'),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("+cZ.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}},E={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("+oZ.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:":("+J3.join("|")+")"},{className:"selector-pseudo",begin:":(:)?("+ej.join("|")+")"},{begin:/\(/,end:/\)/,relevance:0,contains:h},{begin:"!important"},t.FUNCTION_DISPATCH]},x={begin:s+`:(:)?(${n.join("|")})`,returnBegin:!0,contains:[g]};return a.push(e.C_LINE_COMMENT_MODE,e.C_BLOCK_COMMENT_MODE,y,E,x,m,g,p,t.FUNCTION_DISPATCH),{name:"Less",case_insensitive:!0,illegal:`[=>'/<($"]`,contains:a}}function fZ(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 tj(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+.-]*/,c={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,c];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,c,a,{scope:"literal",match:/&([a-zA-Z0-9]+|#[0-9]{1,7}|#[Xx][0-9a-fA-F]{1,6});/}]}}function hZ(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"]},c={$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:"("+c.keyword.join("|")+")\\b",end:/(\{|$)/,excludeEnd:!0,keywords:c,contains:[e.UNDERSCORE_TITLE_MODE]},{begin:"\\."+e.UNDERSCORE_IDENT_RE,relevance:0}]}}function pZ(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*\(.*?\))?/},c={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,c],f=[/!/,/\//,/\|/,/\?/,/'/,/"/,/#/],h=(y,E,g="\\1")=>{const x=g==="\\1"?g:t.concat(g,E);return t.concat(t.concat("(?:",y,")"),E,/(?:\\.|[^\\\/])*?/,x,/(?:\\.|[^\\\/])*?/,g,r)},p=(y,E,g)=>t.concat(t.concat("(?:",y,")"),E,/(?:\\.|[^\\\/])*?/,g,r),m=[c,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 mZ(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:/\?>/}]},c={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(c)}),f={begin:/<<<[ \t]*(?:(\w+)|"(\w+)")\n/,end:/[ \t]*(\w+)\b/,contains:e.QUOTE_STRING_MODE.contains.concat(c),"on:begin":(M,j)=>{j.data._beginMatch=M[1]||M[2]},"on:end":(M,j)=>{j.data._beginMatch!==M[1]&&j.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},E=["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"],x=["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:(M=>{const j=[];return M.forEach(T=>{j.push(T),T.toLowerCase()===T?j.push(T.toUpperCase()):j.push(T.toLowerCase())}),j})(E),built_in:x},k=M=>M.map(j=>j.replace(/\|\d+$/,"")),N={variants:[{match:[/new/,t.concat(p,"+"),t.concat("(?!",k(x).join("\\b|"),"\\b)"),s],scope:{1:"keyword",4:"title.class"}}]},C=t.concat(r,"\\b(?!\\()"),S={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"}}]},A={scope:"attr",match:t.concat(r,t.lookahead(":"),t.lookahead(/(?!::)/))},O={relevance:0,begin:/\(/,end:/\)/,keywords:_,contains:[A,a,S,e.C_BLOCK_COMMENT_MODE,m,y,N]},D={relevance:0,match:[/\b/,t.concat("(?!fn\\b|function\\b|",k(g).join("\\b|"),"|",k(x).join("\\b|"),"\\b)"),r,t.concat(p,"*"),t.lookahead(/(?=\()/)],scope:{3:"title.function.invoke"},contains:[O]};O.contains.push(D);const U=[A,S,e.C_BLOCK_COMMENT_MODE,m,y,N],X={begin:t.concat(/#\[\s*\\?/,t.either(s,i)),beginScope:"meta",end:/]/,endScope:"meta",keywords:{literal:E,keyword:["new","array"]},contains:[{begin:/\[/,end:/]/,keywords:{literal:E,keyword:["new","array"]},contains:["self",...U]},...U,{scope:"meta",variants:[{match:s},{match:i}]}]};return{case_insensitive:!1,keywords:_,contains:[X,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,D,S,{match:[/const/,/\s/,r],scope:{1:"keyword",3:"variable.constant"}},N,{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",X,a,S,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 gZ(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 yZ(e){return{name:"Plain text",aliases:["text","txt"],disableAutodetect:!0}}function rj(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"]},c={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,c],relevance:10},{begin:/([uU]|[bB]|[rR]|[bB][rR]|[rR][bB])?"""/,end:/"""/,contains:[e.BACKSLASH_ESCAPE,c],relevance:10},{begin:/([fF][rR]|[rR][fF]|[fF])'''/,end:/'''/,contains:[e.BACKSLASH_ESCAPE,c,d,u]},{begin:/([fF][rR]|[rR][fF]|[fF])"""/,end:/"""/,contains:[e.BACKSLASH_ESCAPE,c,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})`}]},E={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",c,y,f,e.HASH_COMMENT_MODE]}]};return u.contains=[f,y,c],{name:"Python",aliases:["py","gyp","ipython"],unicodeRegex:!0,keywords:o,illegal:/(<\/|\?)|=>/,contains:[c,y,{scope:"variable.language",match:/\bself\b/},{beginKeywords:"if",relevance:0},{match:/\bor\b/,scope:"keyword"},f,E,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 bZ(e){return{aliases:["pycon"],contains:[{className:"meta.prompt",starts:{end:/ |$/,starts:{end:"$",subLanguage:"python"}},variants:[{begin:/^>>>(?=[ ]|$)/},{begin:/^\.\.\.(?=[ ]|$)/}]}]}}function EZ(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 xZ(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]+"},c={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}]},N=[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(c,u),relevance:0}].concat(c,u);d.contains=N,y.contains=N;const O=[{begin:/^\s*=>/,starts:{end:"$",contains:N}},{className:"meta.prompt",begin:"^("+"[>?]>"+"|"+"[\\w#]+\\(\\w+\\):\\d+:\\d+[>*]"+"|"+"(\\w+-)?\\d+\\.\\d+\\.\\d+(p\\d+)?[^\\d][^>]+>"+")(?=[ ])",starts:{end:"$",keywords:a,contains:N}}];return u.unshift(c),{name:"Ruby",aliases:["rb","gemspec","podspec","thor","irb"],keywords:a,illegal:/\/\*/,contains:[e.SHEBANG({binary:"ruby"})].concat(O).concat(u).concat(N)}}function wZ(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"],c=["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:c,built_in:u},illegal:""},i]}}const vZ=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_-]*/}}),_Z=["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"],kZ=["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"],NZ=[..._Z,...kZ],SZ=["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(),TZ=["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(),AZ=["after","backdrop","before","cue","cue-region","first-letter","first-line","grammar-error","marker","part","placeholder","selection","slotted","spelling-error"].sort().reverse(),CZ=["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 IZ(e){const t=vZ(e),n=AZ,r=TZ,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("+NZ.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("+CZ.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:SZ.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 OZ(e){return{name:"Shell Session",aliases:["console","shellsession"],contains:[{className:"meta.prompt",begin:/^\s{0,3}[/~\w\d[\]()@-]*[>%$#][ ]?/,starts:{end:/[^\\](?=\s*$)/,subLanguage:"bash"}}]}}function RZ(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"],c=["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,...c].filter(k=>!d.includes(k)),y={scope:"variable",match:/@[a-z0-9][a-z0-9_]*/},E={scope:"operator",match:/[-+*/=%^~]|&&?|\|\|?|!=?|<(?:=>?|<|>)?|>[>=]?/,relevance:0},g={match:t.concat(/\b/,t.either(...p),/\s*\(/),relevance:0,keywords:{built_in:p}};function x(k){return t.concat(/\b/,t.either(...k.map(N=>N.replace(/\s+/,"\\s+"))),/\b/)}const b={scope:"keyword",match:x(h),relevance:0};function _(k,{exceptions:N,when:C}={}){const S=C;return N=N||[],k.map(A=>A.match(/\|\d+$/)||N.includes(A)?A:S(A)?`${A}|0`:A)}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:x(a)},b,g,y,r,s,e.C_NUMBER_MODE,e.C_BLOCK_COMMENT_MODE,n,E]}}function sj(e){return e?typeof e=="string"?e:e.source:null}function wu(e){return jt("(?=",e,")")}function jt(...e){return e.map(n=>sj(n)).join("")}function LZ(e){const t=e[e.length-1];return typeof t=="object"&&t.constructor===Object?(e.splice(e.length-1,1),t):{}}function vr(...e){return"("+(LZ(e).capture?"":"?:")+e.map(r=>sj(r)).join("|")+")"}const av=e=>jt(/\b/,e,/\w$/.test(e)?/\b/:/\B/),MZ=["Protocol","Type"].map(av),RT=["init","self"].map(av),jZ=["Any","Self"],Dy=["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"],LT=["false","nil","true"],DZ=["assignment","associativity","higherThan","left","lowerThan","none","right"],PZ=["#colorLiteral","#column","#dsohandle","#else","#elseif","#endif","#error","#file","#fileID","#fileLiteral","#filePath","#function","#if","#imageLiteral","#keyPath","#line","#selector","#sourceLocation","#warning"],MT=["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"],ij=vr(/[/=\-+!*%<>&|^~?]/,/[\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]/),aj=vr(ij,/[\u0300-\u036F]/,/[\u1DC0-\u1DFF]/,/[\u20D0-\u20FF]/,/[\uFE00-\uFE0F]/,/[\uFE20-\uFE2F]/),Py=jt(ij,aj,"*"),oj=vr(/[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]/),Im=vr(oj,/\d/,/[\u0300-\u036F\u1DC0-\u1DFF\u20D0-\u20FF\uFE20-\uFE2F]/),li=jt(oj,Im,"*"),$h=jt(/[A-Z]/,Im,"*"),BZ=["attached","autoclosure",jt(/convention\(/,vr("swift","block","c"),/\)/),"discardableResult","dynamicCallable","dynamicMemberLookup","escaping","freestanding","frozen","GKInspectable","IBAction","IBDesignable","IBInspectable","IBOutlet","IBSegueAction","inlinable","main","nonobjc","NSApplicationMain","NSCopying","NSManaged",jt(/objc\(/,li,/\)/),"objc","objcMembers","propertyWrapper","requires_stored_property_inits","resultBuilder","Sendable","testable","UIApplicationMain","unchecked","unknown","usableFromInline","warn_unqualified_access"],FZ=["iOS","iOSApplicationExtension","macOS","macOSApplicationExtension","macCatalyst","macCatalystApplicationExtension","watchOS","watchOSApplicationExtension","tvOS","tvOSApplicationExtension","swift"];function UZ(e){const t={match:/\s+/,relevance:0},n=e.COMMENT("/\\*","\\*/",{contains:["self"]}),r=[e.C_LINE_COMMENT_MODE,n],s={match:[/\./,vr(...MZ,...RT)],className:{2:"keyword"}},i={match:jt(/\./,vr(...Dy)),relevance:0},a=Dy.filter(Te=>typeof Te=="string").concat(["_|0"]),o=Dy.filter(Te=>typeof Te!="string").concat(jZ).map(av),c={variants:[{className:"keyword",match:vr(...o,...RT)}]},u={$pattern:vr(/\b\w+/,/#\w+/),keyword:a.concat(PZ),literal:LT},d=[s,i,c],f={match:jt(/\./,vr(...MT)),relevance:0},h={className:"built_in",match:jt(/\b/,vr(...MT),/(?=\()/)},p=[f,h],m={match:/->/,relevance:0},y={className:"operator",relevance:0,variants:[{match:Py},{match:`\\.(\\.|${aj})+`}]},E=[m,y],g="([0-9]_*)+",x="([0-9a-fA-F]_*)+",b={className:"number",relevance:0,variants:[{match:`\\b(${g})(\\.(${g}))?([eE][+-]?(${g}))?\\b`},{match:`\\b0x(${x})(\\.(${x}))?([pP][+-]?(${g}))?\\b`},{match:/\b0o([0-7]_*)+\b/},{match:/\b0b([01]_*)+\b/}]},_=(Te="")=>({className:"subst",variants:[{match:jt(/\\/,Te,/[0\\tnr"']/)},{match:jt(/\\/,Te,/u\{[0-9a-fA-F]{1,8}\}/)}]}),k=(Te="")=>({className:"subst",match:jt(/\\/,Te,/[\t ]*(?:[\r\n]|\r\n)/)}),N=(Te="")=>({className:"subst",label:"interpol",begin:jt(/\\/,Te,/\(/),end:/\)/}),C=(Te="")=>({begin:jt(Te,/"""/),end:jt(/"""/,Te),contains:[_(Te),k(Te),N(Te)]}),S=(Te="")=>({begin:jt(Te,/"/),end:jt(/"/,Te),contains:[_(Te),N(Te)]}),A={className:"string",variants:[C(),C("#"),C("##"),C("###"),S(),S("#"),S("##"),S("###")]},O=[e.BACKSLASH_ESCAPE,{begin:/\[/,end:/\]/,relevance:0,contains:[e.BACKSLASH_ESCAPE]}],D={begin:/\/[^\s](?=[^/\n]*\/)/,end:/\//,contains:O},U=Te=>{const Ke=jt(Te,/\//),Ne=jt(/\//,Te);return{begin:Ke,end:Ne,contains:[...O,{scope:"comment",begin:`#(?!.*${Ne})`,end:/$/}]}},X={scope:"regexp",variants:[U("###"),U("##"),U("#"),D]},M={match:jt(/`/,li,/`/)},j={className:"variable",match:/\$\d+/},T={className:"variable",match:`\\$${Im}+`},L=[M,j,T],R={match:/(@|#(un)?)available/,scope:"keyword",starts:{contains:[{begin:/\(/,end:/\)/,keywords:FZ,contains:[...E,b,A]}]}},F={scope:"keyword",match:jt(/@/,vr(...BZ),wu(vr(/\(/,/\s+/)))},I={scope:"meta",match:jt(/@/,li)},V=[R,F,I],W={match:wu(/\b[A-Z]/),relevance:0,contains:[{className:"type",match:jt(/(AV|CA|CF|CG|CI|CL|CM|CN|CT|MK|MP|MTK|MTL|NS|SCN|SK|UI|WK|XC)/,Im,"+")},{className:"type",match:$h,relevance:0},{match:/[?!]+/,relevance:0},{match:/\.\.\./,relevance:0},{match:jt(/\s+&\s+/,wu($h)),relevance:0}]},P={begin://,keywords:u,contains:[...r,...d,...V,m,W]};W.contains.push(P);const ie={match:jt(li,/\s*:/),keywords:"_|0",relevance:0},G={begin:/\(/,end:/\)/,relevance:0,keywords:u,contains:["self",ie,...r,X,...d,...p,...E,b,A,...L,...V,W]},re={begin://,keywords:"repeat each",contains:[...r,W]},ue={begin:vr(wu(jt(li,/\s*:/)),wu(jt(li,/\s+/,li,/\s*:/))),end:/:/,relevance:0,contains:[{className:"keyword",match:/\b_\b/},{className:"params",match:li}]},ee={begin:/\(/,end:/\)/,keywords:u,contains:[ue,...r,...d,...E,b,A,...V,W,G],endsParent:!0,illegal:/["']/},le={match:[/(func|macro)/,/\s+/,vr(M.match,li,Py)],className:{1:"keyword",3:"title.function"},contains:[re,ee,t],illegal:[/\[/,/%/]},ne={match:[/\b(?:subscript|init[?!]?)/,/\s*(?=[<(])/],className:{1:"keyword"},contains:[re,ee,t],illegal:/\[|%/},me={match:[/operator/,/\s+/,Py],className:{1:"keyword",3:"title"}},ye={begin:[/precedencegroup/,/\s+/,$h],className:{1:"keyword",3:"title"},contains:[W],keywords:[...DZ,...LT],end:/}/},te={match:[/class\b/,/\s+/,/func\b/,/\s+/,/\b[A-Za-z_][A-Za-z0-9_]*\b/],scope:{1:"keyword",3:"keyword",5:"title.function"}},de={match:[/class\b/,/\s+/,/var\b/],scope:{1:"keyword",3:"keyword"}},Ee={begin:[/(struct|protocol|class|extension|enum|actor)/,/\s+/,li,/\s*/],beginScope:{1:"keyword",3:"title.class"},keywords:u,contains:[re,...d,{begin:/:/,end:/\{/,keywords:u,contains:[{scope:"title.class.inherited",match:$h},...d],relevance:0}]};for(const Te of A.variants){const Ke=Te.contains.find(it=>it.label==="interpol");Ke.keywords=u;const Ne=[...d,...p,...E,b,A,...L];Ke.contains=[...Ne,{begin:/\(/,end:/\)/,contains:["self",...Ne]}]}return{name:"Swift",keywords:u,contains:[...r,le,ne,te,de,Ee,me,ye,{beginKeywords:"import",end:/$/,contains:[...r],relevance:0},X,...d,...p,...E,b,A,...L,...V,W,G]}}const Om="[A-Za-z$_][0-9A-Za-z$_]*",lj=["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"],cj=["true","false","null","undefined","NaN","Infinity"],uj=["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"],dj=["Error","EvalError","InternalError","RangeError","ReferenceError","SyntaxError","TypeError","URIError"],fj=["setInterval","setTimeout","clearInterval","clearTimeout","require","exports","eval","isFinite","isNaN","parseFloat","parseInt","decodeURI","decodeURIComponent","encodeURI","encodeURIComponent","escape","unescape"],hj=["arguments","this","super","console","window","document","localStorage","sessionStorage","module","global"],pj=[].concat(fj,uj,dj);function $Z(e){const t=e.regex,n=(R,{after:F})=>{const I="",end:""},i=/<[A-Za-z0-9\\._:-]+\s*\/>/,a={begin:/<[A-Za-z0-9\\._:-]+/,end:/\/[A-Za-z0-9\\._:-]+>|\/>/,isTrulyOpeningTag:(R,F)=>{const I=R[0].length+R.index,V=R.input[I];if(V==="<"||V===","){F.ignoreMatch();return}V===">"&&(n(R,{after:I})||F.ignoreMatch());let W;const P=R.input.substring(I);if(W=P.match(/^\s*=/)){F.ignoreMatch();return}if((W=P.match(/^\s+extends\s+/))&&W.index===0){F.ignoreMatch();return}}},o={$pattern:Om,keyword:lj,literal:cj,built_in:pj,"variable.language":hj},c="[0-9](_?[0-9])*",u=`\\.(${c})`,d="0|[1-9](_?[0-9])*|0[0-7]*[89][0-9]*",f={className:"number",variants:[{begin:`(\\b(${d})((${u})|\\.)?|(${u}))[eE][+-]?(${c})\\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"}},E={className:"string",begin:"`",end:"`",contains:[e.BACKSLASH_ESCAPE,h]},x={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,E,{match:/\$\d+/},f];h.contains=b.concat({begin:/\{/,end:/\}/,keywords:o,contains:["self"].concat(b)});const _=[].concat(x,h.contains),k=_.concat([{begin:/(\s*)\(/,end:/\)/,keywords:o,contains:["self"].concat(_)}]),N={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"}}]},S={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:{_:[...uj,...dj]}},A={label:"use_strict",className:"meta",relevance:10,begin:/^\s*['"]use (strict|asm)['"]/},O={variants:[{match:[/function/,/\s+/,r,/(?=\s*\()/]},{match:[/function/,/\s*(?=\()/]}],className:{1:"keyword",3:"title.function"},label:"func.def",contains:[N],illegal:/%/},D={relevance:0,match:/\b[A-Z][A-Z_0-9]+\b/,className:"variable.constant"};function U(R){return t.concat("(?!",R.join("|"),")")}const X={match:t.concat(/\b/,U([...fj,"super","import"].map(R=>`${R}\\s*\\(`)),r,t.lookahead(/\s*\(/)),className:"title.function",relevance:0},M={begin:t.concat(/\./,t.lookahead(t.concat(r,/(?![0-9A-Za-z$_(])/))),end:r,excludeBegin:!0,keywords:"prototype",className:"property",relevance:0},j={match:[/get|set/,/\s+/,r,/(?=\()/],className:{1:"keyword",3:"title.function"},contains:[{begin:/\(\)/},N]},T="(\\([^()]*(\\([^()]*(\\([^()]*\\)[^()]*)*\\)[^()]*)*\\)|"+e.UNDERSCORE_IDENT_RE+")\\s*=>",L={match:[/const|var|let/,/\s+/,r,/\s*/,/=\s*/,/(async\s*)?/,t.lookahead(T)],keywords:"async",className:{1:"keyword",3:"title.function"},contains:[N]};return{name:"JavaScript",aliases:["js","jsx","mjs","cjs"],keywords:o,exports:{PARAMS_CONTAINS:k,CLASS_REFERENCE:S},illegal:/#(?![$_A-z])/,contains:[e.SHEBANG({label:"shebang",binary:"node",relevance:5}),A,e.APOS_STRING_MODE,e.QUOTE_STRING_MODE,p,m,y,E,x,{match:/\$\d+/},f,S,{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:[x,e.REGEXP_MODE,{className:"function",begin:T,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"]}]}]},O,{beginKeywords:"while if switch catch for"},{begin:"\\b(?!function)"+e.UNDERSCORE_IDENT_RE+"\\([^()]*(\\([^()]*(\\([^()]*\\)[^()]*)*\\)[^()]*)*\\)\\s*\\{",returnBegin:!0,label:"func.def",contains:[N,e.inherit(e.TITLE_MODE,{begin:r,className:"title.function"})]},{match:/\.\.\./,relevance:0},M,{match:"\\$"+r,relevance:0},{match:[/\bconstructor(?=\s*\()/],className:{1:"title.function"},contains:[N]},X,D,C,j,{match:/\$[(.]/}]}}function mj(e){const t=e.regex,n=$Z(e),r=Om,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['"]/},c=["type","interface","public","private","protected","implements","declare","abstract","readonly","enum","override","satisfies"],u={$pattern:Om,keyword:lj.concat(c),literal:cj,built_in:pj.concat(s),"variable.language":hj},d={className:"meta",begin:"@"+r},f=(y,E,g)=>{const x=y.contains.findIndex(b=>b.label===E);if(x===-1)throw new Error("can not find mode to replace");y.contains.splice(x,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 HZ(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}/,c={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,c,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 zZ(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/},c={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,c,u,o]}}function VZ(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"}),c=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,c,o,a,{begin:/\[/,end:/\]/,contains:[{className:"meta",begin://,contains:[i,a,c,o]}]}]},e.COMMENT(//,{relevance:10}),{begin://,relevance:10},s,{className:"meta",end:/\?>/,variants:[{begin:/<\?xml/,relevance:10,contains:[c]},{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 gj(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},E=[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=[...E];return g.pop(),g.push(o),p.contains=g,{name:"YAML",case_insensitive:!0,aliases:["yml"],contains:E}}const KZ={arduino:jQ,bash:K3,c:DQ,cpp:PQ,csharp:BQ,css:WQ,diff:GQ,go:qQ,graphql:XQ,ini:Y3,java:QQ,javascript:Q3,json:Z3,kotlin:rZ,less:dZ,lua:fZ,makefile:tj,markdown:nj,objectivec:hZ,perl:pZ,php:mZ,"php-template":gZ,plaintext:yZ,python:rj,"python-repl":bZ,r:EZ,ruby:xZ,rust:wZ,scss:IZ,shell:OZ,sql:RZ,swift:UZ,typescript:mj,vbnet:HZ,wasm:zZ,xml:VZ,yaml:gj};function yj(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)&&yj(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 bj(e){return e.replace(/&/g,"&").replace(//g,">").replace(/"/g,""").replace(/'/g,"'")}function Na(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 YZ="",DT=e=>!!e.scope,WZ=(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 GZ{constructor(t,n){this.buffer="",this.classPrefix=n.classPrefix,t.walk(this)}addText(t){this.buffer+=bj(t)}openNode(t){if(!DT(t))return;const n=WZ(t.scope,{prefix:this.classPrefix});this.span(n)}closeNode(t){DT(t)&&(this.buffer+=YZ)}value(){return this.buffer}span(t){this.buffer+=``}}const PT=(e={})=>{const t={children:[]};return Object.assign(t,e),t};class ov{constructor(){this.rootNode=PT(),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=PT({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=>{ov._collapse(n)}))}}class qZ extends ov{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 GZ(this,this.options).value()}finalize(){return this.closeAllNodes(),!0}}function Zd(e){return e?typeof e=="string"?e:e.source:null}function Ej(e){return Qo("(?=",e,")")}function XZ(e){return Qo("(?:",e,")*")}function QZ(e){return Qo("(?:",e,")?")}function Qo(...e){return e.map(n=>Zd(n)).join("")}function ZZ(e){const t=e[e.length-1];return typeof t=="object"&&t.constructor===Object?(e.splice(e.length-1,1),t):{}}function lv(...e){return"("+(ZZ(e).capture?"":"?:")+e.map(r=>Zd(r)).join("|")+")"}function xj(e){return new RegExp(e.toString()+"|").exec("").length-1}function JZ(e,t){const n=e&&e.exec(t);return n&&n.index===0}const eJ=/\[(?:[^\\\]]|\\.)*\]|\(\??|\\([1-9][0-9]*)|\\./;function cv(e,{joinWith:t}){let n=0;return e.map(r=>{n+=1;const s=n;let i=Zd(r),a="";for(;i.length>0;){const o=eJ.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 tJ=/\b\B/,wj="[a-zA-Z]\\w*",uv="[a-zA-Z_]\\w*",vj="\\b\\d+(\\.\\d+)?",_j="(-?)(\\b0[xX][a-fA-F0-9]+|(\\b\\d+(\\.\\d*)?|\\.\\d+)([eE][-+]?\\d+)?)",kj="\\b(0b[01]+)",nJ="!|!=|!==|%|%=|&|&&|&=|\\*|\\*=|\\+|\\+=|,|-|-=|/=|/|:|;|<<|<<=|<=|<|===|==|=|>>>=|>>=|>=|>>>|>>|>|\\?|\\[|\\{|\\(|\\^|\\^=|\\||\\|=|\\|\\||~",rJ=(e={})=>{const t=/^#![ ]*\//;return e.binary&&(e.begin=Qo(t,/.*\b/,e.binary,/\b.*/)),Na({scope:"meta",begin:t,end:/$/,relevance:0,"on:begin":(n,r)=>{n.index!==0&&r.ignoreMatch()}},e)},Jd={begin:"\\\\[\\s\\S]",relevance:0},sJ={scope:"string",begin:"'",end:"'",illegal:"\\n",contains:[Jd]},iJ={scope:"string",begin:'"',end:'"',illegal:"\\n",contains:[Jd]},aJ={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/},$g=function(e,t,n={}){const r=Na({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=lv("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:Qo(/[ ]+/,"(",s,/[.]?[:]?([.][ ]|[ ])/,"){3}")}),r},oJ=$g("//","$"),lJ=$g("/\\*","\\*/"),cJ=$g("#","$"),uJ={scope:"number",begin:vj,relevance:0},dJ={scope:"number",begin:_j,relevance:0},fJ={scope:"number",begin:kj,relevance:0},hJ={scope:"regexp",begin:/\/(?=[^/\n]*\/)/,end:/\/[gimuy]*/,contains:[Jd,{begin:/\[/,end:/\]/,relevance:0,contains:[Jd]}]},pJ={scope:"title",begin:wj,relevance:0},mJ={scope:"title",begin:uv,relevance:0},gJ={begin:"\\.\\s*"+uv,relevance:0},yJ=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 Hh=Object.freeze({__proto__:null,APOS_STRING_MODE:sJ,BACKSLASH_ESCAPE:Jd,BINARY_NUMBER_MODE:fJ,BINARY_NUMBER_RE:kj,COMMENT:$g,C_BLOCK_COMMENT_MODE:lJ,C_LINE_COMMENT_MODE:oJ,C_NUMBER_MODE:dJ,C_NUMBER_RE:_j,END_SAME_AS_BEGIN:yJ,HASH_COMMENT_MODE:cJ,IDENT_RE:wj,MATCH_NOTHING_RE:tJ,METHOD_GUARD:gJ,NUMBER_MODE:uJ,NUMBER_RE:vj,PHRASAL_WORDS_MODE:aJ,QUOTE_STRING_MODE:iJ,REGEXP_MODE:hJ,RE_STARTERS_RE:nJ,SHEBANG:rJ,TITLE_MODE:pJ,UNDERSCORE_IDENT_RE:uv,UNDERSCORE_TITLE_MODE:mJ});function bJ(e,t){e.input[e.index-1]==="."&&t.ignoreMatch()}function EJ(e,t){e.className!==void 0&&(e.scope=e.className,delete e.className)}function xJ(e,t){t&&e.beginKeywords&&(e.begin="\\b("+e.beginKeywords.split(" ").join("|")+")(?!\\.)(?=\\b|\\s)",e.__beforeBegin=bJ,e.keywords=e.keywords||e.beginKeywords,delete e.beginKeywords,e.relevance===void 0&&(e.relevance=0))}function wJ(e,t){Array.isArray(e.illegal)&&(e.illegal=lv(...e.illegal))}function vJ(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 _J(e,t){e.relevance===void 0&&(e.relevance=1)}const kJ=(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=Qo(n.beforeMatch,Ej(n.begin)),e.starts={relevance:0,contains:[Object.assign(n,{endsParent:!0})]},e.relevance=0,delete n.beforeMatch},NJ=["of","and","for","in","not","or","if","then","parent","list","value"],SJ="keyword";function Nj(e,t,n=SJ){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,Nj(e[i],t,i))}),r;function s(i,a){t&&(a=a.map(o=>o.toLowerCase())),a.forEach(function(o){const c=o.split("|");r[c[0]]=[i,TJ(c[0],c[1])]})}}function TJ(e,t){return t?Number(t):AJ(e)?0:1}function AJ(e){return NJ.includes(e.toLowerCase())}const BT={},To=e=>{console.error(e)},FT=(e,...t)=>{console.log(`WARN: ${e}`,...t)},fl=(e,t)=>{BT[`${e}/${t}`]||(console.log(`Deprecated as of ${e}. ${t}`),BT[`${e}/${t}`]=!0)},Rm=new Error;function Sj(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+=xj(t[o-1]);e[n]=a,e[n]._emit=i,e[n]._multi=!0}function CJ(e){if(Array.isArray(e.begin)){if(e.skip||e.excludeBegin||e.returnBegin)throw To("skip, excludeBegin, returnBegin not compatible with beginScope: {}"),Rm;if(typeof e.beginScope!="object"||e.beginScope===null)throw To("beginScope must be object"),Rm;Sj(e,e.begin,{key:"beginScope"}),e.begin=cv(e.begin,{joinWith:""})}}function IJ(e){if(Array.isArray(e.end)){if(e.skip||e.excludeEnd||e.returnEnd)throw To("skip, excludeEnd, returnEnd not compatible with endScope: {}"),Rm;if(typeof e.endScope!="object"||e.endScope===null)throw To("endScope must be object"),Rm;Sj(e,e.end,{key:"endScope"}),e.end=cv(e.end,{joinWith:""})}}function OJ(e){e.scope&&typeof e.scope=="object"&&e.scope!==null&&(e.beginScope=e.scope,delete e.scope)}function RJ(e){OJ(e),typeof e.beginScope=="string"&&(e.beginScope={_wrap:e.beginScope}),typeof e.endScope=="string"&&(e.endScope={_wrap:e.endScope}),CJ(e),IJ(e)}function LJ(e){function t(a,o){return new RegExp(Zd(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,c){c.position=this.position++,this.matchIndexes[this.matchAt]=c,this.regexes.push([c,o]),this.matchAt+=xj(o)+1}compile(){this.regexes.length===0&&(this.exec=()=>null);const o=this.regexes.map(c=>c[1]);this.matcherRe=t(cv(o,{joinWith:"|"}),!0),this.lastIndex=0}exec(o){this.matcherRe.lastIndex=this.lastIndex;const c=this.matcherRe.exec(o);if(!c)return null;const u=c.findIndex((f,h)=>h>0&&f!==void 0),d=this.matchIndexes[u];return c.splice(0,u),Object.assign(c,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 c=new n;return this.rules.slice(o).forEach(([u,d])=>c.addRule(u,d)),c.compile(),this.multiRegexes[o]=c,c}resumingScanAtSamePosition(){return this.regexIndex!==0}considerAll(){this.regexIndex=0}addRule(o,c){this.rules.push([o,c]),c.type==="begin"&&this.count++}exec(o){const c=this.getMatcher(this.regexIndex);c.lastIndex=this.lastIndex;let u=c.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(c=>o.addRule(c.begin,{rule:c,type:"begin"})),a.terminatorEnd&&o.addRule(a.terminatorEnd,{type:"end"}),a.illegal&&o.addRule(a.illegal,{type:"illegal"}),o}function i(a,o){const c=a;if(a.isCompiled)return c;[EJ,vJ,RJ,kJ].forEach(d=>d(a,o)),e.compilerExtensions.forEach(d=>d(a,o)),a.__beforeBegin=null,[xJ,wJ,_J].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=Nj(a.keywords,e.case_insensitive)),c.keywordPatternRe=t(u,!0),o&&(a.begin||(a.begin=/\B|\b/),c.beginRe=t(c.begin),!a.end&&!a.endsWithParent&&(a.end=/\B|\b/),a.end&&(c.endRe=t(c.end)),c.terminatorEnd=Zd(c.end)||"",a.endsWithParent&&o.terminatorEnd&&(c.terminatorEnd+=(a.end?"|":"")+o.terminatorEnd)),a.illegal&&(c.illegalRe=t(a.illegal)),a.contains||(a.contains=[]),a.contains=[].concat(...a.contains.map(function(d){return MJ(d==="self"?a:d)})),a.contains.forEach(function(d){i(d,c)}),a.starts&&i(a.starts,o),c.matcher=s(c),c}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=Na(e.classNameAliases||{}),i(e)}function Tj(e){return e?e.endsWithParent||Tj(e.starts):!1}function MJ(e){return e.variants&&!e.cachedVariants&&(e.cachedVariants=e.variants.map(function(t){return Na(e,{variants:null},t)})),e.cachedVariants?e.cachedVariants:Tj(e)?Na(e,{starts:e.starts?Na(e.starts):null}):Object.isFrozen(e)?Na(e):e}var jJ="11.11.1";class DJ extends Error{constructor(t,n){super(t),this.name="HTMLInjectionError",this.html=n}}const By=bj,UT=Na,$T=Symbol("nomatch"),PJ=7,Aj=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:qZ};function c(T){return o.noHighlightRe.test(T)}function u(T){let L=T.className+" ";L+=T.parentNode?T.parentNode.className:"";const R=o.languageDetectRe.exec(L);if(R){const F=S(R[1]);return F||(FT(i.replace("{}",R[1])),FT("Falling back to no-highlight mode for this block.",T)),F?R[1]:"no-highlight"}return L.split(/\s+/).find(F=>c(F)||S(F))}function d(T,L,R){let F="",I="";typeof L=="object"?(F=T,R=L.ignoreIllegals,I=L.language):(fl("10.7.0","highlight(lang, code, ...args) has been deprecated."),fl("10.7.0",`Please use highlight(code, options) instead. -https://github.com/highlightjs/highlight.js/issues/2277`),I=T,F=L),R===void 0&&(R=!0);const V={code:F,language:I};M("before:highlight",V);const W=V.result?V.result:f(V.language,V.code,R);return W.code=V.code,M("after:highlight",W),W}function f(T,L,R,F){const I=Object.create(null);function V(B,Q){return B.keywords[Q]}function W(){if(!Ne.keywords){He.addText(Ue);return}let B=0;Ne.keywordPatternRe.lastIndex=0;let Q=Ne.keywordPatternRe.exec(Ue),oe="";for(;Q;){oe+=Ue.substring(B,Q.index);const be=Ee.case_insensitive?Q[0].toLowerCase():Q[0],Oe=V(Ne,be);if(Oe){const[Ye,tt]=Oe;if(He.addText(oe),oe="",I[be]=(I[be]||0)+1,I[be]<=PJ&&(Et+=tt),Ye.startsWith("_"))oe+=Q[0];else{const ze=Ee.classNameAliases[Ye]||Ye;G(Q[0],ze)}}else oe+=Q[0];B=Ne.keywordPatternRe.lastIndex,Q=Ne.keywordPatternRe.exec(Ue)}oe+=Ue.substring(B),He.addText(oe)}function P(){if(Ue==="")return;let B=null;if(typeof Ne.subLanguage=="string"){if(!t[Ne.subLanguage]){He.addText(Ue);return}B=f(Ne.subLanguage,Ue,!0,it[Ne.subLanguage]),it[Ne.subLanguage]=B._top}else B=p(Ue,Ne.subLanguage.length?Ne.subLanguage:null);Ne.relevance>0&&(Et+=B.relevance),He.__addSublanguage(B._emitter,B.language)}function ie(){Ne.subLanguage!=null?P():W(),Ue=""}function G(B,Q){B!==""&&(He.startScope(Q),He.addText(B),He.endScope())}function re(B,Q){let oe=1;const be=Q.length-1;for(;oe<=be;){if(!B._emit[oe]){oe++;continue}const Oe=Ee.classNameAliases[B[oe]]||B[oe],Ye=Q[oe];Oe?G(Ye,Oe):(Ue=Ye,W(),Ue=""),oe++}}function ue(B,Q){return B.scope&&typeof B.scope=="string"&&He.openNode(Ee.classNameAliases[B.scope]||B.scope),B.beginScope&&(B.beginScope._wrap?(G(Ue,Ee.classNameAliases[B.beginScope._wrap]||B.beginScope._wrap),Ue=""):B.beginScope._multi&&(re(B.beginScope,Q),Ue="")),Ne=Object.create(B,{parent:{value:Ne}}),Ne}function ee(B,Q,oe){let be=JZ(B.endRe,oe);if(be){if(B["on:end"]){const Oe=new jT(B);B["on:end"](Q,Oe),Oe.isMatchIgnored&&(be=!1)}if(be){for(;B.endsParent&&B.parent;)B=B.parent;return B}}if(B.endsWithParent)return ee(B.parent,Q,oe)}function le(B){return Ne.matcher.regexIndex===0?(Ue+=B[0],1):(ct=!0,0)}function ne(B){const Q=B[0],oe=B.rule,be=new jT(oe),Oe=[oe.__beforeBegin,oe["on:begin"]];for(const Ye of Oe)if(Ye&&(Ye(B,be),be.isMatchIgnored))return le(Q);return oe.skip?Ue+=Q:(oe.excludeBegin&&(Ue+=Q),ie(),!oe.returnBegin&&!oe.excludeBegin&&(Ue=Q)),ue(oe,B),oe.returnBegin?0:Q.length}function me(B){const Q=B[0],oe=L.substring(B.index),be=ee(Ne,B,oe);if(!be)return $T;const Oe=Ne;Ne.endScope&&Ne.endScope._wrap?(ie(),G(Q,Ne.endScope._wrap)):Ne.endScope&&Ne.endScope._multi?(ie(),re(Ne.endScope,B)):Oe.skip?Ue+=Q:(Oe.returnEnd||Oe.excludeEnd||(Ue+=Q),ie(),Oe.excludeEnd&&(Ue=Q));do Ne.scope&&He.closeNode(),!Ne.skip&&!Ne.subLanguage&&(Et+=Ne.relevance),Ne=Ne.parent;while(Ne!==be.parent);return be.starts&&ue(be.starts,B),Oe.returnEnd?0:Q.length}function ye(){const B=[];for(let Q=Ne;Q!==Ee;Q=Q.parent)Q.scope&&B.unshift(Q.scope);B.forEach(Q=>He.openNode(Q))}let te={};function de(B,Q){const oe=Q&&Q[0];if(Ue+=B,oe==null)return ie(),0;if(te.type==="begin"&&Q.type==="end"&&te.index===Q.index&&oe===""){if(Ue+=L.slice(Q.index,Q.index+1),!s){const be=new Error(`0 width match regex (${T})`);throw be.languageName=T,be.badRule=te.rule,be}return 1}if(te=Q,Q.type==="begin")return ne(Q);if(Q.type==="illegal"&&!R){const be=new Error('Illegal lexeme "'+oe+'" for mode "'+(Ne.scope||"")+'"');throw be.mode=Ne,be}else if(Q.type==="end"){const be=me(Q);if(be!==$T)return be}if(Q.type==="illegal"&&oe==="")return Ue+=` -`,1;if(St>1e5&&St>Q.index*3)throw new Error("potential infinite loop, way more iterations than matches");return Ue+=oe,oe.length}const Ee=S(T);if(!Ee)throw To(i.replace("{}",T)),new Error('Unknown language: "'+T+'"');const Te=LJ(Ee);let Ke="",Ne=F||Te;const it={},He=new o.__emitter(o);ye();let Ue="",Et=0,rt=0,St=0,ct=!1;try{if(Ee.__emitTokens)Ee.__emitTokens(L,He);else{for(Ne.matcher.considerAll();;){St++,ct?ct=!1:Ne.matcher.considerAll(),Ne.matcher.lastIndex=rt;const B=Ne.matcher.exec(L);if(!B)break;const Q=L.substring(rt,B.index),oe=de(Q,B);rt=B.index+oe}de(L.substring(rt))}return He.finalize(),Ke=He.toHTML(),{language:T,value:Ke,relevance:Et,illegal:!1,_emitter:He,_top:Ne}}catch(B){if(B.message&&B.message.includes("Illegal"))return{language:T,value:By(L),illegal:!0,relevance:0,_illegalBy:{message:B.message,index:rt,context:L.slice(rt-100,rt+100),mode:B.mode,resultSoFar:Ke},_emitter:He};if(s)return{language:T,value:By(L),illegal:!1,relevance:0,errorRaised:B,_emitter:He,_top:Ne};throw B}}function h(T){const L={value:By(T),illegal:!1,relevance:0,_top:a,_emitter:new o.__emitter(o)};return L._emitter.addText(T),L}function p(T,L){L=L||o.languages||Object.keys(t);const R=h(T),F=L.filter(S).filter(O).map(ie=>f(ie,T,!1));F.unshift(R);const I=F.sort((ie,G)=>{if(ie.relevance!==G.relevance)return G.relevance-ie.relevance;if(ie.language&&G.language){if(S(ie.language).supersetOf===G.language)return 1;if(S(G.language).supersetOf===ie.language)return-1}return 0}),[V,W]=I,P=V;return P.secondBest=W,P}function m(T,L,R){const F=L&&n[L]||R;T.classList.add("hljs"),T.classList.add(`language-${F}`)}function y(T){let L=null;const R=u(T);if(c(R))return;if(M("before:highlightElement",{el:T,language:R}),T.dataset.highlighted){console.log("Element previously highlighted. To highlight again, first unset `dataset.highlighted`.",T);return}if(T.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(T)),o.throwUnescapedHTML))throw new DJ("One of your code blocks includes unescaped HTML.",T.innerHTML);L=T;const F=L.textContent,I=R?d(F,{language:R,ignoreIllegals:!0}):p(F);T.innerHTML=I.value,T.dataset.highlighted="yes",m(T,R,I.language),T.result={language:I.language,re:I.relevance,relevance:I.relevance},I.secondBest&&(T.secondBest={language:I.secondBest.language,relevance:I.secondBest.relevance}),M("after:highlightElement",{el:T,result:I,text:F})}function E(T){o=UT(o,T)}const g=()=>{_(),fl("10.6.0","initHighlighting() deprecated. Use highlightAll() now.")};function x(){_(),fl("10.6.0","initHighlightingOnLoad() deprecated. Use highlightAll() now.")}let b=!1;function _(){function T(){_()}if(document.readyState==="loading"){b||window.addEventListener("DOMContentLoaded",T,!1),b=!0;return}document.querySelectorAll(o.cssSelector).forEach(y)}function k(T,L){let R=null;try{R=L(e)}catch(F){if(To("Language definition for '{}' could not be registered.".replace("{}",T)),s)To(F);else throw F;R=a}R.name||(R.name=T),t[T]=R,R.rawDefinition=L.bind(null,e),R.aliases&&A(R.aliases,{languageName:T})}function N(T){delete t[T];for(const L of Object.keys(n))n[L]===T&&delete n[L]}function C(){return Object.keys(t)}function S(T){return T=(T||"").toLowerCase(),t[T]||t[n[T]]}function A(T,{languageName:L}){typeof T=="string"&&(T=[T]),T.forEach(R=>{n[R.toLowerCase()]=L})}function O(T){const L=S(T);return L&&!L.disableAutodetect}function D(T){T["before:highlightBlock"]&&!T["before:highlightElement"]&&(T["before:highlightElement"]=L=>{T["before:highlightBlock"](Object.assign({block:L.el},L))}),T["after:highlightBlock"]&&!T["after:highlightElement"]&&(T["after:highlightElement"]=L=>{T["after:highlightBlock"](Object.assign({block:L.el},L))})}function U(T){D(T),r.push(T)}function X(T){const L=r.indexOf(T);L!==-1&&r.splice(L,1)}function M(T,L){const R=T;r.forEach(function(F){F[R]&&F[R](L)})}function j(T){return fl("10.7.0","highlightBlock will be removed entirely in v12.0"),fl("10.7.0","Please use highlightElement now."),y(T)}Object.assign(e,{highlight:d,highlightAuto:p,highlightAll:_,highlightElement:y,highlightBlock:j,configure:E,initHighlighting:g,initHighlightingOnLoad:x,registerLanguage:k,unregisterLanguage:N,listLanguages:C,getLanguage:S,registerAliases:A,autoDetection:O,inherit:UT,addPlugin:U,removePlugin:X}),e.debugMode=function(){s=!1},e.safeMode=function(){s=!0},e.versionString=jJ,e.regex={concat:Qo,lookahead:Ej,either:lv,optional:QZ,anyNumberOfTimes:XZ};for(const T in Hh)typeof Hh[T]=="object"&&yj(Hh[T]);return Object.assign(e,Hh),e},Sc=Aj({});Sc.newInstance=()=>Aj({});var BJ=Sc;Sc.HighlightJS=Sc;Sc.default=Sc;const Hr=pf(BJ),HT={},FJ="hljs-";function UJ(e){const t=Hr.newInstance();return e&&i(e),{highlight:n,highlightAuto:r,listLanguages:s,register:i,registerAlias:a,registered:o};function n(c,u,d){const f=d||HT,h=typeof f.prefix=="string"?f.prefix:FJ;if(!t.getLanguage(c))throw new Error("Unknown language: `"+c+"` is not registered");t.configure({__emitter:$J,classPrefix:h});const p=t.highlight(u,{ignoreIllegals:!0,language:c});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(c,u){const f=(u||HT).subset||s();let h=-1,p=0,m;for(;++hp&&(p=E.data.relevance,m=E)}return m||{type:"root",children:[],data:{language:void 0,relevance:p}}}function s(){return t.listLanguages()}function i(c,u){if(typeof c=="string")t.registerLanguage(c,u);else{let d;for(d in c)Object.hasOwn(c,d)&&t.registerLanguage(d,c[d])}}function a(c,u){if(typeof c=="string")t.registerAliases(typeof u=="string"?u:[...u],{languageName:c});else{let d;for(d in c)if(Object.hasOwn(c,d)){const f=c[d];t.registerAliases(typeof f=="string"?f:[...f],{languageName:d})}}}function o(c){return!!t.getLanguage(c)}}class $J{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 HJ={};function zT(e){const t=e||HJ,n=t.aliases,r=t.detect||!1,s=t.languages||KZ,i=t.plainText,a=t.prefix,o=t.subset;let c="hljs";const u=UJ(s);if(n&&u.registerAlias(n),a){const d=a.indexOf("-");c=d===-1?a:a.slice(0,d)}return function(d,f){If(d,"element",function(h,p,m){if(h.tagName!=="code"||!m||m.type!=="element"||m.tagName!=="pre")return;const y=zJ(h);if(y===!1||!y&&!r||y&&i&&i.includes(y))return;Array.isArray(h.properties.className)||(h.properties.className=[]),h.properties.className.includes(c)||h.properties.className.unshift(c);const E=SQ(h,{whitespace:"pre"});let g;try{g=y?u.highlight(y,E,{prefix:a}):u.highlightAuto(E,{prefix:a,subset:o})}catch(x){const b=x;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 zJ(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 c=YT(t,n[a-1]);o=c===-1?t.length+1:c+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 mee(e){return e>=56320&&e<=57343}function gee(e,t){return(e-55296)*1024+9216+t}function Mj(e){return e!==32&&e!==10&&e!==13&&e!==9&&e!==12&&e>=1&&e<=31||e>=127&&e<=159}function jj(e){return e>=64976&&e<=65007||pee.has(e)}var ce;(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"})(ce||(ce={}));const yee=65536;class bee{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=yee,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(mee(n))return this.pos++,this._addGap(),gee(t,n)}else if(!this.lastChunkWritten)return this.endOfChunkHit=!0,H.EOF;return this._err(ce.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,H.EOF;const r=this.html.charCodeAt(n);return r===H.CARRIAGE_RETURN?H.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,H.EOF;let t=this.html.charCodeAt(this.pos);return t===H.CARRIAGE_RETURN?(this.isEol=!0,this.skipNextNewLine=!0,H.LINE_FEED):t===H.LINE_FEED&&(this.isEol=!0,this.skipNextNewLine)?(this.line--,this.skipNextNewLine=!1,this._addGap(),this.advance()):(this.skipNextNewLine=!1,Lj(t)&&(t=this._processSurrogate(t)),this.handler.onParseError===null||t>31&&t<127||t===H.LINE_FEED||t===H.CARRIAGE_RETURN||t>159&&t<64976||this._checkForProblematicCharacters(t),t)}_checkForProblematicCharacters(t){Mj(t)?this._err(ce.controlCharacterInInputStream):jj(t)&&this._err(ce.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 Eee=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))),xee=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 wee(e){var t;return e>=55296&&e<=57343||e>1114111?65533:(t=xee.get(e))!==null&&t!==void 0?t:e}var Gn;(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"})(Gn||(Gn={}));const vee=32;var Sa;(function(e){e[e.VALUE_LENGTH=49152]="VALUE_LENGTH",e[e.BRANCH_LENGTH=16256]="BRANCH_LENGTH",e[e.JUMP_TABLE=127]="JUMP_TABLE"})(Sa||(Sa={}));function mE(e){return e>=Gn.ZERO&&e<=Gn.NINE}function _ee(e){return e>=Gn.UPPER_A&&e<=Gn.UPPER_F||e>=Gn.LOWER_A&&e<=Gn.LOWER_F}function kee(e){return e>=Gn.UPPER_A&&e<=Gn.UPPER_Z||e>=Gn.LOWER_A&&e<=Gn.LOWER_Z||mE(e)}function Nee(e){return e===Gn.EQUALS||kee(e)}var Yn;(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"})(Yn||(Yn={}));var Ui;(function(e){e[e.Legacy=0]="Legacy",e[e.Strict=1]="Strict",e[e.Attribute=2]="Attribute"})(Ui||(Ui={}));class See{constructor(t,n,r){this.decodeTree=t,this.emitCodePoint=n,this.errors=r,this.state=Yn.EntityStart,this.consumed=1,this.result=0,this.treeIndex=0,this.excess=1,this.decodeMode=Ui.Strict}startEntity(t){this.decodeMode=t,this.state=Yn.EntityStart,this.result=0,this.treeIndex=0,this.excess=1,this.consumed=1}write(t,n){switch(this.state){case Yn.EntityStart:return t.charCodeAt(n)===Gn.NUM?(this.state=Yn.NumericStart,this.consumed+=1,this.stateNumericStart(t,n+1)):(this.state=Yn.NamedEntity,this.stateNamedEntity(t,n));case Yn.NumericStart:return this.stateNumericStart(t,n);case Yn.NumericDecimal:return this.stateNumericDecimal(t,n);case Yn.NumericHex:return this.stateNumericHex(t,n);case Yn.NamedEntity:return this.stateNamedEntity(t,n)}}stateNumericStart(t,n){return n>=t.length?-1:(t.charCodeAt(n)|vee)===Gn.LOWER_X?(this.state=Yn.NumericHex,this.consumed+=1,this.stateNumericHex(t,n+1)):(this.state=Yn.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===Gn.SEMI)return this.emitNamedEntityData(this.treeIndex,i,this.consumed+this.excess);this.decodeMode!==Ui.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]&Sa.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]&~Sa.VALUE_LENGTH:s[t+1],r),n===3&&this.emitCodePoint(s[t+2],r),r}end(){var t;switch(this.state){case Yn.NamedEntity:return this.result!==0&&(this.decodeMode!==Ui.Attribute||this.result===this.treeIndex)?this.emitNotTerminatedNamedEntity():0;case Yn.NumericDecimal:return this.emitNumericEntity(0,2);case Yn.NumericHex:return this.emitNumericEntity(0,3);case Yn.NumericStart:return(t=this.errors)===null||t===void 0||t.absenceOfDigitsInNumericCharacterReference(this.consumed),0;case Yn.EntityStart:return 0}}}function Tee(e,t,n,r){const s=(t&Sa.BRANCH_LENGTH)>>7,i=t&Sa.JUMP_TABLE;if(s===0)return i!==0&&r===i?n:-1;if(i){const c=r-i;return c<0||c>=s?-1:e[n+c]-1}let a=n,o=a+s-1;for(;a<=o;){const c=a+o>>>1,u=e[c];if(ur)o=c-1;else return e[c+s]}return-1}var xe;(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/"})(xe||(xe={}));var Ao;(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"})(Ao||(Ao={}));var bs;(function(e){e.NO_QUIRKS="no-quirks",e.QUIRKS="quirks",e.LIMITED_QUIRKS="limited-quirks"})(bs||(bs={}));var se;(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"})(se||(se={}));var v;(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"})(v||(v={}));const Aee=new Map([[se.A,v.A],[se.ADDRESS,v.ADDRESS],[se.ANNOTATION_XML,v.ANNOTATION_XML],[se.APPLET,v.APPLET],[se.AREA,v.AREA],[se.ARTICLE,v.ARTICLE],[se.ASIDE,v.ASIDE],[se.B,v.B],[se.BASE,v.BASE],[se.BASEFONT,v.BASEFONT],[se.BGSOUND,v.BGSOUND],[se.BIG,v.BIG],[se.BLOCKQUOTE,v.BLOCKQUOTE],[se.BODY,v.BODY],[se.BR,v.BR],[se.BUTTON,v.BUTTON],[se.CAPTION,v.CAPTION],[se.CENTER,v.CENTER],[se.CODE,v.CODE],[se.COL,v.COL],[se.COLGROUP,v.COLGROUP],[se.DD,v.DD],[se.DESC,v.DESC],[se.DETAILS,v.DETAILS],[se.DIALOG,v.DIALOG],[se.DIR,v.DIR],[se.DIV,v.DIV],[se.DL,v.DL],[se.DT,v.DT],[se.EM,v.EM],[se.EMBED,v.EMBED],[se.FIELDSET,v.FIELDSET],[se.FIGCAPTION,v.FIGCAPTION],[se.FIGURE,v.FIGURE],[se.FONT,v.FONT],[se.FOOTER,v.FOOTER],[se.FOREIGN_OBJECT,v.FOREIGN_OBJECT],[se.FORM,v.FORM],[se.FRAME,v.FRAME],[se.FRAMESET,v.FRAMESET],[se.H1,v.H1],[se.H2,v.H2],[se.H3,v.H3],[se.H4,v.H4],[se.H5,v.H5],[se.H6,v.H6],[se.HEAD,v.HEAD],[se.HEADER,v.HEADER],[se.HGROUP,v.HGROUP],[se.HR,v.HR],[se.HTML,v.HTML],[se.I,v.I],[se.IMG,v.IMG],[se.IMAGE,v.IMAGE],[se.INPUT,v.INPUT],[se.IFRAME,v.IFRAME],[se.KEYGEN,v.KEYGEN],[se.LABEL,v.LABEL],[se.LI,v.LI],[se.LINK,v.LINK],[se.LISTING,v.LISTING],[se.MAIN,v.MAIN],[se.MALIGNMARK,v.MALIGNMARK],[se.MARQUEE,v.MARQUEE],[se.MATH,v.MATH],[se.MENU,v.MENU],[se.META,v.META],[se.MGLYPH,v.MGLYPH],[se.MI,v.MI],[se.MO,v.MO],[se.MN,v.MN],[se.MS,v.MS],[se.MTEXT,v.MTEXT],[se.NAV,v.NAV],[se.NOBR,v.NOBR],[se.NOFRAMES,v.NOFRAMES],[se.NOEMBED,v.NOEMBED],[se.NOSCRIPT,v.NOSCRIPT],[se.OBJECT,v.OBJECT],[se.OL,v.OL],[se.OPTGROUP,v.OPTGROUP],[se.OPTION,v.OPTION],[se.P,v.P],[se.PARAM,v.PARAM],[se.PLAINTEXT,v.PLAINTEXT],[se.PRE,v.PRE],[se.RB,v.RB],[se.RP,v.RP],[se.RT,v.RT],[se.RTC,v.RTC],[se.RUBY,v.RUBY],[se.S,v.S],[se.SCRIPT,v.SCRIPT],[se.SEARCH,v.SEARCH],[se.SECTION,v.SECTION],[se.SELECT,v.SELECT],[se.SOURCE,v.SOURCE],[se.SMALL,v.SMALL],[se.SPAN,v.SPAN],[se.STRIKE,v.STRIKE],[se.STRONG,v.STRONG],[se.STYLE,v.STYLE],[se.SUB,v.SUB],[se.SUMMARY,v.SUMMARY],[se.SUP,v.SUP],[se.TABLE,v.TABLE],[se.TBODY,v.TBODY],[se.TEMPLATE,v.TEMPLATE],[se.TEXTAREA,v.TEXTAREA],[se.TFOOT,v.TFOOT],[se.TD,v.TD],[se.TH,v.TH],[se.THEAD,v.THEAD],[se.TITLE,v.TITLE],[se.TR,v.TR],[se.TRACK,v.TRACK],[se.TT,v.TT],[se.U,v.U],[se.UL,v.UL],[se.SVG,v.SVG],[se.VAR,v.VAR],[se.WBR,v.WBR],[se.XMP,v.XMP]]);function Xc(e){var t;return(t=Aee.get(e))!==null&&t!==void 0?t:v.UNKNOWN}const ke=v,Cee={[xe.HTML]:new Set([ke.ADDRESS,ke.APPLET,ke.AREA,ke.ARTICLE,ke.ASIDE,ke.BASE,ke.BASEFONT,ke.BGSOUND,ke.BLOCKQUOTE,ke.BODY,ke.BR,ke.BUTTON,ke.CAPTION,ke.CENTER,ke.COL,ke.COLGROUP,ke.DD,ke.DETAILS,ke.DIR,ke.DIV,ke.DL,ke.DT,ke.EMBED,ke.FIELDSET,ke.FIGCAPTION,ke.FIGURE,ke.FOOTER,ke.FORM,ke.FRAME,ke.FRAMESET,ke.H1,ke.H2,ke.H3,ke.H4,ke.H5,ke.H6,ke.HEAD,ke.HEADER,ke.HGROUP,ke.HR,ke.HTML,ke.IFRAME,ke.IMG,ke.INPUT,ke.LI,ke.LINK,ke.LISTING,ke.MAIN,ke.MARQUEE,ke.MENU,ke.META,ke.NAV,ke.NOEMBED,ke.NOFRAMES,ke.NOSCRIPT,ke.OBJECT,ke.OL,ke.P,ke.PARAM,ke.PLAINTEXT,ke.PRE,ke.SCRIPT,ke.SECTION,ke.SELECT,ke.SOURCE,ke.STYLE,ke.SUMMARY,ke.TABLE,ke.TBODY,ke.TD,ke.TEMPLATE,ke.TEXTAREA,ke.TFOOT,ke.TH,ke.THEAD,ke.TITLE,ke.TR,ke.TRACK,ke.UL,ke.WBR,ke.XMP]),[xe.MATHML]:new Set([ke.MI,ke.MO,ke.MN,ke.MS,ke.MTEXT,ke.ANNOTATION_XML]),[xe.SVG]:new Set([ke.TITLE,ke.FOREIGN_OBJECT,ke.DESC]),[xe.XLINK]:new Set,[xe.XML]:new Set,[xe.XMLNS]:new Set},gE=new Set([ke.H1,ke.H2,ke.H3,ke.H4,ke.H5,ke.H6]);se.STYLE,se.SCRIPT,se.XMP,se.IFRAME,se.NOEMBED,se.NOFRAMES,se.PLAINTEXT;var z;(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"})(z||(z={}));const vn={DATA:z.DATA,RCDATA:z.RCDATA,RAWTEXT:z.RAWTEXT,SCRIPT_DATA:z.SCRIPT_DATA,PLAINTEXT:z.PLAINTEXT,CDATA_SECTION:z.CDATA_SECTION};function Iee(e){return e>=H.DIGIT_0&&e<=H.DIGIT_9}function Uu(e){return e>=H.LATIN_CAPITAL_A&&e<=H.LATIN_CAPITAL_Z}function Oee(e){return e>=H.LATIN_SMALL_A&&e<=H.LATIN_SMALL_Z}function pa(e){return Oee(e)||Uu(e)}function GT(e){return pa(e)||Iee(e)}function zh(e){return e+32}function Pj(e){return e===H.SPACE||e===H.LINE_FEED||e===H.TABULATION||e===H.FORM_FEED}function qT(e){return Pj(e)||e===H.SOLIDUS||e===H.GREATER_THAN_SIGN}function Ree(e){return e===H.NULL?ce.nullCharacterReference:e>1114111?ce.characterReferenceOutsideUnicodeRange:Lj(e)?ce.surrogateCharacterReference:jj(e)?ce.noncharacterCharacterReference:Mj(e)||e===H.CARRIAGE_RETURN?ce.controlCharacterReference:null}class Lee{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=z.DATA,this.returnState=z.DATA,this.entityStartPos=0,this.consumedAfterSnapshot=-1,this.currentCharacterToken=null,this.currentToken=null,this.currentAttr={name:"",value:""},this.preprocessor=new bee(n),this.currentLocation=this.getCurrentLocation(-1),this.entityDecoder=new See(Eee,(r,s)=>{this.preprocessor.pos=this.entityStartPos+s-1,this._flushCodePointConsumedAsCharacterReference(r)},n.onParseError?{missingSemicolonAfterCharacterReference:()=>{this._err(ce.missingSemicolonAfterCharacterReference,1)},absenceOfDigitsInNumericCharacterReference:r=>{this._err(ce.absenceOfDigitsInNumericCharacterReference,this.entityStartPos-this.preprocessor.pos+r)},validateNumericCharacterReference:r=>{const s=Ree(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(ce.endTagWithAttributes),t.selfClosing&&this._err(ce.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 mt.CHARACTER:{this.handler.onCharacter(this.currentCharacterToken);break}case mt.NULL_CHARACTER:{this.handler.onNullCharacter(this.currentCharacterToken);break}case mt.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:mt.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=Pj(t)?mt.WHITESPACE_CHARACTER:t===H.NULL?mt.NULL_CHARACTER:mt.CHARACTER;this._appendCharToCurrentCharacterToken(n,String.fromCodePoint(t))}_emitChars(t){this._appendCharToCurrentCharacterToken(mt.CHARACTER,t)}_startCharacterReference(){this.returnState=this.state,this.state=z.CHARACTER_REFERENCE,this.entityStartPos=this.preprocessor.pos,this.entityDecoder.startEntity(this._isCharacterReferenceInAttribute()?Ui.Attribute:Ui.Legacy)}_isCharacterReferenceInAttribute(){return this.returnState===z.ATTRIBUTE_VALUE_DOUBLE_QUOTED||this.returnState===z.ATTRIBUTE_VALUE_SINGLE_QUOTED||this.returnState===z.ATTRIBUTE_VALUE_UNQUOTED}_flushCodePointConsumedAsCharacterReference(t){this._isCharacterReferenceInAttribute()?this.currentAttr.value+=String.fromCodePoint(t):this._emitCodePoint(t)}_callState(t){switch(this.state){case z.DATA:{this._stateData(t);break}case z.RCDATA:{this._stateRcdata(t);break}case z.RAWTEXT:{this._stateRawtext(t);break}case z.SCRIPT_DATA:{this._stateScriptData(t);break}case z.PLAINTEXT:{this._statePlaintext(t);break}case z.TAG_OPEN:{this._stateTagOpen(t);break}case z.END_TAG_OPEN:{this._stateEndTagOpen(t);break}case z.TAG_NAME:{this._stateTagName(t);break}case z.RCDATA_LESS_THAN_SIGN:{this._stateRcdataLessThanSign(t);break}case z.RCDATA_END_TAG_OPEN:{this._stateRcdataEndTagOpen(t);break}case z.RCDATA_END_TAG_NAME:{this._stateRcdataEndTagName(t);break}case z.RAWTEXT_LESS_THAN_SIGN:{this._stateRawtextLessThanSign(t);break}case z.RAWTEXT_END_TAG_OPEN:{this._stateRawtextEndTagOpen(t);break}case z.RAWTEXT_END_TAG_NAME:{this._stateRawtextEndTagName(t);break}case z.SCRIPT_DATA_LESS_THAN_SIGN:{this._stateScriptDataLessThanSign(t);break}case z.SCRIPT_DATA_END_TAG_OPEN:{this._stateScriptDataEndTagOpen(t);break}case z.SCRIPT_DATA_END_TAG_NAME:{this._stateScriptDataEndTagName(t);break}case z.SCRIPT_DATA_ESCAPE_START:{this._stateScriptDataEscapeStart(t);break}case z.SCRIPT_DATA_ESCAPE_START_DASH:{this._stateScriptDataEscapeStartDash(t);break}case z.SCRIPT_DATA_ESCAPED:{this._stateScriptDataEscaped(t);break}case z.SCRIPT_DATA_ESCAPED_DASH:{this._stateScriptDataEscapedDash(t);break}case z.SCRIPT_DATA_ESCAPED_DASH_DASH:{this._stateScriptDataEscapedDashDash(t);break}case z.SCRIPT_DATA_ESCAPED_LESS_THAN_SIGN:{this._stateScriptDataEscapedLessThanSign(t);break}case z.SCRIPT_DATA_ESCAPED_END_TAG_OPEN:{this._stateScriptDataEscapedEndTagOpen(t);break}case z.SCRIPT_DATA_ESCAPED_END_TAG_NAME:{this._stateScriptDataEscapedEndTagName(t);break}case z.SCRIPT_DATA_DOUBLE_ESCAPE_START:{this._stateScriptDataDoubleEscapeStart(t);break}case z.SCRIPT_DATA_DOUBLE_ESCAPED:{this._stateScriptDataDoubleEscaped(t);break}case z.SCRIPT_DATA_DOUBLE_ESCAPED_DASH:{this._stateScriptDataDoubleEscapedDash(t);break}case z.SCRIPT_DATA_DOUBLE_ESCAPED_DASH_DASH:{this._stateScriptDataDoubleEscapedDashDash(t);break}case z.SCRIPT_DATA_DOUBLE_ESCAPED_LESS_THAN_SIGN:{this._stateScriptDataDoubleEscapedLessThanSign(t);break}case z.SCRIPT_DATA_DOUBLE_ESCAPE_END:{this._stateScriptDataDoubleEscapeEnd(t);break}case z.BEFORE_ATTRIBUTE_NAME:{this._stateBeforeAttributeName(t);break}case z.ATTRIBUTE_NAME:{this._stateAttributeName(t);break}case z.AFTER_ATTRIBUTE_NAME:{this._stateAfterAttributeName(t);break}case z.BEFORE_ATTRIBUTE_VALUE:{this._stateBeforeAttributeValue(t);break}case z.ATTRIBUTE_VALUE_DOUBLE_QUOTED:{this._stateAttributeValueDoubleQuoted(t);break}case z.ATTRIBUTE_VALUE_SINGLE_QUOTED:{this._stateAttributeValueSingleQuoted(t);break}case z.ATTRIBUTE_VALUE_UNQUOTED:{this._stateAttributeValueUnquoted(t);break}case z.AFTER_ATTRIBUTE_VALUE_QUOTED:{this._stateAfterAttributeValueQuoted(t);break}case z.SELF_CLOSING_START_TAG:{this._stateSelfClosingStartTag(t);break}case z.BOGUS_COMMENT:{this._stateBogusComment(t);break}case z.MARKUP_DECLARATION_OPEN:{this._stateMarkupDeclarationOpen(t);break}case z.COMMENT_START:{this._stateCommentStart(t);break}case z.COMMENT_START_DASH:{this._stateCommentStartDash(t);break}case z.COMMENT:{this._stateComment(t);break}case z.COMMENT_LESS_THAN_SIGN:{this._stateCommentLessThanSign(t);break}case z.COMMENT_LESS_THAN_SIGN_BANG:{this._stateCommentLessThanSignBang(t);break}case z.COMMENT_LESS_THAN_SIGN_BANG_DASH:{this._stateCommentLessThanSignBangDash(t);break}case z.COMMENT_LESS_THAN_SIGN_BANG_DASH_DASH:{this._stateCommentLessThanSignBangDashDash(t);break}case z.COMMENT_END_DASH:{this._stateCommentEndDash(t);break}case z.COMMENT_END:{this._stateCommentEnd(t);break}case z.COMMENT_END_BANG:{this._stateCommentEndBang(t);break}case z.DOCTYPE:{this._stateDoctype(t);break}case z.BEFORE_DOCTYPE_NAME:{this._stateBeforeDoctypeName(t);break}case z.DOCTYPE_NAME:{this._stateDoctypeName(t);break}case z.AFTER_DOCTYPE_NAME:{this._stateAfterDoctypeName(t);break}case z.AFTER_DOCTYPE_PUBLIC_KEYWORD:{this._stateAfterDoctypePublicKeyword(t);break}case z.BEFORE_DOCTYPE_PUBLIC_IDENTIFIER:{this._stateBeforeDoctypePublicIdentifier(t);break}case z.DOCTYPE_PUBLIC_IDENTIFIER_DOUBLE_QUOTED:{this._stateDoctypePublicIdentifierDoubleQuoted(t);break}case z.DOCTYPE_PUBLIC_IDENTIFIER_SINGLE_QUOTED:{this._stateDoctypePublicIdentifierSingleQuoted(t);break}case z.AFTER_DOCTYPE_PUBLIC_IDENTIFIER:{this._stateAfterDoctypePublicIdentifier(t);break}case z.BETWEEN_DOCTYPE_PUBLIC_AND_SYSTEM_IDENTIFIERS:{this._stateBetweenDoctypePublicAndSystemIdentifiers(t);break}case z.AFTER_DOCTYPE_SYSTEM_KEYWORD:{this._stateAfterDoctypeSystemKeyword(t);break}case z.BEFORE_DOCTYPE_SYSTEM_IDENTIFIER:{this._stateBeforeDoctypeSystemIdentifier(t);break}case z.DOCTYPE_SYSTEM_IDENTIFIER_DOUBLE_QUOTED:{this._stateDoctypeSystemIdentifierDoubleQuoted(t);break}case z.DOCTYPE_SYSTEM_IDENTIFIER_SINGLE_QUOTED:{this._stateDoctypeSystemIdentifierSingleQuoted(t);break}case z.AFTER_DOCTYPE_SYSTEM_IDENTIFIER:{this._stateAfterDoctypeSystemIdentifier(t);break}case z.BOGUS_DOCTYPE:{this._stateBogusDoctype(t);break}case z.CDATA_SECTION:{this._stateCdataSection(t);break}case z.CDATA_SECTION_BRACKET:{this._stateCdataSectionBracket(t);break}case z.CDATA_SECTION_END:{this._stateCdataSectionEnd(t);break}case z.CHARACTER_REFERENCE:{this._stateCharacterReference();break}case z.AMBIGUOUS_AMPERSAND:{this._stateAmbiguousAmpersand(t);break}default:throw new Error("Unknown state")}}_stateData(t){switch(t){case H.LESS_THAN_SIGN:{this.state=z.TAG_OPEN;break}case H.AMPERSAND:{this._startCharacterReference();break}case H.NULL:{this._err(ce.unexpectedNullCharacter),this._emitCodePoint(t);break}case H.EOF:{this._emitEOFToken();break}default:this._emitCodePoint(t)}}_stateRcdata(t){switch(t){case H.AMPERSAND:{this._startCharacterReference();break}case H.LESS_THAN_SIGN:{this.state=z.RCDATA_LESS_THAN_SIGN;break}case H.NULL:{this._err(ce.unexpectedNullCharacter),this._emitChars(Qt);break}case H.EOF:{this._emitEOFToken();break}default:this._emitCodePoint(t)}}_stateRawtext(t){switch(t){case H.LESS_THAN_SIGN:{this.state=z.RAWTEXT_LESS_THAN_SIGN;break}case H.NULL:{this._err(ce.unexpectedNullCharacter),this._emitChars(Qt);break}case H.EOF:{this._emitEOFToken();break}default:this._emitCodePoint(t)}}_stateScriptData(t){switch(t){case H.LESS_THAN_SIGN:{this.state=z.SCRIPT_DATA_LESS_THAN_SIGN;break}case H.NULL:{this._err(ce.unexpectedNullCharacter),this._emitChars(Qt);break}case H.EOF:{this._emitEOFToken();break}default:this._emitCodePoint(t)}}_statePlaintext(t){switch(t){case H.NULL:{this._err(ce.unexpectedNullCharacter),this._emitChars(Qt);break}case H.EOF:{this._emitEOFToken();break}default:this._emitCodePoint(t)}}_stateTagOpen(t){if(pa(t))this._createStartTagToken(),this.state=z.TAG_NAME,this._stateTagName(t);else switch(t){case H.EXCLAMATION_MARK:{this.state=z.MARKUP_DECLARATION_OPEN;break}case H.SOLIDUS:{this.state=z.END_TAG_OPEN;break}case H.QUESTION_MARK:{this._err(ce.unexpectedQuestionMarkInsteadOfTagName),this._createCommentToken(1),this.state=z.BOGUS_COMMENT,this._stateBogusComment(t);break}case H.EOF:{this._err(ce.eofBeforeTagName),this._emitChars("<"),this._emitEOFToken();break}default:this._err(ce.invalidFirstCharacterOfTagName),this._emitChars("<"),this.state=z.DATA,this._stateData(t)}}_stateEndTagOpen(t){if(pa(t))this._createEndTagToken(),this.state=z.TAG_NAME,this._stateTagName(t);else switch(t){case H.GREATER_THAN_SIGN:{this._err(ce.missingEndTagName),this.state=z.DATA;break}case H.EOF:{this._err(ce.eofBeforeTagName),this._emitChars("");break}case H.NULL:{this._err(ce.unexpectedNullCharacter),this.state=z.SCRIPT_DATA_ESCAPED,this._emitChars(Qt);break}case H.EOF:{this._err(ce.eofInScriptHtmlCommentLikeText),this._emitEOFToken();break}default:this.state=z.SCRIPT_DATA_ESCAPED,this._emitCodePoint(t)}}_stateScriptDataEscapedLessThanSign(t){t===H.SOLIDUS?this.state=z.SCRIPT_DATA_ESCAPED_END_TAG_OPEN:pa(t)?(this._emitChars("<"),this.state=z.SCRIPT_DATA_DOUBLE_ESCAPE_START,this._stateScriptDataDoubleEscapeStart(t)):(this._emitChars("<"),this.state=z.SCRIPT_DATA_ESCAPED,this._stateScriptDataEscaped(t))}_stateScriptDataEscapedEndTagOpen(t){pa(t)?(this.state=z.SCRIPT_DATA_ESCAPED_END_TAG_NAME,this._stateScriptDataEscapedEndTagName(t)):(this._emitChars("");break}case H.NULL:{this._err(ce.unexpectedNullCharacter),this.state=z.SCRIPT_DATA_DOUBLE_ESCAPED,this._emitChars(Qt);break}case H.EOF:{this._err(ce.eofInScriptHtmlCommentLikeText),this._emitEOFToken();break}default:this.state=z.SCRIPT_DATA_DOUBLE_ESCAPED,this._emitCodePoint(t)}}_stateScriptDataDoubleEscapedLessThanSign(t){t===H.SOLIDUS?(this.state=z.SCRIPT_DATA_DOUBLE_ESCAPE_END,this._emitChars("/")):(this.state=z.SCRIPT_DATA_DOUBLE_ESCAPED,this._stateScriptDataDoubleEscaped(t))}_stateScriptDataDoubleEscapeEnd(t){if(this.preprocessor.startsWith(Mr.SCRIPT,!1)&&qT(this.preprocessor.peek(Mr.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])!==xe.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(Bee,xe.HTML)}clearBackToTableBodyContext(){this.clearBackTo(Pee,xe.HTML)}clearBackToTableRowContext(){this.clearBackTo(Dee,xe.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]===v.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]===v.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 xe.HTML:{if(s===t)return!0;if(n.has(s))return!1;break}case xe.SVG:{if(ZT.has(s))return!1;break}case xe.MATHML:{if(QT.has(s))return!1;break}}}return!0}hasInScope(t){return this.hasInDynamicScope(t,Lm)}hasInListItemScope(t){return this.hasInDynamicScope(t,Mee)}hasInButtonScope(t){return this.hasInDynamicScope(t,jee)}hasNumberedHeaderInScope(){for(let t=this.stackTop;t>=0;t--){const n=this.tagIDs[t];switch(this.treeAdapter.getNamespaceURI(this.items[t])){case xe.HTML:{if(gE.has(n))return!0;if(Lm.has(n))return!1;break}case xe.SVG:{if(ZT.has(n))return!1;break}case xe.MATHML:{if(QT.has(n))return!1;break}}}return!0}hasInTableScope(t){for(let n=this.stackTop;n>=0;n--)if(this.treeAdapter.getNamespaceURI(this.items[n])===xe.HTML)switch(this.tagIDs[n]){case t:return!0;case v.TABLE:case v.HTML:return!1}return!0}hasTableBodyContextInTableScope(){for(let t=this.stackTop;t>=0;t--)if(this.treeAdapter.getNamespaceURI(this.items[t])===xe.HTML)switch(this.tagIDs[t]){case v.TBODY:case v.THEAD:case v.TFOOT:return!0;case v.TABLE:case v.HTML:return!1}return!0}hasInSelectScope(t){for(let n=this.stackTop;n>=0;n--)if(this.treeAdapter.getNamespaceURI(this.items[n])===xe.HTML)switch(this.tagIDs[n]){case t:return!0;case v.OPTION:case v.OPTGROUP:break;default:return!1}return!0}generateImpliedEndTags(){for(;this.currentTagId!==void 0&&Bj.has(this.currentTagId);)this.pop()}generateImpliedEndTagsThoroughly(){for(;this.currentTagId!==void 0&&XT.has(this.currentTagId);)this.pop()}generateImpliedEndTagsWithExclusion(t){for(;this.currentTagId!==void 0&&this.currentTagId!==t&&XT.has(this.currentTagId);)this.pop()}}const Fy=3;var di;(function(e){e[e.Marker=0]="Marker",e[e.Element=1]="Element"})(di||(di={}));const JT={type:di.Marker};class $ee{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(c.name)===c.value)&&(i+=1,i>=Fy&&this.entries.splice(o.idx,1))}}insertMarker(){this.entries.unshift(JT)}pushElement(t,n){this._ensureNoahArkCondition(t),this.entries.unshift({type:di.Element,element:t,token:n})}insertElementAfterBookmark(t,n){const r=this.entries.indexOf(this.bookmark);this.entries.splice(r,0,{type:di.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(JT);t===-1?this.entries.length=0:this.entries.splice(0,t+1)}getElementEntryInScopeWithTagName(t){const n=this.entries.find(r=>r.type===di.Marker||this.treeAdapter.getTagName(r.element)===t);return n&&n.type===di.Element?n:null}getElementEntry(t){return this.entries.find(n=>n.type===di.Element&&n.element===t)}}const ma={createDocument(){return{nodeName:"#document",mode:bs.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};ma.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(ma.isTextNode(n)){n.value+=t;return}}ma.appendChild(e,ma.createTextNode(t))},insertTextBefore(e,t,n){const r=e.childNodes[e.childNodes.indexOf(n)-1];r&&ma.isTextNode(r)?r.value+=t:ma.insertBefore(e,ma.createTextNode(t),n)},adoptAttributes(e,t){const n=new Set(e.attrs.map(r=>r.name));for(let r=0;re.startsWith(n))}function Wee(e){return e.name===Fj&&e.publicId===null&&(e.systemId===null||e.systemId===Hee)}function Gee(e){if(e.name!==Fj)return bs.QUIRKS;const{systemId:t}=e;if(t&&t.toLowerCase()===zee)return bs.QUIRKS;let{publicId:n}=e;if(n!==null){if(n=n.toLowerCase(),Kee.has(n))return bs.QUIRKS;let r=t===null?Vee:Uj;if(e2(n,r))return bs.QUIRKS;if(r=t===null?$j:Yee,e2(n,r))return bs.LIMITED_QUIRKS}return bs.NO_QUIRKS}const t2={TEXT_HTML:"text/html",APPLICATION_XML:"application/xhtml+xml"},qee="definitionurl",Xee="definitionURL",Qee=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])),Zee=new Map([["xlink:actuate",{prefix:"xlink",name:"actuate",namespace:xe.XLINK}],["xlink:arcrole",{prefix:"xlink",name:"arcrole",namespace:xe.XLINK}],["xlink:href",{prefix:"xlink",name:"href",namespace:xe.XLINK}],["xlink:role",{prefix:"xlink",name:"role",namespace:xe.XLINK}],["xlink:show",{prefix:"xlink",name:"show",namespace:xe.XLINK}],["xlink:title",{prefix:"xlink",name:"title",namespace:xe.XLINK}],["xlink:type",{prefix:"xlink",name:"type",namespace:xe.XLINK}],["xml:lang",{prefix:"xml",name:"lang",namespace:xe.XML}],["xml:space",{prefix:"xml",name:"space",namespace:xe.XML}],["xmlns",{prefix:"",name:"xmlns",namespace:xe.XMLNS}],["xmlns:xlink",{prefix:"xmlns",name:"xlink",namespace:xe.XMLNS}]]),Jee=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])),ete=new Set([v.B,v.BIG,v.BLOCKQUOTE,v.BODY,v.BR,v.CENTER,v.CODE,v.DD,v.DIV,v.DL,v.DT,v.EM,v.EMBED,v.H1,v.H2,v.H3,v.H4,v.H5,v.H6,v.HEAD,v.HR,v.I,v.IMG,v.LI,v.LISTING,v.MENU,v.META,v.NOBR,v.OL,v.P,v.PRE,v.RUBY,v.S,v.SMALL,v.SPAN,v.STRONG,v.STRIKE,v.SUB,v.SUP,v.TABLE,v.TT,v.U,v.UL,v.VAR]);function tte(e){const t=e.tagID;return t===v.FONT&&e.attrs.some(({name:r})=>r===Ao.COLOR||r===Ao.SIZE||r===Ao.FACE)||ete.has(t)}function Hj(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)===xe.HTML;this.currentNotInHTML=!r,this.tokenizer.inForeignNode=!r&&t!==void 0&&n!==void 0&&!this._isIntegrationPoint(n,t)}_switchToTextParsing(t,n){this._insertElement(t,xe.HTML),this.tokenizer.state=n,this.originalInsertionMode=this.insertionMode,this.insertionMode=Y.TEXT}switchToPlaintextParsing(){this.insertionMode=Y.TEXT,this.originalInsertionMode=Y.IN_BODY,this.tokenizer.state=vn.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)===se.FORM){this.formElement=t;break}t=this.treeAdapter.getParentNode(t)}}_initTokenizerForFragmentParsing(){if(!(!this.fragmentContext||this.treeAdapter.getNamespaceURI(this.fragmentContext)!==xe.HTML))switch(this.fragmentContextID){case v.TITLE:case v.TEXTAREA:{this.tokenizer.state=vn.RCDATA;break}case v.STYLE:case v.XMP:case v.IFRAME:case v.NOEMBED:case v.NOFRAMES:case v.NOSCRIPT:{this.tokenizer.state=vn.RAWTEXT;break}case v.SCRIPT:{this.tokenizer.state=vn.SCRIPT_DATA;break}case v.PLAINTEXT:{this.tokenizer.state=vn.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,xe.HTML,[]);this._attachElementToTree(r,null),this.openElements.push(r,n)}_insertTemplate(t){const n=this.treeAdapter.createElement(t.tagName,xe.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(se.HTML,xe.HTML,[]);this.options.sourceCodeLocationInfo&&this.treeAdapter.setNodeSourceCodeLocation(t,null),this.treeAdapter.appendChild(this.openElements.current,t),this.openElements.push(t,v.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:c,endCol:u,endOffset:d}=t.location;this.treeAdapter.updateNodeSourceCodeLocation(a,{endLine:c,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===mt.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===v.SVG&&this.treeAdapter.getTagName(n)===se.ANNOTATION_XML&&this.treeAdapter.getNamespaceURI(n)===xe.MATHML?!1:this.tokenizer.inForeignNode||(t.tagID===v.MGLYPH||t.tagID===v.MALIGNMARK)&&r!==void 0&&!this._isIntegrationPoint(r,n,xe.HTML)}_processToken(t){switch(t.type){case mt.CHARACTER:{this.onCharacter(t);break}case mt.NULL_CHARACTER:{this.onNullCharacter(t);break}case mt.COMMENT:{this.onComment(t);break}case mt.DOCTYPE:{this.onDoctype(t);break}case mt.START_TAG:{this._processStartTag(t);break}case mt.END_TAG:{this.onEndTag(t);break}case mt.EOF:{this.onEof(t);break}case mt.WHITESPACE_CHARACTER:{this.onWhitespaceCharacter(t);break}}}_isIntegrationPoint(t,n,r){const s=this.treeAdapter.getNamespaceURI(n),i=this.treeAdapter.getAttrList(n);return ite(t,s,i,r)}_reconstructActiveFormattingElements(){const t=this.activeFormattingElements.entries.length;if(t){const n=this.activeFormattingElements.entries.findIndex(s=>s.type===di.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=Y.IN_ROW}_closePElement(){this.openElements.generateImpliedEndTagsWithExclusion(v.P),this.openElements.popUntilTagNamePopped(v.P)}_resetInsertionMode(){for(let t=this.openElements.stackTop;t>=0;t--)switch(t===0&&this.fragmentContext?this.fragmentContextID:this.openElements.tagIDs[t]){case v.TR:{this.insertionMode=Y.IN_ROW;return}case v.TBODY:case v.THEAD:case v.TFOOT:{this.insertionMode=Y.IN_TABLE_BODY;return}case v.CAPTION:{this.insertionMode=Y.IN_CAPTION;return}case v.COLGROUP:{this.insertionMode=Y.IN_COLUMN_GROUP;return}case v.TABLE:{this.insertionMode=Y.IN_TABLE;return}case v.BODY:{this.insertionMode=Y.IN_BODY;return}case v.FRAMESET:{this.insertionMode=Y.IN_FRAMESET;return}case v.SELECT:{this._resetInsertionModeForSelect(t);return}case v.TEMPLATE:{this.insertionMode=this.tmplInsertionModeStack[0];return}case v.HTML:{this.insertionMode=this.headElement?Y.AFTER_HEAD:Y.BEFORE_HEAD;return}case v.TD:case v.TH:{if(t>0){this.insertionMode=Y.IN_CELL;return}break}case v.HEAD:{if(t>0){this.insertionMode=Y.IN_HEAD;return}break}}this.insertionMode=Y.IN_BODY}_resetInsertionModeForSelect(t){if(t>0)for(let n=t-1;n>0;n--){const r=this.openElements.tagIDs[n];if(r===v.TEMPLATE)break;if(r===v.TABLE){this.insertionMode=Y.IN_SELECT_IN_TABLE;return}}this.insertionMode=Y.IN_SELECT}_isElementCausesFosterParenting(t){return Vj.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 v.TEMPLATE:{if(this.treeAdapter.getNamespaceURI(n)===xe.HTML)return{parent:this.treeAdapter.getTemplateContent(n),beforeElement:null};break}case v.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 Cee[r].has(n)}onCharacter(t){if(this.skipNextNewLine=!1,this.tokenizer.inForeignNode){Fne(this,t);return}switch(this.insertionMode){case Y.INITIAL:{vu(this,t);break}case Y.BEFORE_HTML:{fd(this,t);break}case Y.BEFORE_HEAD:{hd(this,t);break}case Y.IN_HEAD:{pd(this,t);break}case Y.IN_HEAD_NO_SCRIPT:{md(this,t);break}case Y.AFTER_HEAD:{gd(this,t);break}case Y.IN_BODY:case Y.IN_CAPTION:case Y.IN_CELL:case Y.IN_TEMPLATE:{Yj(this,t);break}case Y.TEXT:case Y.IN_SELECT:case Y.IN_SELECT_IN_TABLE:{this._insertCharacters(t);break}case Y.IN_TABLE:case Y.IN_TABLE_BODY:case Y.IN_ROW:{Uy(this,t);break}case Y.IN_TABLE_TEXT:{Zj(this,t);break}case Y.IN_COLUMN_GROUP:{Mm(this,t);break}case Y.AFTER_BODY:{jm(this,t);break}case Y.AFTER_AFTER_BODY:{Ip(this,t);break}}}onNullCharacter(t){if(this.skipNextNewLine=!1,this.tokenizer.inForeignNode){Bne(this,t);return}switch(this.insertionMode){case Y.INITIAL:{vu(this,t);break}case Y.BEFORE_HTML:{fd(this,t);break}case Y.BEFORE_HEAD:{hd(this,t);break}case Y.IN_HEAD:{pd(this,t);break}case Y.IN_HEAD_NO_SCRIPT:{md(this,t);break}case Y.AFTER_HEAD:{gd(this,t);break}case Y.TEXT:{this._insertCharacters(t);break}case Y.IN_TABLE:case Y.IN_TABLE_BODY:case Y.IN_ROW:{Uy(this,t);break}case Y.IN_COLUMN_GROUP:{Mm(this,t);break}case Y.AFTER_BODY:{jm(this,t);break}case Y.AFTER_AFTER_BODY:{Ip(this,t);break}}}onComment(t){if(this.skipNextNewLine=!1,this.currentNotInHTML){yE(this,t);return}switch(this.insertionMode){case Y.INITIAL:case Y.BEFORE_HTML:case Y.BEFORE_HEAD:case Y.IN_HEAD:case Y.IN_HEAD_NO_SCRIPT:case Y.AFTER_HEAD:case Y.IN_BODY:case Y.IN_TABLE:case Y.IN_CAPTION:case Y.IN_COLUMN_GROUP:case Y.IN_TABLE_BODY:case Y.IN_ROW:case Y.IN_CELL:case Y.IN_SELECT:case Y.IN_SELECT_IN_TABLE:case Y.IN_TEMPLATE:case Y.IN_FRAMESET:case Y.AFTER_FRAMESET:{yE(this,t);break}case Y.IN_TABLE_TEXT:{_u(this,t);break}case Y.AFTER_BODY:{gte(this,t);break}case Y.AFTER_AFTER_BODY:case Y.AFTER_AFTER_FRAMESET:{yte(this,t);break}}}onDoctype(t){switch(this.skipNextNewLine=!1,this.insertionMode){case Y.INITIAL:{bte(this,t);break}case Y.BEFORE_HEAD:case Y.IN_HEAD:case Y.IN_HEAD_NO_SCRIPT:case Y.AFTER_HEAD:{this._err(t,ce.misplacedDoctype);break}case Y.IN_TABLE_TEXT:{_u(this,t);break}}}onStartTag(t){this.skipNextNewLine=!1,this.currentToken=t,this._processStartTag(t),t.selfClosing&&!t.ackSelfClosing&&this._err(t,ce.nonVoidHtmlElementStartTagWithTrailingSolidus)}_processStartTag(t){this.shouldProcessStartTagTokenInForeignContent(t)?Une(this,t):this._startTagOutsideForeignContent(t)}_startTagOutsideForeignContent(t){switch(this.insertionMode){case Y.INITIAL:{vu(this,t);break}case Y.BEFORE_HTML:{Ete(this,t);break}case Y.BEFORE_HEAD:{wte(this,t);break}case Y.IN_HEAD:{ei(this,t);break}case Y.IN_HEAD_NO_SCRIPT:{kte(this,t);break}case Y.AFTER_HEAD:{Ste(this,t);break}case Y.IN_BODY:{br(this,t);break}case Y.IN_TABLE:{Tc(this,t);break}case Y.IN_TABLE_TEXT:{_u(this,t);break}case Y.IN_CAPTION:{vne(this,t);break}case Y.IN_COLUMN_GROUP:{gv(this,t);break}case Y.IN_TABLE_BODY:{Vg(this,t);break}case Y.IN_ROW:{Kg(this,t);break}case Y.IN_CELL:{Nne(this,t);break}case Y.IN_SELECT:{tD(this,t);break}case Y.IN_SELECT_IN_TABLE:{Tne(this,t);break}case Y.IN_TEMPLATE:{Cne(this,t);break}case Y.AFTER_BODY:{One(this,t);break}case Y.IN_FRAMESET:{Rne(this,t);break}case Y.AFTER_FRAMESET:{Mne(this,t);break}case Y.AFTER_AFTER_BODY:{Dne(this,t);break}case Y.AFTER_AFTER_FRAMESET:{Pne(this,t);break}}}onEndTag(t){this.skipNextNewLine=!1,this.currentToken=t,this.currentNotInHTML?$ne(this,t):this._endTagOutsideForeignContent(t)}_endTagOutsideForeignContent(t){switch(this.insertionMode){case Y.INITIAL:{vu(this,t);break}case Y.BEFORE_HTML:{xte(this,t);break}case Y.BEFORE_HEAD:{vte(this,t);break}case Y.IN_HEAD:{_te(this,t);break}case Y.IN_HEAD_NO_SCRIPT:{Nte(this,t);break}case Y.AFTER_HEAD:{Tte(this,t);break}case Y.IN_BODY:{zg(this,t);break}case Y.TEXT:{fne(this,t);break}case Y.IN_TABLE:{ef(this,t);break}case Y.IN_TABLE_TEXT:{_u(this,t);break}case Y.IN_CAPTION:{_ne(this,t);break}case Y.IN_COLUMN_GROUP:{kne(this,t);break}case Y.IN_TABLE_BODY:{bE(this,t);break}case Y.IN_ROW:{eD(this,t);break}case Y.IN_CELL:{Sne(this,t);break}case Y.IN_SELECT:{nD(this,t);break}case Y.IN_SELECT_IN_TABLE:{Ane(this,t);break}case Y.IN_TEMPLATE:{Ine(this,t);break}case Y.AFTER_BODY:{sD(this,t);break}case Y.IN_FRAMESET:{Lne(this,t);break}case Y.AFTER_FRAMESET:{jne(this,t);break}case Y.AFTER_AFTER_BODY:{Ip(this,t);break}}}onEof(t){switch(this.insertionMode){case Y.INITIAL:{vu(this,t);break}case Y.BEFORE_HTML:{fd(this,t);break}case Y.BEFORE_HEAD:{hd(this,t);break}case Y.IN_HEAD:{pd(this,t);break}case Y.IN_HEAD_NO_SCRIPT:{md(this,t);break}case Y.AFTER_HEAD:{gd(this,t);break}case Y.IN_BODY:case Y.IN_TABLE:case Y.IN_CAPTION:case Y.IN_COLUMN_GROUP:case Y.IN_TABLE_BODY:case Y.IN_ROW:case Y.IN_CELL:case Y.IN_SELECT:case Y.IN_SELECT_IN_TABLE:{Xj(this,t);break}case Y.TEXT:{hne(this,t);break}case Y.IN_TABLE_TEXT:{_u(this,t);break}case Y.IN_TEMPLATE:{rD(this,t);break}case Y.AFTER_BODY:case Y.IN_FRAMESET:case Y.AFTER_FRAMESET:case Y.AFTER_AFTER_BODY:case Y.AFTER_AFTER_FRAMESET:{mv(this,t);break}}}onWhitespaceCharacter(t){if(this.skipNextNewLine&&(this.skipNextNewLine=!1,t.chars.charCodeAt(0)===H.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 Y.IN_HEAD:case Y.IN_HEAD_NO_SCRIPT:case Y.AFTER_HEAD:case Y.TEXT:case Y.IN_COLUMN_GROUP:case Y.IN_SELECT:case Y.IN_SELECT_IN_TABLE:case Y.IN_FRAMESET:case Y.AFTER_FRAMESET:{this._insertCharacters(t);break}case Y.IN_BODY:case Y.IN_CAPTION:case Y.IN_CELL:case Y.IN_TEMPLATE:case Y.AFTER_BODY:case Y.AFTER_AFTER_BODY:case Y.AFTER_AFTER_FRAMESET:{Kj(this,t);break}case Y.IN_TABLE:case Y.IN_TABLE_BODY:case Y.IN_ROW:{Uy(this,t);break}case Y.IN_TABLE_TEXT:{Qj(this,t);break}}}};function ute(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):qj(e,t),n}function dte(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 fte(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),c=o&&i>=lte;!o||c?(c&&e.activeFormattingElements.removeEntry(o),e.openElements.remove(a)):(a=hte(e,o),r===t&&(e.activeFormattingElements.bookmark=o),e.treeAdapter.detachNode(r),e.treeAdapter.appendChild(a,r),r=a)}return r}function hte(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 pte(e,t,n){const r=e.treeAdapter.getTagName(t),s=Xc(r);if(e._isElementCausesFosterParenting(s))e._fosterParentElement(n);else{const i=e.treeAdapter.getNamespaceURI(t);s===v.TEMPLATE&&i===xe.HTML&&(t=e.treeAdapter.getTemplateContent(t)),e.treeAdapter.appendChild(t,n)}}function mte(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 pv(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 bte(e,t){e._setDocumentType(t);const n=t.forceQuirks?bs.QUIRKS:Gee(t);Wee(t)||e._err(t,ce.nonConformingDoctype),e.treeAdapter.setDocumentMode(e.document,n),e.insertionMode=Y.BEFORE_HTML}function vu(e,t){e._err(t,ce.missingDoctype,!0),e.treeAdapter.setDocumentMode(e.document,bs.QUIRKS),e.insertionMode=Y.BEFORE_HTML,e._processToken(t)}function Ete(e,t){t.tagID===v.HTML?(e._insertElement(t,xe.HTML),e.insertionMode=Y.BEFORE_HEAD):fd(e,t)}function xte(e,t){const n=t.tagID;(n===v.HTML||n===v.HEAD||n===v.BODY||n===v.BR)&&fd(e,t)}function fd(e,t){e._insertFakeRootElement(),e.insertionMode=Y.BEFORE_HEAD,e._processToken(t)}function wte(e,t){switch(t.tagID){case v.HTML:{br(e,t);break}case v.HEAD:{e._insertElement(t,xe.HTML),e.headElement=e.openElements.current,e.insertionMode=Y.IN_HEAD;break}default:hd(e,t)}}function vte(e,t){const n=t.tagID;n===v.HEAD||n===v.BODY||n===v.HTML||n===v.BR?hd(e,t):e._err(t,ce.endTagWithoutMatchingOpenElement)}function hd(e,t){e._insertFakeElement(se.HEAD,v.HEAD),e.headElement=e.openElements.current,e.insertionMode=Y.IN_HEAD,e._processToken(t)}function ei(e,t){switch(t.tagID){case v.HTML:{br(e,t);break}case v.BASE:case v.BASEFONT:case v.BGSOUND:case v.LINK:case v.META:{e._appendElement(t,xe.HTML),t.ackSelfClosing=!0;break}case v.TITLE:{e._switchToTextParsing(t,vn.RCDATA);break}case v.NOSCRIPT:{e.options.scriptingEnabled?e._switchToTextParsing(t,vn.RAWTEXT):(e._insertElement(t,xe.HTML),e.insertionMode=Y.IN_HEAD_NO_SCRIPT);break}case v.NOFRAMES:case v.STYLE:{e._switchToTextParsing(t,vn.RAWTEXT);break}case v.SCRIPT:{e._switchToTextParsing(t,vn.SCRIPT_DATA);break}case v.TEMPLATE:{e._insertTemplate(t),e.activeFormattingElements.insertMarker(),e.framesetOk=!1,e.insertionMode=Y.IN_TEMPLATE,e.tmplInsertionModeStack.unshift(Y.IN_TEMPLATE);break}case v.HEAD:{e._err(t,ce.misplacedStartTagForHeadElement);break}default:pd(e,t)}}function _te(e,t){switch(t.tagID){case v.HEAD:{e.openElements.pop(),e.insertionMode=Y.AFTER_HEAD;break}case v.BODY:case v.BR:case v.HTML:{pd(e,t);break}case v.TEMPLATE:{Zo(e,t);break}default:e._err(t,ce.endTagWithoutMatchingOpenElement)}}function Zo(e,t){e.openElements.tmplCount>0?(e.openElements.generateImpliedEndTagsThoroughly(),e.openElements.currentTagId!==v.TEMPLATE&&e._err(t,ce.closingOfElementWithOpenChildElements),e.openElements.popUntilTagNamePopped(v.TEMPLATE),e.activeFormattingElements.clearToLastMarker(),e.tmplInsertionModeStack.shift(),e._resetInsertionMode()):e._err(t,ce.endTagWithoutMatchingOpenElement)}function pd(e,t){e.openElements.pop(),e.insertionMode=Y.AFTER_HEAD,e._processToken(t)}function kte(e,t){switch(t.tagID){case v.HTML:{br(e,t);break}case v.BASEFONT:case v.BGSOUND:case v.HEAD:case v.LINK:case v.META:case v.NOFRAMES:case v.STYLE:{ei(e,t);break}case v.NOSCRIPT:{e._err(t,ce.nestedNoscriptInHead);break}default:md(e,t)}}function Nte(e,t){switch(t.tagID){case v.NOSCRIPT:{e.openElements.pop(),e.insertionMode=Y.IN_HEAD;break}case v.BR:{md(e,t);break}default:e._err(t,ce.endTagWithoutMatchingOpenElement)}}function md(e,t){const n=t.type===mt.EOF?ce.openElementsLeftAfterEof:ce.disallowedContentInNoscriptInHead;e._err(t,n),e.openElements.pop(),e.insertionMode=Y.IN_HEAD,e._processToken(t)}function Ste(e,t){switch(t.tagID){case v.HTML:{br(e,t);break}case v.BODY:{e._insertElement(t,xe.HTML),e.framesetOk=!1,e.insertionMode=Y.IN_BODY;break}case v.FRAMESET:{e._insertElement(t,xe.HTML),e.insertionMode=Y.IN_FRAMESET;break}case v.BASE:case v.BASEFONT:case v.BGSOUND:case v.LINK:case v.META:case v.NOFRAMES:case v.SCRIPT:case v.STYLE:case v.TEMPLATE:case v.TITLE:{e._err(t,ce.abandonedHeadElementChild),e.openElements.push(e.headElement,v.HEAD),ei(e,t),e.openElements.remove(e.headElement);break}case v.HEAD:{e._err(t,ce.misplacedStartTagForHeadElement);break}default:gd(e,t)}}function Tte(e,t){switch(t.tagID){case v.BODY:case v.HTML:case v.BR:{gd(e,t);break}case v.TEMPLATE:{Zo(e,t);break}default:e._err(t,ce.endTagWithoutMatchingOpenElement)}}function gd(e,t){e._insertFakeElement(se.BODY,v.BODY),e.insertionMode=Y.IN_BODY,Hg(e,t)}function Hg(e,t){switch(t.type){case mt.CHARACTER:{Yj(e,t);break}case mt.WHITESPACE_CHARACTER:{Kj(e,t);break}case mt.COMMENT:{yE(e,t);break}case mt.START_TAG:{br(e,t);break}case mt.END_TAG:{zg(e,t);break}case mt.EOF:{Xj(e,t);break}}}function Kj(e,t){e._reconstructActiveFormattingElements(),e._insertCharacters(t)}function Yj(e,t){e._reconstructActiveFormattingElements(),e._insertCharacters(t),e.framesetOk=!1}function Ate(e,t){e.openElements.tmplCount===0&&e.treeAdapter.adoptAttributes(e.openElements.items[0],t.attrs)}function Cte(e,t){const n=e.openElements.tryPeekProperlyNestedBodyElement();n&&e.openElements.tmplCount===0&&(e.framesetOk=!1,e.treeAdapter.adoptAttributes(n,t.attrs))}function Ite(e,t){const n=e.openElements.tryPeekProperlyNestedBodyElement();e.framesetOk&&n&&(e.treeAdapter.detachNode(n),e.openElements.popAllUpToHtmlElement(),e._insertElement(t,xe.HTML),e.insertionMode=Y.IN_FRAMESET)}function Ote(e,t){e.openElements.hasInButtonScope(v.P)&&e._closePElement(),e._insertElement(t,xe.HTML)}function Rte(e,t){e.openElements.hasInButtonScope(v.P)&&e._closePElement(),e.openElements.currentTagId!==void 0&&gE.has(e.openElements.currentTagId)&&e.openElements.pop(),e._insertElement(t,xe.HTML)}function Lte(e,t){e.openElements.hasInButtonScope(v.P)&&e._closePElement(),e._insertElement(t,xe.HTML),e.skipNextNewLine=!0,e.framesetOk=!1}function Mte(e,t){const n=e.openElements.tmplCount>0;(!e.formElement||n)&&(e.openElements.hasInButtonScope(v.P)&&e._closePElement(),e._insertElement(t,xe.HTML),n||(e.formElement=e.openElements.current))}function jte(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===v.LI&&s===v.LI||(n===v.DD||n===v.DT)&&(s===v.DD||s===v.DT)){e.openElements.generateImpliedEndTagsWithExclusion(s),e.openElements.popUntilTagNamePopped(s);break}if(s!==v.ADDRESS&&s!==v.DIV&&s!==v.P&&e._isSpecialElement(e.openElements.items[r],s))break}e.openElements.hasInButtonScope(v.P)&&e._closePElement(),e._insertElement(t,xe.HTML)}function Dte(e,t){e.openElements.hasInButtonScope(v.P)&&e._closePElement(),e._insertElement(t,xe.HTML),e.tokenizer.state=vn.PLAINTEXT}function Pte(e,t){e.openElements.hasInScope(v.BUTTON)&&(e.openElements.generateImpliedEndTags(),e.openElements.popUntilTagNamePopped(v.BUTTON)),e._reconstructActiveFormattingElements(),e._insertElement(t,xe.HTML),e.framesetOk=!1}function Bte(e,t){const n=e.activeFormattingElements.getElementEntryInScopeWithTagName(se.A);n&&(pv(e,t),e.openElements.remove(n.element),e.activeFormattingElements.removeEntry(n)),e._reconstructActiveFormattingElements(),e._insertElement(t,xe.HTML),e.activeFormattingElements.pushElement(e.openElements.current,t)}function Fte(e,t){e._reconstructActiveFormattingElements(),e._insertElement(t,xe.HTML),e.activeFormattingElements.pushElement(e.openElements.current,t)}function Ute(e,t){e._reconstructActiveFormattingElements(),e.openElements.hasInScope(v.NOBR)&&(pv(e,t),e._reconstructActiveFormattingElements()),e._insertElement(t,xe.HTML),e.activeFormattingElements.pushElement(e.openElements.current,t)}function $te(e,t){e._reconstructActiveFormattingElements(),e._insertElement(t,xe.HTML),e.activeFormattingElements.insertMarker(),e.framesetOk=!1}function Hte(e,t){e.treeAdapter.getDocumentMode(e.document)!==bs.QUIRKS&&e.openElements.hasInButtonScope(v.P)&&e._closePElement(),e._insertElement(t,xe.HTML),e.framesetOk=!1,e.insertionMode=Y.IN_TABLE}function Wj(e,t){e._reconstructActiveFormattingElements(),e._appendElement(t,xe.HTML),e.framesetOk=!1,t.ackSelfClosing=!0}function Gj(e){const t=Dj(e,Ao.TYPE);return t!=null&&t.toLowerCase()===ate}function zte(e,t){e._reconstructActiveFormattingElements(),e._appendElement(t,xe.HTML),Gj(t)||(e.framesetOk=!1),t.ackSelfClosing=!0}function Vte(e,t){e._appendElement(t,xe.HTML),t.ackSelfClosing=!0}function Kte(e,t){e.openElements.hasInButtonScope(v.P)&&e._closePElement(),e._appendElement(t,xe.HTML),e.framesetOk=!1,t.ackSelfClosing=!0}function Yte(e,t){t.tagName=se.IMG,t.tagID=v.IMG,Wj(e,t)}function Wte(e,t){e._insertElement(t,xe.HTML),e.skipNextNewLine=!0,e.tokenizer.state=vn.RCDATA,e.originalInsertionMode=e.insertionMode,e.framesetOk=!1,e.insertionMode=Y.TEXT}function Gte(e,t){e.openElements.hasInButtonScope(v.P)&&e._closePElement(),e._reconstructActiveFormattingElements(),e.framesetOk=!1,e._switchToTextParsing(t,vn.RAWTEXT)}function qte(e,t){e.framesetOk=!1,e._switchToTextParsing(t,vn.RAWTEXT)}function s2(e,t){e._switchToTextParsing(t,vn.RAWTEXT)}function Xte(e,t){e._reconstructActiveFormattingElements(),e._insertElement(t,xe.HTML),e.framesetOk=!1,e.insertionMode=e.insertionMode===Y.IN_TABLE||e.insertionMode===Y.IN_CAPTION||e.insertionMode===Y.IN_TABLE_BODY||e.insertionMode===Y.IN_ROW||e.insertionMode===Y.IN_CELL?Y.IN_SELECT_IN_TABLE:Y.IN_SELECT}function Qte(e,t){e.openElements.currentTagId===v.OPTION&&e.openElements.pop(),e._reconstructActiveFormattingElements(),e._insertElement(t,xe.HTML)}function Zte(e,t){e.openElements.hasInScope(v.RUBY)&&e.openElements.generateImpliedEndTags(),e._insertElement(t,xe.HTML)}function Jte(e,t){e.openElements.hasInScope(v.RUBY)&&e.openElements.generateImpliedEndTagsWithExclusion(v.RTC),e._insertElement(t,xe.HTML)}function ene(e,t){e._reconstructActiveFormattingElements(),Hj(t),hv(t),t.selfClosing?e._appendElement(t,xe.MATHML):e._insertElement(t,xe.MATHML),t.ackSelfClosing=!0}function tne(e,t){e._reconstructActiveFormattingElements(),zj(t),hv(t),t.selfClosing?e._appendElement(t,xe.SVG):e._insertElement(t,xe.SVG),t.ackSelfClosing=!0}function i2(e,t){e._reconstructActiveFormattingElements(),e._insertElement(t,xe.HTML)}function br(e,t){switch(t.tagID){case v.I:case v.S:case v.B:case v.U:case v.EM:case v.TT:case v.BIG:case v.CODE:case v.FONT:case v.SMALL:case v.STRIKE:case v.STRONG:{Fte(e,t);break}case v.A:{Bte(e,t);break}case v.H1:case v.H2:case v.H3:case v.H4:case v.H5:case v.H6:{Rte(e,t);break}case v.P:case v.DL:case v.OL:case v.UL:case v.DIV:case v.DIR:case v.NAV:case v.MAIN:case v.MENU:case v.ASIDE:case v.CENTER:case v.FIGURE:case v.FOOTER:case v.HEADER:case v.HGROUP:case v.DIALOG:case v.DETAILS:case v.ADDRESS:case v.ARTICLE:case v.SEARCH:case v.SECTION:case v.SUMMARY:case v.FIELDSET:case v.BLOCKQUOTE:case v.FIGCAPTION:{Ote(e,t);break}case v.LI:case v.DD:case v.DT:{jte(e,t);break}case v.BR:case v.IMG:case v.WBR:case v.AREA:case v.EMBED:case v.KEYGEN:{Wj(e,t);break}case v.HR:{Kte(e,t);break}case v.RB:case v.RTC:{Zte(e,t);break}case v.RT:case v.RP:{Jte(e,t);break}case v.PRE:case v.LISTING:{Lte(e,t);break}case v.XMP:{Gte(e,t);break}case v.SVG:{tne(e,t);break}case v.HTML:{Ate(e,t);break}case v.BASE:case v.LINK:case v.META:case v.STYLE:case v.TITLE:case v.SCRIPT:case v.BGSOUND:case v.BASEFONT:case v.TEMPLATE:{ei(e,t);break}case v.BODY:{Cte(e,t);break}case v.FORM:{Mte(e,t);break}case v.NOBR:{Ute(e,t);break}case v.MATH:{ene(e,t);break}case v.TABLE:{Hte(e,t);break}case v.INPUT:{zte(e,t);break}case v.PARAM:case v.TRACK:case v.SOURCE:{Vte(e,t);break}case v.IMAGE:{Yte(e,t);break}case v.BUTTON:{Pte(e,t);break}case v.APPLET:case v.OBJECT:case v.MARQUEE:{$te(e,t);break}case v.IFRAME:{qte(e,t);break}case v.SELECT:{Xte(e,t);break}case v.OPTION:case v.OPTGROUP:{Qte(e,t);break}case v.NOEMBED:case v.NOFRAMES:{s2(e,t);break}case v.FRAMESET:{Ite(e,t);break}case v.TEXTAREA:{Wte(e,t);break}case v.NOSCRIPT:{e.options.scriptingEnabled?s2(e,t):i2(e,t);break}case v.PLAINTEXT:{Dte(e,t);break}case v.COL:case v.TH:case v.TD:case v.TR:case v.HEAD:case v.FRAME:case v.TBODY:case v.TFOOT:case v.THEAD:case v.CAPTION:case v.COLGROUP:break;default:i2(e,t)}}function nne(e,t){if(e.openElements.hasInScope(v.BODY)&&(e.insertionMode=Y.AFTER_BODY,e.options.sourceCodeLocationInfo)){const n=e.openElements.tryPeekProperlyNestedBodyElement();n&&e._setEndLocation(n,t)}}function rne(e,t){e.openElements.hasInScope(v.BODY)&&(e.insertionMode=Y.AFTER_BODY,sD(e,t))}function sne(e,t){const n=t.tagID;e.openElements.hasInScope(n)&&(e.openElements.generateImpliedEndTags(),e.openElements.popUntilTagNamePopped(n))}function ine(e){const t=e.openElements.tmplCount>0,{formElement:n}=e;t||(e.formElement=null),(n||t)&&e.openElements.hasInScope(v.FORM)&&(e.openElements.generateImpliedEndTags(),t?e.openElements.popUntilTagNamePopped(v.FORM):n&&e.openElements.remove(n))}function ane(e){e.openElements.hasInButtonScope(v.P)||e._insertFakeElement(se.P,v.P),e._closePElement()}function one(e){e.openElements.hasInListItemScope(v.LI)&&(e.openElements.generateImpliedEndTagsWithExclusion(v.LI),e.openElements.popUntilTagNamePopped(v.LI))}function lne(e,t){const n=t.tagID;e.openElements.hasInScope(n)&&(e.openElements.generateImpliedEndTagsWithExclusion(n),e.openElements.popUntilTagNamePopped(n))}function cne(e){e.openElements.hasNumberedHeaderInScope()&&(e.openElements.generateImpliedEndTags(),e.openElements.popUntilNumberedHeaderPopped())}function une(e,t){const n=t.tagID;e.openElements.hasInScope(n)&&(e.openElements.generateImpliedEndTags(),e.openElements.popUntilTagNamePopped(n),e.activeFormattingElements.clearToLastMarker())}function dne(e){e._reconstructActiveFormattingElements(),e._insertFakeElement(se.BR,v.BR),e.openElements.pop(),e.framesetOk=!1}function qj(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!==v.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 zg(e,t){switch(t.tagID){case v.A:case v.B:case v.I:case v.S:case v.U:case v.EM:case v.TT:case v.BIG:case v.CODE:case v.FONT:case v.NOBR:case v.SMALL:case v.STRIKE:case v.STRONG:{pv(e,t);break}case v.P:{ane(e);break}case v.DL:case v.UL:case v.OL:case v.DIR:case v.DIV:case v.NAV:case v.PRE:case v.MAIN:case v.MENU:case v.ASIDE:case v.BUTTON:case v.CENTER:case v.FIGURE:case v.FOOTER:case v.HEADER:case v.HGROUP:case v.DIALOG:case v.ADDRESS:case v.ARTICLE:case v.DETAILS:case v.SEARCH:case v.SECTION:case v.SUMMARY:case v.LISTING:case v.FIELDSET:case v.BLOCKQUOTE:case v.FIGCAPTION:{sne(e,t);break}case v.LI:{one(e);break}case v.DD:case v.DT:{lne(e,t);break}case v.H1:case v.H2:case v.H3:case v.H4:case v.H5:case v.H6:{cne(e);break}case v.BR:{dne(e);break}case v.BODY:{nne(e,t);break}case v.HTML:{rne(e,t);break}case v.FORM:{ine(e);break}case v.APPLET:case v.OBJECT:case v.MARQUEE:{une(e,t);break}case v.TEMPLATE:{Zo(e,t);break}default:qj(e,t)}}function Xj(e,t){e.tmplInsertionModeStack.length>0?rD(e,t):mv(e,t)}function fne(e,t){var n;t.tagID===v.SCRIPT&&((n=e.scriptHandler)===null||n===void 0||n.call(e,e.openElements.current)),e.openElements.pop(),e.insertionMode=e.originalInsertionMode}function hne(e,t){e._err(t,ce.eofInElementThatCanContainOnlyText),e.openElements.pop(),e.insertionMode=e.originalInsertionMode,e.onEof(t)}function Uy(e,t){if(e.openElements.currentTagId!==void 0&&Vj.has(e.openElements.currentTagId))switch(e.pendingCharacterTokens.length=0,e.hasNonWhitespacePendingCharacterToken=!1,e.originalInsertionMode=e.insertionMode,e.insertionMode=Y.IN_TABLE_TEXT,t.type){case mt.CHARACTER:{Zj(e,t);break}case mt.WHITESPACE_CHARACTER:{Qj(e,t);break}}else Rf(e,t)}function pne(e,t){e.openElements.clearBackToTableContext(),e.activeFormattingElements.insertMarker(),e._insertElement(t,xe.HTML),e.insertionMode=Y.IN_CAPTION}function mne(e,t){e.openElements.clearBackToTableContext(),e._insertElement(t,xe.HTML),e.insertionMode=Y.IN_COLUMN_GROUP}function gne(e,t){e.openElements.clearBackToTableContext(),e._insertFakeElement(se.COLGROUP,v.COLGROUP),e.insertionMode=Y.IN_COLUMN_GROUP,gv(e,t)}function yne(e,t){e.openElements.clearBackToTableContext(),e._insertElement(t,xe.HTML),e.insertionMode=Y.IN_TABLE_BODY}function bne(e,t){e.openElements.clearBackToTableContext(),e._insertFakeElement(se.TBODY,v.TBODY),e.insertionMode=Y.IN_TABLE_BODY,Vg(e,t)}function Ene(e,t){e.openElements.hasInTableScope(v.TABLE)&&(e.openElements.popUntilTagNamePopped(v.TABLE),e._resetInsertionMode(),e._processStartTag(t))}function xne(e,t){Gj(t)?e._appendElement(t,xe.HTML):Rf(e,t),t.ackSelfClosing=!0}function wne(e,t){!e.formElement&&e.openElements.tmplCount===0&&(e._insertElement(t,xe.HTML),e.formElement=e.openElements.current,e.openElements.pop())}function Tc(e,t){switch(t.tagID){case v.TD:case v.TH:case v.TR:{bne(e,t);break}case v.STYLE:case v.SCRIPT:case v.TEMPLATE:{ei(e,t);break}case v.COL:{gne(e,t);break}case v.FORM:{wne(e,t);break}case v.TABLE:{Ene(e,t);break}case v.TBODY:case v.TFOOT:case v.THEAD:{yne(e,t);break}case v.INPUT:{xne(e,t);break}case v.CAPTION:{pne(e,t);break}case v.COLGROUP:{mne(e,t);break}default:Rf(e,t)}}function ef(e,t){switch(t.tagID){case v.TABLE:{e.openElements.hasInTableScope(v.TABLE)&&(e.openElements.popUntilTagNamePopped(v.TABLE),e._resetInsertionMode());break}case v.TEMPLATE:{Zo(e,t);break}case v.BODY:case v.CAPTION:case v.COL:case v.COLGROUP:case v.HTML:case v.TBODY:case v.TD:case v.TFOOT:case v.TH:case v.THEAD:case v.TR:break;default:Rf(e,t)}}function Rf(e,t){const n=e.fosterParentingEnabled;e.fosterParentingEnabled=!0,Hg(e,t),e.fosterParentingEnabled=n}function Qj(e,t){e.pendingCharacterTokens.push(t)}function Zj(e,t){e.pendingCharacterTokens.push(t),e.hasNonWhitespacePendingCharacterToken=!0}function _u(e,t){let n=0;if(e.hasNonWhitespacePendingCharacterToken)for(;n0&&e.openElements.currentTagId===v.OPTION&&e.openElements.tagIDs[e.openElements.stackTop-1]===v.OPTGROUP&&e.openElements.pop(),e.openElements.currentTagId===v.OPTGROUP&&e.openElements.pop();break}case v.OPTION:{e.openElements.currentTagId===v.OPTION&&e.openElements.pop();break}case v.SELECT:{e.openElements.hasInSelectScope(v.SELECT)&&(e.openElements.popUntilTagNamePopped(v.SELECT),e._resetInsertionMode());break}case v.TEMPLATE:{Zo(e,t);break}}}function Tne(e,t){const n=t.tagID;n===v.CAPTION||n===v.TABLE||n===v.TBODY||n===v.TFOOT||n===v.THEAD||n===v.TR||n===v.TD||n===v.TH?(e.openElements.popUntilTagNamePopped(v.SELECT),e._resetInsertionMode(),e._processStartTag(t)):tD(e,t)}function Ane(e,t){const n=t.tagID;n===v.CAPTION||n===v.TABLE||n===v.TBODY||n===v.TFOOT||n===v.THEAD||n===v.TR||n===v.TD||n===v.TH?e.openElements.hasInTableScope(n)&&(e.openElements.popUntilTagNamePopped(v.SELECT),e._resetInsertionMode(),e.onEndTag(t)):nD(e,t)}function Cne(e,t){switch(t.tagID){case v.BASE:case v.BASEFONT:case v.BGSOUND:case v.LINK:case v.META:case v.NOFRAMES:case v.SCRIPT:case v.STYLE:case v.TEMPLATE:case v.TITLE:{ei(e,t);break}case v.CAPTION:case v.COLGROUP:case v.TBODY:case v.TFOOT:case v.THEAD:{e.tmplInsertionModeStack[0]=Y.IN_TABLE,e.insertionMode=Y.IN_TABLE,Tc(e,t);break}case v.COL:{e.tmplInsertionModeStack[0]=Y.IN_COLUMN_GROUP,e.insertionMode=Y.IN_COLUMN_GROUP,gv(e,t);break}case v.TR:{e.tmplInsertionModeStack[0]=Y.IN_TABLE_BODY,e.insertionMode=Y.IN_TABLE_BODY,Vg(e,t);break}case v.TD:case v.TH:{e.tmplInsertionModeStack[0]=Y.IN_ROW,e.insertionMode=Y.IN_ROW,Kg(e,t);break}default:e.tmplInsertionModeStack[0]=Y.IN_BODY,e.insertionMode=Y.IN_BODY,br(e,t)}}function Ine(e,t){t.tagID===v.TEMPLATE&&Zo(e,t)}function rD(e,t){e.openElements.tmplCount>0?(e.openElements.popUntilTagNamePopped(v.TEMPLATE),e.activeFormattingElements.clearToLastMarker(),e.tmplInsertionModeStack.shift(),e._resetInsertionMode(),e.onEof(t)):mv(e,t)}function One(e,t){t.tagID===v.HTML?br(e,t):jm(e,t)}function sD(e,t){var n;if(t.tagID===v.HTML){if(e.fragmentContext||(e.insertionMode=Y.AFTER_AFTER_BODY),e.options.sourceCodeLocationInfo&&e.openElements.tagIDs[0]===v.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 jm(e,t)}function jm(e,t){e.insertionMode=Y.IN_BODY,Hg(e,t)}function Rne(e,t){switch(t.tagID){case v.HTML:{br(e,t);break}case v.FRAMESET:{e._insertElement(t,xe.HTML);break}case v.FRAME:{e._appendElement(t,xe.HTML),t.ackSelfClosing=!0;break}case v.NOFRAMES:{ei(e,t);break}}}function Lne(e,t){t.tagID===v.FRAMESET&&!e.openElements.isRootHtmlElementCurrent()&&(e.openElements.pop(),!e.fragmentContext&&e.openElements.currentTagId!==v.FRAMESET&&(e.insertionMode=Y.AFTER_FRAMESET))}function Mne(e,t){switch(t.tagID){case v.HTML:{br(e,t);break}case v.NOFRAMES:{ei(e,t);break}}}function jne(e,t){t.tagID===v.HTML&&(e.insertionMode=Y.AFTER_AFTER_FRAMESET)}function Dne(e,t){t.tagID===v.HTML?br(e,t):Ip(e,t)}function Ip(e,t){e.insertionMode=Y.IN_BODY,Hg(e,t)}function Pne(e,t){switch(t.tagID){case v.HTML:{br(e,t);break}case v.NOFRAMES:{ei(e,t);break}}}function Bne(e,t){t.chars=Qt,e._insertCharacters(t)}function Fne(e,t){e._insertCharacters(t),e.framesetOk=!1}function iD(e){for(;e.treeAdapter.getNamespaceURI(e.openElements.current)!==xe.HTML&&e.openElements.currentTagId!==void 0&&!e._isIntegrationPoint(e.openElements.currentTagId,e.openElements.current);)e.openElements.pop()}function Une(e,t){if(tte(t))iD(e),e._startTagOutsideForeignContent(t);else{const n=e._getAdjustedCurrentElement(),r=e.treeAdapter.getNamespaceURI(n);r===xe.MATHML?Hj(t):r===xe.SVG&&(nte(t),zj(t)),hv(t),t.selfClosing?e._appendElement(t,r):e._insertElement(t,r),t.ackSelfClosing=!0}}function $ne(e,t){if(t.tagID===v.P||t.tagID===v.BR){iD(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)===xe.HTML){e._endTagOutsideForeignContent(t);break}const s=e.treeAdapter.getTagName(r);if(s.toLowerCase()===t.tagName){t.tagName=s,e.openElements.shortenToLength(n);break}}}se.AREA,se.BASE,se.BASEFONT,se.BGSOUND,se.BR,se.COL,se.EMBED,se.FRAME,se.HR,se.IMG,se.INPUT,se.KEYGEN,se.LINK,se.META,se.PARAM,se.SOURCE,se.TRACK,se.WBR;const Hne=/<(\/?)(iframe|noembed|noframes|plaintext|script|style|textarea|title|xmp)(?=[\t\n\f\r />])/gi,zne=new Set(["mdxFlowExpression","mdxJsxFlowElement","mdxJsxTextElement","mdxTextExpression","mdxjsEsm"]),a2={sourceCodeLocationInfo:!0,scriptingEnabled:!1};function aD(e,t){const n=Jne(e),r=w3("type",{handlers:{root:Vne,element:Kne,text:Yne,comment:lD,doctype:Wne,raw:qne},unknown:Xne}),s={parser:n?new r2(a2):r2.getFragmentParser(void 0,a2),handle(o){r(o,s)},stitches:!1,options:t||{}};r(e,s),Qc(s,_i());const i=n?s.parser.document:s.parser.getFragment(),a=eee(i,{file:s.options.file});return s.stitches&&If(a,"comment",function(o,c,u){const d=o;if(d.value.stitch&&u&&c!==void 0){const f=u.children;return f[c]=d.value.stitch,c}}),a.type==="root"&&a.children.length===1&&a.children[0].type===e.type?a.children[0]:a}function oD(e,t){let n=-1;if(e)for(;++n4&&(t.parser.tokenizer.state=0);const n={type:mt.CHARACTER,chars:e.value,location:Lf(e)};Qc(t,_i(e)),t.parser.currentToken=n,t.parser._processToken(t.parser.currentToken)}function Wne(e,t){const n={type:mt.DOCTYPE,name:"html",forceQuirks:!1,publicId:"",systemId:"",location:Lf(e)};Qc(t,_i(e)),t.parser.currentToken=n,t.parser._processToken(t.parser.currentToken)}function Gne(e,t){t.stitches=!0;const n=ere(e);if("children"in e&&"children"in n){const r=aD({type:"root",children:e.children},t.options);n.children=r.children}lD({type:"comment",value:{stitch:n}},t)}function lD(e,t){const n=e.value,r={type:mt.COMMENT,data:n,location:Lf(e)};Qc(t,_i(e)),t.parser.currentToken=r,t.parser._processToken(t.parser.currentToken)}function qne(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,cD(t,_i(e)),t.parser.tokenizer.write(t.options.tagfilter?e.value.replace(Hne,"<$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 Xne(e,t){const n=e;if(t.options.passThrough&&t.options.passThrough.includes(n.type))Gne(n,t);else{let r="";throw zne.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 Qc(e,t){cD(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=vn.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 cD(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 Qne(e,t){const n=e.tagName.toLowerCase();if(t.parser.tokenizer.state===vn.PLAINTEXT)return;Qc(t,_i(e));const r=t.parser.openElements.current;let s="namespaceURI"in r?r.namespaceURI:Eo.html;s===Eo.html&&n==="svg"&&(s=Eo.svg);const i=iee({...e,children:[]},{space:s===Eo.svg?"svg":"html"}),a={type:mt.START_TAG,tagName:n,tagID:Xc(n),selfClosing:!1,ackSelfClosing:!1,attrs:"attrs"in i?i.attrs:[],location:Lf(e)};t.parser.currentToken=a,t.parser._processToken(t.parser.currentToken),t.parser.tokenizer.lastStartTagName=n}function Zne(e,t){const n=e.tagName.toLowerCase();if(!t.parser.tokenizer.inForeignNode&&hee.includes(n)||t.parser.tokenizer.state===vn.PLAINTEXT)return;Qc(t,Dg(e));const r={type:mt.END_TAG,tagName:n,tagID:Xc(n),selfClosing:!1,ackSelfClosing:!1,attrs:[],location:Lf(e)};t.parser.currentToken=r,t.parser._processToken(t.parser.currentToken),n===t.parser.tokenizer.lastStartTagName&&(t.parser.tokenizer.state===vn.RCDATA||t.parser.tokenizer.state===vn.RAWTEXT||t.parser.tokenizer.state===vn.SCRIPT_DATA)&&(t.parser.tokenizer.state=vn.DATA)}function Jne(e){const t=e.type==="root"?e.children[0]:e;return!!(t&&(t.type==="doctype"||t.type==="element"&&t.tagName.toLowerCase()==="html"))}function Lf(e){const t=_i(e)||{line:void 0,column:void 0,offset:void 0},n=Dg(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 ere(e){return"children"in e?Nc({...e,children:[]}):Nc(e)}function tre(e){return function(t,n){return aD(t,{...e,file:n})}}const uD=[".mp4",".webm",".mov",".m4v",".ogg",".avi"];function dD(e){if(!e)return!1;try{const t=e.toLowerCase();return uD.some(n=>t.includes(n))}catch{return!1}}function nre(e){var r;const t=(r=e==null?void 0:e.properties)==null?void 0:r.href;if(!t)return!1;if(dD(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 uD.some(i=>s.includes(i))}return!1}function rre({text:e,className:t,allowRawHtml:n=!0}){const[r,s]=w.useState(null),i=(c,u)=>{if(c.src)return c.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=c=>{try{const d=new URL(c).pathname.split("/");return d[d.length-1]||"video.mp4"}catch{return"video.mp4"}},o=c=>c?Array.isArray(c)?c.map(u=>(u==null?void 0:u.value)||"").join("")||"video":(c==null?void 0:c.value)||"video":"video";return l.jsxs("div",{className:t?`md ${t}`:"md",children:[l.jsx(aq,{remarkPlugins:[EQ],rehypePlugins:n?[tre,zT]:[zT],components:{a:({node:c,...u})=>{const d=u.href;if(d&&(dD(d)||nre(c))){const f=d,h=o(c==null?void 0:c.children);return l.jsxs("div",{className:"video-container",children:[l.jsxs("button",{type:"button",className:"video-preview-trigger","aria-label":`点击播放视频: ${h}`,onClick:()=>s({src:f,title:h}),children:[l.jsx("video",{src:f,playsInline:!0,className:"video-thumbnail",preload:"metadata"}),l.jsx("span",{className:"video-preview-hint","aria-hidden":"true",children:l.jsx(tc,{})})]}),l.jsx("div",{className:"video-caption",children:l.jsx("a",{href:f,target:"_blank",rel:"noopener noreferrer",className:"video-link-text",children:h})})]})}return l.jsx("a",{...u,target:"_blank",rel:"noopener noreferrer"})},img:({node:c,src:u,alt:d,...f})=>{const h=l.jsx("img",{...f,src:u,alt:d??"",loading:"lazy"});return u?l.jsx(mL,{src:u,children:l.jsxs("button",{type:"button",className:"image-preview-trigger","aria-label":`放大预览:${d||"图片"}`,children:[h,l.jsx("span",{className:"image-preview-hint","aria-hidden":"true",children:l.jsx(tc,{})})]})}):h},video:({node:c,src:u,children:d,...f})=>{const h=i({src:u},d);return h?l.jsx("div",{className:"video-container",children:l.jsxs("button",{type:"button",className:"video-preview-trigger","aria-label":"点击放大视频",onClick:()=>s({src:h}),children:[l.jsx("video",{src:h,...f,playsInline:!0,className:"video-thumbnail",children:d}),l.jsx("span",{className:"video-preview-hint","aria-hidden":"true",children:l.jsx(tc,{})})]})}):l.jsx("video",{src:u,controls:!0,playsInline:!0,className:"video-inline",...f,children:d})}},children:e}),r&&l.jsx("div",{className:"video-viewer-backdrop",role:"dialog","aria-modal":"true","aria-label":"视频预览",onClick:()=>s(null),children:l.jsxs("div",{className:"video-viewer",onClick:c=>c.stopPropagation(),children:[l.jsxs("div",{className:"video-viewer-header",children:[l.jsx("div",{className:"video-viewer-title",children:r.title||a(r.src)}),l.jsxs("nav",{className:"video-viewer-nav",children:[l.jsx("a",{href:r.src,download:r.title||a(r.src),"aria-label":"下载视频",title:"下载视频",className:"video-viewer-download",children:l.jsx(Cw,{})}),l.jsx("button",{type:"button",className:"video-viewer-close","aria-label":"关闭",onClick:()=>s(null),children:l.jsx(zr,{})})]})]}),l.jsx("div",{className:"video-viewer-body",children:l.jsx("video",{src:r.src,controls:!0,autoPlay:!0,playsInline:!0,className:"video-fullscreen"})})]})})]})}const Mf=w.memo(rre),o2=6,l2=7,sre={active:"可用",available:"可用",creating:"创建中",disabled:"已停用",enabled:"已启用",failed:"异常",inactive:"未启用",pending:"等待中",published:"已发布",ready:"就绪",released:"已发布",running:"运行中",success:"正常",unavailable:"不可用",unreleased:"未发布",updating:"更新中"};function EE(e){return sre[(e||"").trim().toLowerCase()]||"未知"}function c2(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 ire(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 are(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 ore({className:e="icon"}){return l.jsxs("svg",{className:e,viewBox:"0 0 24 24",fill:"none","aria-hidden":!0,children:[l.jsx("path",{d:"M6.25 4.75h8.6l2.9 2.9v11.6h-11.5z",stroke:"currentColor",strokeWidth:"1.6",strokeLinejoin:"round"}),l.jsx("path",{d:"M14.75 4.9v3h2.85M8.9 11.1h4.2M8.9 14h5.7",stroke:"currentColor",strokeWidth:"1.6",strokeLinecap:"round"}),l.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 lre(){return l.jsx("svg",{className:"icon",viewBox:"0 0 24 24",fill:"none","aria-hidden":!0,children:l.jsx("path",{d:"m7.5 7.5 9 9m0-9-9 9",stroke:"currentColor",strokeWidth:"1.7",strokeLinecap:"round"})})}function u2({direction:e}){return l.jsx("svg",{className:"icon",viewBox:"0 0 20 20",fill:"none","aria-hidden":!0,children:l.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 xE(){return l.jsx("span",{className:"skillcenter-loading-mark","aria-hidden":!0})}function d2({page:e,total:t,pageSize:n,onPage:r}){const s=Math.max(1,Math.ceil(t/n));return l.jsxs("footer",{className:"skillcenter-pager",children:[l.jsxs("span",{children:["共 ",t," 项"]}),l.jsxs("div",{className:"skillcenter-pager-actions",children:[l.jsx("button",{type:"button",onClick:()=>r(e-1),disabled:e<=1,"aria-label":"上一页",children:l.jsx(u2,{direction:"left"})}),l.jsxs("span",{children:[e," / ",s]}),l.jsx("button",{type:"button",onClick:()=>r(e+1),disabled:e>=s,"aria-label":"下一页",children:l.jsx(u2,{direction:"right"})})]})]})}function Op({children:e}){return l.jsx("div",{className:"skillcenter-empty",children:e})}function cre({skill:e,space:t,region:n,detail:r,loading:s,error:i,onClose:a}){return w.useEffect(()=>{const o=c=>{c.key==="Escape"&&a()};return window.addEventListener("keydown",o),()=>window.removeEventListener("keydown",o)},[a]),l.jsx("div",{className:"skill-detail-backdrop",role:"presentation",onMouseDown:a,children:l.jsxs("section",{className:"skill-detail-dialog",role:"dialog","aria-modal":"true","aria-labelledby":"skill-detail-title",onMouseDown:o=>o.stopPropagation(),children:[l.jsxs("header",{className:"skill-detail-head",children:[l.jsxs("div",{className:"skill-detail-heading",children:[l.jsx("span",{className:"skillcenter-symbol skillcenter-symbol--skill",children:l.jsx(ore,{})}),l.jsxs("div",{children:[l.jsx("h2",{id:"skill-detail-title",children:(r==null?void 0:r.name)||e.skillName}),l.jsx("p",{children:(r==null?void 0:r.description)||e.skillDescription||"暂无描述"})]})]}),l.jsx("button",{type:"button",className:"skill-detail-close",onClick:a,"aria-label":"关闭技能详情",children:l.jsx(lre,{})})]}),l.jsxs("dl",{className:"skill-detail-meta",children:[l.jsxs("div",{children:[l.jsx("dt",{children:"技能 ID"}),l.jsx("dd",{title:e.skillId,children:e.skillId})]}),l.jsxs("div",{children:[l.jsx("dt",{children:"版本"}),l.jsx("dd",{children:(r==null?void 0:r.version)||e.version||"—"})]}),l.jsxs("div",{children:[l.jsx("dt",{children:"状态"}),l.jsx("dd",{children:EE(e.skillStatus)})]}),l.jsxs("div",{children:[l.jsx("dt",{children:"技能空间"}),l.jsx("dd",{title:t.name,children:t.name})]}),l.jsxs("div",{children:[l.jsx("dt",{children:"Project"}),l.jsx("dd",{title:t.projectName||"default",children:t.projectName||"default"})]}),l.jsxs("div",{children:[l.jsx("dt",{children:"地域"}),l.jsx("dd",{children:n==="cn-beijing"?"北京":"上海"})]})]}),l.jsxs("div",{className:"skill-detail-content",children:[l.jsx("div",{className:"skill-detail-content-title",children:"SKILL.md"}),s?l.jsxs("div",{className:"skillcenter-loading",children:[l.jsx(xE,{}),"正在读取技能内容…"]}):i?l.jsx("div",{className:"skillcenter-error",children:i}):r!=null&&r.skillMd?l.jsx(Mf,{text:are(r.skillMd),className:"skill-detail-markdown",allowRawHtml:!1}):l.jsx(Op,{children:"该技能暂无 SKILL.md 内容"})]})]})})}function ure(){const[e,t]=w.useState("cn-beijing"),[n,r]=w.useState([]),[s,i]=w.useState(1),[a,o]=w.useState(0),[c,u]=w.useState(!1),[d,f]=w.useState(""),[h,p]=w.useState(null),[m,y]=w.useState([]),[E,g]=w.useState(1),[x,b]=w.useState(0),[_,k]=w.useState(!1),[N,C]=w.useState(""),[S,A]=w.useState(null),[O,D]=w.useState(null),[U,X]=w.useState(!1),[M,j]=w.useState(""),T=w.useRef(0);w.useEffect(()=>{let V=!0;return u(!0),f(""),hV({region:e,page:s,pageSize:o2}).then(W=>{if(!V)return;const P=W.items||[];r(P),o(W.totalCount||0),p(ie=>P.find(G=>G.id===(ie==null?void 0:ie.id))||null)}).catch(W=>{V&&(r([]),o(0),p(null),f(W instanceof Error?W.message:"读取技能空间失败,请稍后重试"))}).finally(()=>{V&&u(!1)}),()=>{V=!1}},[e,s]),w.useEffect(()=>{if(!h){y([]),b(0);return}let V=!0;return k(!0),C(""),pV(h.id,{region:e,page:E,pageSize:l2,project:h.projectName}).then(W=>{V&&(y(W.items||[]),b(W.totalCount||0))}).catch(W=>{V&&(y([]),b(0),C(W instanceof Error?W.message:"读取技能失败,请稍后重试"))}).finally(()=>{V&&k(!1)}),()=>{V=!1}},[e,h,E]);const L=V=>{V!==e&&(F(),t(V),i(1),g(1),p(null),y([]))},R=V=>{F(),p(V),g(1)},F=()=>{T.current+=1,A(null),D(null),j(""),X(!1)},I=async V=>{if(!h)return;const W=T.current+1;T.current=W,A(V),D(null),j(""),X(!0);try{const P=await mV(h.id,V.skillId,V.version,e,h.projectName);T.current===W&&D(P)}catch(P){T.current===W&&j(P instanceof Error?P.message:"读取技能详情失败,请稍后重试")}finally{T.current===W&&X(!1)}};return l.jsxs("section",{className:"skillcenter",children:[l.jsxs("div",{className:"skillcenter-browser",children:[l.jsxs("section",{className:"skillcenter-panel","aria-label":"技能空间列表",children:[l.jsxs("header",{className:"skillcenter-panel-head",children:[l.jsxs("div",{children:[l.jsx("h2",{children:"技能空间"}),l.jsx("span",{className:"skillcenter-count-badge",children:a})]}),l.jsxs("div",{className:"skillcenter-regions","aria-label":"地域",children:[l.jsx("button",{type:"button",className:e==="cn-beijing"?"active":"",onClick:()=>L("cn-beijing"),children:"北京"}),l.jsx("button",{type:"button",className:e==="cn-shanghai"?"active":"",onClick:()=>L("cn-shanghai"),children:"上海"})]})]}),l.jsxs("div",{className:"skillcenter-listwrap",children:[c&&l.jsxs("div",{className:"skillcenter-loading skillcenter-loading--overlay",children:[l.jsx(xE,{}),"正在读取技能空间…"]}),d?l.jsx("div",{className:"skillcenter-error",children:d}):n.length===0&&!c?l.jsx(Op,{children:"当前地域暂无可访问的技能空间"}):l.jsx("div",{className:"skillcenter-list",children:n.map(V=>l.jsx("button",{type:"button",className:`skillcenter-space-item ${(h==null?void 0:h.id)===V.id?"active":""}`,onClick:()=>R(V),children:l.jsxs("span",{className:"skillcenter-item-body",children:[l.jsx("span",{className:"skillcenter-item-title",title:V.name,children:V.name}),l.jsx("span",{className:"skillcenter-item-description",children:V.description||"暂无描述"}),l.jsxs("span",{className:"skillcenter-item-meta",children:[l.jsx("span",{className:`skillcenter-status ${c2(V.status)}`,children:EE(V.status)}),l.jsxs("span",{className:"skillcenter-meta-text",title:V.projectName||"default",children:["Project · ",V.projectName||"default"]}),l.jsxs("span",{className:"skillcenter-meta-text",children:[V.skillCount??0," 个技能"]}),V.updatedAt&&l.jsxs("span",{className:"skillcenter-meta-text",children:["更新于 ",ire(V.updatedAt)]})]})]})},`${V.projectName||"default"}:${V.id}`))})]}),l.jsx(d2,{page:s,total:a,pageSize:o2,onPage:i})]}),l.jsx("section",{className:"skillcenter-panel","aria-label":"技能列表",children:h?l.jsxs(l.Fragment,{children:[l.jsxs("header",{className:"skillcenter-panel-head",children:[l.jsx("div",{children:l.jsxs("h2",{title:h.name,children:[h.name," · 技能"]})}),l.jsx("span",{children:x})]}),l.jsxs("div",{className:"skillcenter-listwrap",children:[_&&l.jsxs("div",{className:"skillcenter-loading skillcenter-loading--overlay",children:[l.jsx(xE,{}),"正在读取技能…"]}),N?l.jsx("div",{className:"skillcenter-error",children:N}):m.length===0&&!_?l.jsx(Op,{children:"这个空间中暂无技能"}):l.jsx("div",{className:"skillcenter-list skillcenter-list--skills",children:m.map(V=>l.jsx("button",{type:"button",className:"skillcenter-skill-item",onClick:()=>void I(V),children:l.jsxs("span",{className:"skillcenter-item-body",children:[l.jsx("span",{className:"skillcenter-item-title",title:V.skillName,children:V.skillName}),l.jsx("span",{className:"skillcenter-item-description",children:V.skillDescription||"暂无描述"}),l.jsxs("span",{className:"skillcenter-item-meta",children:[l.jsx("span",{className:`skillcenter-status ${c2(V.skillStatus)}`,children:EE(V.skillStatus)}),l.jsxs("span",{className:"skillcenter-meta-text",children:["版本 · ",V.version||"—"]})]})]})},`${V.skillId}:${V.version}`))})]}),l.jsx(d2,{page:E,total:x,pageSize:l2,onPage:g})]}):l.jsx(Op,{children:"点击 Skill 空间以查看详情"})})]}),S&&h&&l.jsx(cre,{skill:S,space:h,region:e,detail:O,loading:U,error:M,onClose:F})]})}function dre({onAdded:e,onCancel:t}){const[n,r]=w.useState(""),[s,i]=w.useState(""),[a,o]=w.useState(""),[c,u]=w.useState(!1),[d,f]=w.useState(""),h=n.trim().length>0&&s.trim().length>0&&!c;async function p(){if(h){u(!0),f("");try{const m=await EM(a,n,s,a);if(m.apps.length===0){f("连接成功,但该地址未发现任何 Agent(/list-apps 为空)。"),u(!1);return}e(Bo(m.id,m.apps[0]))}catch(m){f(`连接失败:${String(m)}。请检查 URL、API Key,以及该网关是否允许跨域。`),u(!1)}}}return l.jsx("div",{className:"addagent",children:l.jsxs("div",{className:"addagent-card",children:[l.jsx("h2",{className:"addagent-title",children:"添加 AgentKit 智能体"}),l.jsx("p",{className:"addagent-sub",children:"填入 AgentKit 部署的访问地址与 API Key,将通过 ADK 协议连接,连接成功后其 Agent 会出现在左上角的下拉中。"}),l.jsxs("label",{className:"addagent-field",children:[l.jsx("span",{className:"addagent-label",children:"访问地址 URL"}),l.jsx("input",{className:"addagent-input",value:n,onChange:m=>r(m.target.value),placeholder:"https://xxxxx.apigateway-cn-beijing.volceapi.com",autoFocus:!0})]}),l.jsxs("label",{className:"addagent-field",children:[l.jsx("span",{className:"addagent-label",children:"API Key"}),l.jsx("input",{className:"addagent-input",type:"password",value:s,onChange:m=>i(m.target.value),placeholder:"以 Authorization: Bearer 方式连接"})]}),l.jsxs("label",{className:"addagent-field",children:[l.jsx("span",{className:"addagent-label",children:"显示名称(可选)"}),l.jsx("input",{className:"addagent-input",value:a,onChange:m=>o(m.target.value),placeholder:"默认取 URL 的主机名"})]}),d&&l.jsx("div",{className:"addagent-error",children:d}),l.jsxs("div",{className:"addagent-actions",children:[l.jsx("button",{className:"addagent-btn addagent-btn--ghost",onClick:t,disabled:c,children:"取消"}),l.jsxs("button",{className:"addagent-btn addagent-btn--primary",onClick:p,disabled:!h,children:[c?l.jsx(Rt,{className:"icon spin"}):null,c?"连接中…":"连接并添加"]})]})]})})}function Ln(e){if(typeof e=="string"||typeof e=="number")return""+e;let t="";if(Array.isArray(e))for(let n=0,r;n{}};function Yg(){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}})}Rp.prototype=Yg.prototype={constructor:Rp,on:function(e,t){var n=this._,r=hre(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)),h2.hasOwnProperty(t)?{space:h2[t],local:e}:e}function mre(e){return function(){var t=this.ownerDocument,n=this.namespaceURI;return n===wE&&t.documentElement.namespaceURI===wE?t.createElement(e):t.createElementNS(n,e)}}function gre(e){return function(){return this.ownerDocument.createElementNS(e.space,e.local)}}function fD(e){var t=Wg(e);return(t.local?gre:mre)(t)}function yre(){}function yv(e){return e==null?yre:function(){return this.querySelector(e)}}function bre(e){typeof e!="function"&&(e=yv(e));for(var t=this._groups,n=t.length,r=new Array(n),s=0;s=b&&(b=x+1);!(k=E[b])&&++b=0;)(a=r[s])&&(i&&a.compareDocumentPosition(i)^4&&i.parentNode.insertBefore(a,i),i=a);return this}function zre(e){e||(e=Vre);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 Kre(){var e=arguments[0];return arguments[0]=this,e.apply(null,arguments),this}function Yre(){return Array.from(this)}function Wre(){for(var e=this._groups,t=0,n=e.length;t1?this.each((t==null?sse:typeof t=="function"?ase:ise)(e,t,n??"")):Ac(this.node(),e)}function Ac(e,t){return e.style.getPropertyValue(t)||yD(e).getComputedStyle(e,null).getPropertyValue(t)}function lse(e){return function(){delete this[e]}}function cse(e,t){return function(){this[e]=t}}function use(e,t){return function(){var n=t.apply(this,arguments);n==null?delete this[e]:this[e]=n}}function dse(e,t){return arguments.length>1?this.each((t==null?lse:typeof t=="function"?use:cse)(e,t)):this.node()[e]}function bD(e){return e.trim().split(/^|\s+/)}function bv(e){return e.classList||new ED(e)}function ED(e){this._node=e,this._names=bD(e.getAttribute("class")||"")}ED.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 xD(e,t){for(var n=bv(e),r=-1,s=t.length;++r=0&&(n=t.slice(r+1),t=t.slice(0,r)),{type:t,name:n}})}function Fse(e){return function(){var t=this.__on;if(t){for(var n=0,r=-1,s=t.length,i;n()=>e;function vE(e,{sourceEvent:t,subject:n,target:r,identifier:s,active:i,x:a,y:o,dx:c,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:c,enumerable:!0,configurable:!0},dy:{value:u,enumerable:!0,configurable:!0},_:{value:d}})}vE.prototype.on=function(){var e=this._.on.apply(this._,arguments);return e===this._?this:e};function qse(e){return!e.ctrlKey&&!e.button}function Xse(){return this.parentNode}function Qse(e,t){return t??{x:e.x,y:e.y}}function Zse(){return navigator.maxTouchPoints||"ontouchstart"in this}function SD(){var e=qse,t=Xse,n=Qse,r=Zse,s={},i=Yg("start","drag","end"),a=0,o,c,u,d,f=0;function h(_){_.on("mousedown.drag",p).filter(r).on("touchstart.drag",E).on("touchmove.drag",g,Gse).on("touchend.drag touchcancel.drag",x).style("touch-action","none").style("-webkit-tap-highlight-color","rgba(0,0,0,0)")}function p(_,k){if(!(d||!e.call(this,_,k))){var N=b(this,t.call(this,_,k),_,k,"mouse");N&&(Qr(_.view).on("mousemove.drag",m,tf).on("mouseup.drag",y,tf),kD(_.view),$y(_),u=!1,o=_.clientX,c=_.clientY,N("start",_))}}function m(_){if(rc(_),!u){var k=_.clientX-o,N=_.clientY-c;u=k*k+N*N>f}s.mouse("drag",_)}function y(_){Qr(_.view).on("mousemove.drag mouseup.drag",null),ND(_.view,u),rc(_),s.mouse("end",_)}function E(_,k){if(e.call(this,_,k)){var N=_.changedTouches,C=t.call(this,_,k),S=N.length,A,O;for(A=0;A>8&15|t>>4&240,t>>4&15|t&240,(t&15)<<4|t&15,1):n===8?Kh(t>>24&255,t>>16&255,t>>8&255,(t&255)/255):n===4?Kh(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=eie.exec(e))?new Br(t[1],t[2],t[3],1):(t=tie.exec(e))?new Br(t[1]*255/100,t[2]*255/100,t[3]*255/100,1):(t=nie.exec(e))?Kh(t[1],t[2],t[3],t[4]):(t=rie.exec(e))?Kh(t[1]*255/100,t[2]*255/100,t[3]*255/100,t[4]):(t=sie.exec(e))?x2(t[1],t[2]/100,t[3]/100,1):(t=iie.exec(e))?x2(t[1],t[2]/100,t[3]/100,t[4]):p2.hasOwnProperty(e)?y2(p2[e]):e==="transparent"?new Br(NaN,NaN,NaN,0):null}function y2(e){return new Br(e>>16&255,e>>8&255,e&255,1)}function Kh(e,t,n,r){return r<=0&&(e=t=n=NaN),new Br(e,t,n,r)}function lie(e){return e instanceof Df||(e=Uo(e)),e?(e=e.rgb(),new Br(e.r,e.g,e.b,e.opacity)):new Br}function _E(e,t,n,r){return arguments.length===1?lie(e):new Br(e,t,n,r??1)}function Br(e,t,n,r){this.r=+e,this.g=+t,this.b=+n,this.opacity=+r}Ev(Br,_E,TD(Df,{brighter(e){return e=e==null?Pm:Math.pow(Pm,e),new Br(this.r*e,this.g*e,this.b*e,this.opacity)},darker(e){return e=e==null?nf:Math.pow(nf,e),new Br(this.r*e,this.g*e,this.b*e,this.opacity)},rgb(){return this},clamp(){return new Br(Co(this.r),Co(this.g),Co(this.b),Bm(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:b2,formatHex:b2,formatHex8:cie,formatRgb:E2,toString:E2}));function b2(){return`#${xo(this.r)}${xo(this.g)}${xo(this.b)}`}function cie(){return`#${xo(this.r)}${xo(this.g)}${xo(this.b)}${xo((isNaN(this.opacity)?1:this.opacity)*255)}`}function E2(){const e=Bm(this.opacity);return`${e===1?"rgb(":"rgba("}${Co(this.r)}, ${Co(this.g)}, ${Co(this.b)}${e===1?")":`, ${e})`}`}function Bm(e){return isNaN(e)?1:Math.max(0,Math.min(1,e))}function Co(e){return Math.max(0,Math.min(255,Math.round(e)||0))}function xo(e){return e=Co(e),(e<16?"0":"")+e.toString(16)}function x2(e,t,n,r){return r<=0?e=t=n=NaN:n<=0||n>=1?e=t=NaN:t<=0&&(e=NaN),new Hs(e,t,n,r)}function AD(e){if(e instanceof Hs)return new Hs(e.h,e.s,e.l,e.opacity);if(e instanceof Df||(e=Uo(e)),!e)return new Hs;if(e instanceof Hs)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,c=(i+s)/2;return o?(t===i?a=(n-r)/o+(n0&&c<1?0:a,new Hs(a,o,c,e.opacity)}function uie(e,t,n,r){return arguments.length===1?AD(e):new Hs(e,t,n,r??1)}function Hs(e,t,n,r){this.h=+e,this.s=+t,this.l=+n,this.opacity=+r}Ev(Hs,uie,TD(Df,{brighter(e){return e=e==null?Pm:Math.pow(Pm,e),new Hs(this.h,this.s,this.l*e,this.opacity)},darker(e){return e=e==null?nf:Math.pow(nf,e),new Hs(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 Br(Hy(e>=240?e-240:e+120,s,r),Hy(e,s,r),Hy(e<120?e+240:e-120,s,r),this.opacity)},clamp(){return new Hs(w2(this.h),Yh(this.s),Yh(this.l),Bm(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=Bm(this.opacity);return`${e===1?"hsl(":"hsla("}${w2(this.h)}, ${Yh(this.s)*100}%, ${Yh(this.l)*100}%${e===1?")":`, ${e})`}`}}));function w2(e){return e=(e||0)%360,e<0?e+360:e}function Yh(e){return Math.max(0,Math.min(1,e||0))}function Hy(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 xv=e=>()=>e;function die(e,t){return function(n){return e+n*t}}function fie(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 hie(e){return(e=+e)==1?CD:function(t,n){return n-t?fie(t,n,e):xv(isNaN(t)?n:t)}}function CD(e,t){var n=t-e;return n?die(e,n):xv(isNaN(e)?t:e)}const Fm=function e(t){var n=hie(t);function r(s,i){var a=n((s=_E(s)).r,(i=_E(i)).r),o=n(s.g,i.g),c=n(s.b,i.b),u=CD(s.opacity,i.opacity);return function(d){return s.r=a(d),s.g=o(d),s.b=c(d),s.opacity=u(d),s+""}}return r.gamma=e,r}(1);function pie(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,c.push({i:a,x:fi(r,s)})),n=zy.lastIndex;return n180?d+=360:d-u>180&&(u+=360),h.push({i:f.push(s(f)+"rotate(",null,r)-2,x:fi(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:fi(u,d)}):d&&f.push(s(f)+"skewX("+d+r)}function c(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:fi(u,f)},{i:y-2,x:fi(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),c(u.scaleX,u.scaleY,d.scaleX,d.scaleY,f,h),u=d=null,function(p){for(var m=-1,y=h.length,E;++m=0&&e._call.call(void 0,t),e=e._next;--Cc}function k2(){$o=($m=sf.now())+Gg,Cc=$u=0;try{Cie()}finally{Cc=0,Oie(),$o=0}}function Iie(){var e=sf.now(),t=e-$m;t>LD&&(Gg-=t,$m=e)}function Oie(){for(var e,t=Um,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:Um=n);Hu=e,SE(r)}function SE(e){if(!Cc){$u&&($u=clearTimeout($u));var t=e-$o;t>24?(e<1/0&&($u=setTimeout(k2,e-sf.now()-Gg)),ku&&(ku=clearInterval(ku))):(ku||($m=sf.now(),ku=setInterval(Iie,LD)),Cc=1,MD(k2))}}function N2(e,t,n){var r=new Hm;return t=t==null?0:+t,r.restart(s=>{r.stop(),e(s+t)},t,n),r}var Rie=Yg("start","end","cancel","interrupt"),Lie=[],DD=0,S2=1,TE=2,Mp=3,T2=4,AE=5,jp=6;function qg(e,t,n,r,s,i){var a=e.__transition;if(!a)e.__transition={};else if(n in a)return;Mie(e,n,{name:t,index:r,group:s,on:Rie,tween:Lie,time:i.time,delay:i.delay,duration:i.duration,ease:i.ease,timer:null,state:DD})}function vv(e,t){var n=ti(e,t);if(n.state>DD)throw new Error("too late; already scheduled");return n}function Ni(e,t){var n=ti(e,t);if(n.state>Mp)throw new Error("too late; already running");return n}function ti(e,t){var n=e.__transition;if(!n||!(n=n[t]))throw new Error("transition not found");return n}function Mie(e,t,n){var r=e.__transition,s;r[t]=n,n.timer=jD(i,0,n.time);function i(u){n.state=S2,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!==S2)return c();for(d in r)if(p=r[d],p.name===n.name){if(p.state===Mp)return N2(a);p.state===T2?(p.state=jp,p.timer.stop(),p.on.call("interrupt",e,e.__data__,p.index,p.group),delete r[d]):+dTE&&r.state=0&&(t=t.slice(0,n)),!t||t==="start"})}function uae(e,t,n){var r,s,i=cae(t)?vv:Ni;return function(){var a=i(this,e),o=a.on;o!==r&&(s=(r=o).copy()).on(t,n),a.on=s}}function dae(e,t){var n=this._id;return arguments.length<2?ti(this.node(),n).on.on(e):this.each(uae(n,e,t))}function fae(e){return function(){var t=this.parentNode;for(var n in this.__transition)if(+n!==e)return;t&&t.removeChild(this)}}function hae(){return this.on("end.remove",fae(this._id))}function pae(e){var t=this._name,n=this._id;typeof e!="function"&&(e=yv(e));for(var r=this._groups,s=r.length,i=new Array(s),a=0;a()=>e;function Fae(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 zi(e,t,n){this.k=e,this.x=t,this.y=n}zi.prototype={constructor:zi,scale:function(e){return e===1?this:new zi(this.k*e,this.x,this.y)},translate:function(e,t){return e===0&t===0?this:new zi(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 Xg=new zi(1,0,0);UD.prototype=zi.prototype;function UD(e){for(;!e.__zoom;)if(!(e=e.parentNode))return Xg;return e.__zoom}function Vy(e){e.stopImmediatePropagation()}function Nu(e){e.preventDefault(),e.stopImmediatePropagation()}function Uae(e){return(!e.ctrlKey||e.type==="wheel")&&!e.button}function $ae(){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 A2(){return this.__zoom||Xg}function Hae(e){return-e.deltaY*(e.deltaMode===1?.05:e.deltaMode?1:.002)*(e.ctrlKey?10:1)}function zae(){return navigator.maxTouchPoints||"ontouchstart"in this}function Vae(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 $D(){var e=Uae,t=$ae,n=Vae,r=Hae,s=zae,i=[0,1/0],a=[[-1/0,-1/0],[1/0,1/0]],o=250,c=Lp,u=Yg("start","zoom","end"),d,f,h,p=500,m=150,y=0,E=10;function g(M){M.property("__zoom",A2).on("wheel.zoom",S,{passive:!1}).on("mousedown.zoom",A).on("dblclick.zoom",O).filter(s).on("touchstart.zoom",D).on("touchmove.zoom",U).on("touchend.zoom touchcancel.zoom",X).style("-webkit-tap-highlight-color","rgba(0,0,0,0)")}g.transform=function(M,j,T,L){var R=M.selection?M.selection():M;R.property("__zoom",A2),M!==R?k(M,j,T,L):R.interrupt().each(function(){N(this,arguments).event(L).start().zoom(null,typeof j=="function"?j.apply(this,arguments):j).end()})},g.scaleBy=function(M,j,T,L){g.scaleTo(M,function(){var R=this.__zoom.k,F=typeof j=="function"?j.apply(this,arguments):j;return R*F},T,L)},g.scaleTo=function(M,j,T,L){g.transform(M,function(){var R=t.apply(this,arguments),F=this.__zoom,I=T==null?_(R):typeof T=="function"?T.apply(this,arguments):T,V=F.invert(I),W=typeof j=="function"?j.apply(this,arguments):j;return n(b(x(F,W),I,V),R,a)},T,L)},g.translateBy=function(M,j,T,L){g.transform(M,function(){return n(this.__zoom.translate(typeof j=="function"?j.apply(this,arguments):j,typeof T=="function"?T.apply(this,arguments):T),t.apply(this,arguments),a)},null,L)},g.translateTo=function(M,j,T,L,R){g.transform(M,function(){var F=t.apply(this,arguments),I=this.__zoom,V=L==null?_(F):typeof L=="function"?L.apply(this,arguments):L;return n(Xg.translate(V[0],V[1]).scale(I.k).translate(typeof j=="function"?-j.apply(this,arguments):-j,typeof T=="function"?-T.apply(this,arguments):-T),F,a)},L,R)};function x(M,j){return j=Math.max(i[0],Math.min(i[1],j)),j===M.k?M:new zi(j,M.x,M.y)}function b(M,j,T){var L=j[0]-T[0]*M.k,R=j[1]-T[1]*M.k;return L===M.x&&R===M.y?M:new zi(M.k,L,R)}function _(M){return[(+M[0][0]+ +M[1][0])/2,(+M[0][1]+ +M[1][1])/2]}function k(M,j,T,L){M.on("start.zoom",function(){N(this,arguments).event(L).start()}).on("interrupt.zoom end.zoom",function(){N(this,arguments).event(L).end()}).tween("zoom",function(){var R=this,F=arguments,I=N(R,F).event(L),V=t.apply(R,F),W=T==null?_(V):typeof T=="function"?T.apply(R,F):T,P=Math.max(V[1][0]-V[0][0],V[1][1]-V[0][1]),ie=R.__zoom,G=typeof j=="function"?j.apply(R,F):j,re=c(ie.invert(W).concat(P/ie.k),G.invert(W).concat(P/G.k));return function(ue){if(ue===1)ue=G;else{var ee=re(ue),le=P/ee[2];ue=new zi(le,W[0]-ee[0]*le,W[1]-ee[1]*le)}I.zoom(null,ue)}})}function N(M,j,T){return!T&&M.__zooming||new C(M,j)}function C(M,j){this.that=M,this.args=j,this.active=0,this.sourceEvent=null,this.extent=t.apply(M,j),this.taps=0}C.prototype={event:function(M){return M&&(this.sourceEvent=M),this},start:function(){return++this.active===1&&(this.that.__zooming=this,this.emit("start")),this},zoom:function(M,j){return this.mouse&&M!=="mouse"&&(this.mouse[1]=j.invert(this.mouse[0])),this.touch0&&M!=="touch"&&(this.touch0[1]=j.invert(this.touch0[0])),this.touch1&&M!=="touch"&&(this.touch1[1]=j.invert(this.touch1[0])),this.that.__zoom=j,this.emit("zoom"),this},end:function(){return--this.active===0&&(delete this.that.__zooming,this.emit("end")),this},emit:function(M){var j=Qr(this.that).datum();u.call(M,this.that,new Fae(M,{sourceEvent:this.sourceEvent,target:g,transform:this.that.__zoom,dispatch:u}),j)}};function S(M,...j){if(!e.apply(this,arguments))return;var T=N(this,j).event(M),L=this.__zoom,R=Math.max(i[0],Math.min(i[1],L.k*Math.pow(2,r.apply(this,arguments)))),F=Us(M);if(T.wheel)(T.mouse[0][0]!==F[0]||T.mouse[0][1]!==F[1])&&(T.mouse[1]=L.invert(T.mouse[0]=F)),clearTimeout(T.wheel);else{if(L.k===R)return;T.mouse=[F,L.invert(F)],Dp(this),T.start()}Nu(M),T.wheel=setTimeout(I,m),T.zoom("mouse",n(b(x(L,R),T.mouse[0],T.mouse[1]),T.extent,a));function I(){T.wheel=null,T.end()}}function A(M,...j){if(h||!e.apply(this,arguments))return;var T=M.currentTarget,L=N(this,j,!0).event(M),R=Qr(M.view).on("mousemove.zoom",W,!0).on("mouseup.zoom",P,!0),F=Us(M,T),I=M.clientX,V=M.clientY;kD(M.view),Vy(M),L.mouse=[F,this.__zoom.invert(F)],Dp(this),L.start();function W(ie){if(Nu(ie),!L.moved){var G=ie.clientX-I,re=ie.clientY-V;L.moved=G*G+re*re>y}L.event(ie).zoom("mouse",n(b(L.that.__zoom,L.mouse[0]=Us(ie,T),L.mouse[1]),L.extent,a))}function P(ie){R.on("mousemove.zoom mouseup.zoom",null),ND(ie.view,L.moved),Nu(ie),L.event(ie).end()}}function O(M,...j){if(e.apply(this,arguments)){var T=this.__zoom,L=Us(M.changedTouches?M.changedTouches[0]:M,this),R=T.invert(L),F=T.k*(M.shiftKey?.5:2),I=n(b(x(T,F),L,R),t.apply(this,j),a);Nu(M),o>0?Qr(this).transition().duration(o).call(k,I,L,M):Qr(this).call(g.transform,I,L,M)}}function D(M,...j){if(e.apply(this,arguments)){var T=M.touches,L=T.length,R=N(this,j,M.changedTouches.length===L).event(M),F,I,V,W;for(Vy(M),I=0;I`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.`},af=[[Number.NEGATIVE_INFINITY,Number.NEGATIVE_INFINITY],[Number.POSITIVE_INFINITY,Number.POSITIVE_INFINITY]],HD=["Enter"," ","Escape"],zD={"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 Ic;(function(e){e.Strict="strict",e.Loose="loose"})(Ic||(Ic={}));var Io;(function(e){e.Free="free",e.Vertical="vertical",e.Horizontal="horizontal"})(Io||(Io={}));var of;(function(e){e.Partial="partial",e.Full="full"})(of||(of={}));const VD={inProgress:!1,isValid:null,from:null,fromHandle:null,fromPosition:null,fromNode:null,to:null,toHandle:null,toPosition:null,toNode:null,pointer:null};var va;(function(e){e.Bezier="default",e.Straight="straight",e.Step="step",e.SmoothStep="smoothstep",e.SimpleBezier="simplebezier"})(va||(va={}));var Oc;(function(e){e.Arrow="arrow",e.ArrowClosed="arrowclosed"})(Oc||(Oc={}));var Pe;(function(e){e.Left="left",e.Top="top",e.Right="right",e.Bottom="bottom"})(Pe||(Pe={}));const C2={[Pe.Left]:Pe.Right,[Pe.Right]:Pe.Left,[Pe.Top]:Pe.Bottom,[Pe.Bottom]:Pe.Top};function KD(e){return e===null?null:e?"valid":"invalid"}const YD=e=>"id"in e&&"source"in e&&"target"in e,Kae=e=>"id"in e&&"position"in e&&!("source"in e)&&!("target"in e),kv=e=>"id"in e&&"internals"in e&&!("source"in e)&&!("target"in e),Pf=(e,t=[0,0])=>{const{width:n,height:r}=ia(e),s=e.origin??t,i=n*s[0],a=r*s[1];return{x:e.position.x-i,y:e.position.y-a}},Yae=(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):kv(s)?s:t.nodeLookup.get(s.id));const o=a?zm(a,t.nodeOrigin):{x:0,y:0,x2:0,y2:0};return Qg(r,o)},{x:1/0,y:1/0,x2:-1/0,y2:-1/0});return Zg(n)},Bf=(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=Qg(n,zm(s)),r=!0)}),r?Zg(n):{x:0,y:0,width:0,height:0}},Nv=(e,t,[n,r,s]=[0,0,1],i=!1,a=!1)=>{const o={...Zc(t,[n,r,s]),width:t.width/s,height:t.height/s},c=[];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=lf(o,Lc(u)),E=(p??0)*(m??0),g=i&&y>0;(!u.internals.handleBounds||g||y>=E||u.dragging)&&c.push(u)}return c},Wae=(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 Gae(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 qae({nodes:e,width:t,height:n,panZoom:r,minZoom:s,maxZoom:i},a){if(e.size===0)return!0;const o=Gae(e,a),c=Bf(o),u=Tv(c,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 WD({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:c,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",Zs.error005());else{const p=o.measured.width,m=o.measured.height;p&&m&&(f=[[c,u],[c+p,u+m]])}else o&&zo(a.extent)&&(f=[[a.extent[0][0]+c,a.extent[0][1]+u],[a.extent[1][0]+c,a.extent[1][1]+u]]);const h=zo(f)?Ho(t,f,a.measured):t;return(a.measured.width===void 0||a.measured.height===void 0)&&(i==null||i("015",Zs.error015())),{position:{x:h.x-c+(a.measured.width??0)*d[0],y:h.y-u+(a.measured.height??0)*d[1]},positionAbsolute:h}}async function Xae({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)),c=r.filter(h=>h.deletable!==!1),d=Wae(a,c);for(const h of c)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 Rc=(e,t=0,n=1)=>Math.min(Math.max(e,t),n),Ho=(e={x:0,y:0},t,n)=>({x:Rc(e.x,t[0][0],t[1][0]-((n==null?void 0:n.width)??0)),y:Rc(e.y,t[0][1],t[1][1]-((n==null?void 0:n.height)??0))});function GD(e,t,n){const{width:r,height:s}=ia(n),{x:i,y:a}=n.internals.positionAbsolute;return Ho(e,[[i,a],[i+r,a+s]],t)}const I2=(e,t,n)=>en?-Rc(Math.abs(e-n),1,t)/t:0,Sv=(e,t,n=15,r=40)=>{const s=I2(e.x,r,t.width-r)*n,i=I2(e.y,r,t.height-r)*n;return[s,i]},Qg=(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)}),CE=({x:e,y:t,width:n,height:r})=>({x:e,y:t,x2:e+n,y2:t+r}),Zg=({x:e,y:t,x2:n,y2:r})=>({x:e,y:t,width:n-e,height:r-t}),Lc=(e,t=[0,0])=>{var s,i;const{x:n,y:r}=kv(e)?e.internals.positionAbsolute:Pf(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}},zm=(e,t=[0,0])=>{var s,i;const{x:n,y:r}=kv(e)?e.internals.positionAbsolute:Pf(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)}},qD=(e,t)=>Zg(Qg(CE(e),CE(t))),lf=(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)},O2=e=>Vs(e.width)&&Vs(e.height)&&Vs(e.x)&&Vs(e.y),Vs=e=>!isNaN(e)&&isFinite(e),XD=(e,t)=>(n,r)=>{},Ff=(e,t=[1,1])=>({x:t[0]*Math.round(e.x/t[0]),y:t[1]*Math.round(e.y/t[1])}),Zc=({x:e,y:t},[n,r,s],i=!1,a=[1,1])=>{const o={x:(e-n)/s,y:(t-r)/s};return i?Ff(o,a):o},Mc=({x:e,y:t},[n,r,s])=>({x:e*s+n,y:t*s+r});function hl(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 Qae(e,t,n){if(typeof e=="string"||typeof e=="number"){const r=hl(e,n),s=hl(e,t);return{top:r,right:s,bottom:r,left:s,x:s*2,y:r*2}}if(typeof e=="object"){const r=hl(e.top??e.y??0,n),s=hl(e.bottom??e.y??0,n),i=hl(e.left??e.x??0,t),a=hl(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 Zae(e,t,n,r,s,i){const{x:a,y:o}=Mc(e,[t,n,r]),{x:c,y:u}=Mc({x:e.x+e.width,y:e.y+e.height},[t,n,r]),d=s-c,f=i-u;return{left:Math.floor(a),top:Math.floor(o),right:Math.floor(d),bottom:Math.floor(f)}}const Tv=(e,t,n,r,s,i)=>{const a=Qae(i,t,n),o=(t-a.x)/e.width,c=(n-a.y)/e.height,u=Math.min(o,c),d=Rc(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=Zae(e,p,m,d,t,n),E={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-E.left+E.right,y:m-E.top+E.bottom,zoom:d}},cf=()=>{var e;return typeof navigator<"u"&&((e=navigator==null?void 0:navigator.userAgent)==null?void 0:e.indexOf("Mac"))>=0};function zo(e){return e!=null&&e!=="parent"}function ia(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 Av(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 QD(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 R2(e,t){if(e.size!==t.size)return!1;for(const n of e)if(!t.has(n))return!1;return!0}function Jae(){let e,t;return{promise:new Promise((r,s)=>{e=r,t=s}),resolve:e,reject:t}}function eoe(e){return{...zD,...e||{}}}function bd(e,{snapGrid:t=[0,0],snapToGrid:n=!1,transform:r,containerBounds:s}){const{x:i,y:a}=Ks(e),o=Zc({x:i-((s==null?void 0:s.left)??0),y:a-((s==null?void 0:s.top)??0)},r),{x:c,y:u}=n?Ff(o,t):o;return{xSnapped:c,ySnapped:u,...o}}const Cv=e=>({width:e.offsetWidth,height:e.offsetHeight}),ZD=e=>{var t;return((t=e==null?void 0:e.getRootNode)==null?void 0:t.call(e))||(window==null?void 0:window.document)},toe=["INPUT","SELECT","TEXTAREA"];function JD(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:toe.includes(t.nodeName)||t.hasAttribute("contenteditable")||!!t.closest(".nokey")}const eP=e=>"clientX"in e,Ks=(e,t)=>{var i,a;const n=eP(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)}},L2=(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,...Cv(a)}})};function tP({sourceX:e,sourceY:t,targetX:n,targetY:r,sourceControlX:s,sourceControlY:i,targetControlX:a,targetControlY:o}){const c=e*.125+s*.375+a*.375+n*.125,u=t*.125+i*.375+o*.375+r*.125,d=Math.abs(c-e),f=Math.abs(u-t);return[c,u,d,f]}function qh(e,t){return e>=0?.5*e:t*25*Math.sqrt(-e)}function M2({pos:e,x1:t,y1:n,x2:r,y2:s,c:i}){switch(e){case Pe.Left:return[t-qh(t-r,i),n];case Pe.Right:return[t+qh(r-t,i),n];case Pe.Top:return[t,n-qh(n-s,i)];case Pe.Bottom:return[t,n+qh(s-n,i)]}}function nP({sourceX:e,sourceY:t,sourcePosition:n=Pe.Bottom,targetX:r,targetY:s,targetPosition:i=Pe.Top,curvature:a=.25}){const[o,c]=M2({pos:n,x1:e,y1:t,x2:r,y2:s,c:a}),[u,d]=M2({pos:i,x1:r,y1:s,x2:e,y2:t,c:a}),[f,h,p,m]=tP({sourceX:e,sourceY:t,targetX:r,targetY:s,sourceControlX:o,sourceControlY:c,targetControlX:u,targetControlY:d});return[`M${e},${t} C${o},${c} ${u},${d} ${r},${s}`,f,h,p,m]}function rP({sourceX:e,sourceY:t,targetX:n,targetY:r}){const s=Math.abs(n-e)/2,i=n0}const soe=({source:e,sourceHandle:t,target:n,targetHandle:r})=>`xy-edge__${e}${t||""}-${n}${r||""}`,ioe=(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)),aoe=(e,t,n={})=>{var i;if(!e.source||!e.target)return(i=n.onError)==null||i.call(n,"006",Zs.error006()),t;const r=n.getEdgeId||soe;let s;return YD(e)?s={...e}:s={...e,id:r(e)},ioe(s,t)?t:(s.sourceHandle===null&&delete s.sourceHandle,s.targetHandle===null&&delete s.targetHandle,t.concat(s))};function sP({sourceX:e,sourceY:t,targetX:n,targetY:r}){const[s,i,a,o]=rP({sourceX:e,sourceY:t,targetX:n,targetY:r});return[`M ${e},${t}L ${n},${r}`,s,i,a,o]}const j2={[Pe.Left]:{x:-1,y:0},[Pe.Right]:{x:1,y:0},[Pe.Top]:{x:0,y:-1},[Pe.Bottom]:{x:0,y:1}},ooe=({source:e,sourcePosition:t=Pe.Bottom,target:n})=>t===Pe.Left||t===Pe.Right?e.xMath.sqrt(Math.pow(t.x-e.x,2)+Math.pow(t.y-e.y,2));function loe({source:e,sourcePosition:t=Pe.Bottom,target:n,targetPosition:r=Pe.Top,center:s,offset:i,stepPosition:a}){const o=j2[t],c=j2[r],u={x:e.x+o.x*i,y:e.y+o.y*i},d={x:n.x+c.x*i,y:n.y+c.y*i},f=ooe({source:u,sourcePosition:t,target:d}),h=f.x!==0?"x":"y",p=f[h];let m=[],y,E;const g={x:0,y:0},x={x:0,y:0},[,,b,_]=rP({sourceX:e.x,sourceY:e.y,targetX:n.x,targetY:n.y});if(o[h]*c[h]===-1){h==="x"?(y=s.x??u.x+(d.x-u.x)*a,E=s.y??(u.y+d.y)/2):(y=s.x??(u.x+d.x)/2,E=s.y??u.y+(d.y-u.y)*a);const S=[{x:y,y:u.y},{x:y,y:d.y}],A=[{x:u.x,y:E},{x:d.x,y:E}];o[h]===p?m=h==="x"?S:A:m=h==="x"?A:S}else{const S=[{x:u.x,y:d.y}],A=[{x:d.x,y:u.y}];if(h==="x"?m=o.x===p?A:S:m=o.y===p?S:A,t===r){const M=Math.abs(e[h]-n[h]);if(M<=i){const j=Math.min(i-1,i-M);o[h]===p?g[h]=(u[h]>e[h]?-1:1)*j:x[h]=(d[h]>n[h]?-1:1)*j}}if(t!==r){const M=h==="x"?"y":"x",j=o[h]===c[M],T=u[M]>d[M],L=u[M]=X?(y=(O.x+D.x)/2,E=m[0].y):(y=m[0].x,E=(O.y+D.y)/2)}const k={x:u.x+g.x,y:u.y+g.y},N={x:d.x+x.x,y:d.y+x.y};return[[e,...k.x!==m[0].x||k.y!==m[0].y?[k]:[],...m,...N.x!==m[m.length-1].x||N.y!==m[m.length-1].y?[N]:[],n],y,E,b,_]}function coe(e,t,n,r){const s=Math.min(D2(e,t)/2,D2(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 IE(e,t){return e?typeof e=="string"?e:`${t?`${t}__`:""}${Object.keys(e).sort().map(r=>`${r}=${e[r]}`).join("&")}`:""}function doe(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(c=>{if(c&&typeof c=="object"){const u=IE(c,t);i.has(u)||(a.push({id:u,color:c.color||n,...c}),i.add(u))}}),a),[]).sort((a,o)=>a.id.localeCompare(o.id))}const iP=1e3,foe=10,Iv={nodeOrigin:[0,0],nodeExtent:af,elevateNodesOnSelect:!0,zIndexMode:"basic",defaults:{}},hoe={...Iv,checkEquality:!0};function Ov(e,t){const n={...e};for(const r in t)t[r]!==void 0&&(n[r]=t[r]);return n}function poe(e,t,n){const r=Ov(Iv,n);for(const s of e.values())if(s.parentId)Lv(s,e,t,r);else{const i=Pf(s,r.nodeOrigin),a=zo(s.extent)?s.extent:r.nodeExtent,o=Ho(i,a,ia(s));s.internals.positionAbsolute=o}}function moe(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 Rv(e){return e==="manual"}function OE(e,t,n,r={}){var d,f;const s=Ov(hoe,r),i={i:0},a=new Map(t),o=s!=null&&s.elevateNodesOnSelect&&!Rv(s.zIndexMode)?iP:0;let c=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=Pf(h,s.nodeOrigin),y=zo(h.extent)?h.extent:s.nodeExtent,E=Ho(m,y,ia(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:E,handleBounds:moe(h,p),z:aP(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&&(c=!1),h.parentId&&Lv(p,t,n,r,i),u||(u=h.selected??!1)}return{nodesInitialized:c,hasSelectedNodes:u}}function goe(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 Lv(e,t,n,r,s){const{elevateNodesOnSelect:i,nodeOrigin:a,nodeExtent:o,zIndexMode:c}=Ov(Iv,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}goe(e,n),s&&!d.parentId&&d.internals.rootParentIndex===void 0&&c==="auto"&&(d.internals.rootParentIndex=++s.i,d.internals.z=d.internals.z+s.i*foe),s&&d.internals.rootParentIndex!==void 0&&(s.i=d.internals.rootParentIndex);const f=i&&!Rv(c)?iP:0,{x:h,y:p,z:m}=yoe(e,d,a,o,f,c),{positionAbsolute:y}=e.internals,E=h!==y.x||p!==y.y;(E||m!==e.internals.z)&&t.set(e.id,{...e,internals:{...e.internals,positionAbsolute:E?{x:h,y:p}:y,z:m}})}function aP(e,t,n){const r=Vs(e.zIndex)?e.zIndex:0;return Rv(n)?r:r+(e.selected?t:0)}function yoe(e,t,n,r,s,i){const{x:a,y:o}=t.internals.positionAbsolute,c=ia(e),u=Pf(e,n),d=zo(e.extent)?Ho(u,e.extent,c):u;let f=Ho({x:a+d.x,y:o+d.y},r,c);e.extent==="parent"&&(f=GD(f,c,t));const h=aP(e,s,i),p=t.internals.z??0;return{x:f.x,y:f.y,z:p>=h?p+1:h}}function Mv(e,t,n,r=[0,0]){var a;const s=[],i=new Map;for(const o of e){const c=t.get(o.parentId);if(!c)continue;const u=((a=i.get(o.parentId))==null?void 0:a.expandedRect)??Lc(c),d=qD(u,o.rect);i.set(o.parentId,{expandedRect:d,parent:c})}return i.size>0&&i.forEach(({expandedRect:o,parent:c},u)=>{var b;const d=c.internals.positionAbsolute,f=ia(c),h=c.origin??r,p=o.x0||m>0||g||x)&&(s.push({id:u,type:"position",position:{x:c.position.x-p+g,y:c.position.y-m+x}}),(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=Mv(h,t,n,s);u.push(...p)}return{changes:u,updatedInternals:c}}async function Eoe({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 U2(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 c=r.get(a)||new Map;if(r.set(a,c.set(n,t)),i){a=`${s}-${e}-${i}`;const u=r.get(a)||new Map;r.set(a,u.set(n,t))}}function oP(e,t,n){e.clear(),t.clear();for(const r of n){const{source:s,target:i,sourceHandle:a=null,targetHandle:o=null}=r,c={edgeId:r.id,source:s,target:i,sourceHandle:a,targetHandle:o},u=`${s}-${a}--${i}-${o}`,d=`${i}-${o}--${s}-${a}`;U2("source",c,d,e,s,a),U2("target",c,u,e,i,o),t.set(r.id,r)}}function lP(e,t){if(!e.parentId)return!1;const n=t.get(e.parentId);return n?n.selected?!0:lP(n,t):!1}function $2(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 xoe(e,t,n,r){const s=new Map;for(const[i,a]of e)if((a.selected||a.id===r)&&(!a.parentId||!lP(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 Ky({nodeId:e,dragItems:t,nodeLookup:n,dragging:r=!0}){var a,o,c;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:((c=t.get(e))==null?void 0:c.position)||i.position,dragging:r}:s[0],s]}function woe({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=Ff(i,t);return{x:a.x-i.x,y:a.y-i.y}}function voe({onNodeMouseDown:e,getStoreItems:t,onDragStart:n,onDrag:r,onDragStop:s}){let i={x:null,y:null},a=0,o=new Map,c=!1,u={x:0,y:0},d=null,f=!1,h=null,p=!1,m=!1,y=null;function E({noDragClassName:x,handleSelector:b,domNode:_,isSelectable:k,nodeId:N,nodeClickDistance:C=0}){h=Qr(_);function S({x:U,y:X}){const{nodeLookup:M,nodeExtent:j,snapGrid:T,snapToGrid:L,nodeOrigin:R,onNodeDrag:F,onSelectionDrag:I,onError:V,updateNodePositions:W}=t();i={x:U,y:X};let P=!1;const ie=o.size>1,G=ie&&j?CE(Bf(o)):null,re=ie&&L?woe({dragItems:o,snapGrid:T,x:U,y:X}):null;for(const[ue,ee]of o){if(!M.has(ue))continue;let le={x:U-ee.distance.x,y:X-ee.distance.y};L&&(le=re?{x:Math.round(le.x+re.x),y:Math.round(le.y+re.y)}:Ff(le,T));let ne=null;if(ie&&j&&!ee.extent&&G){const{positionAbsolute:te}=ee.internals,de=te.x-G.x+j[0][0],Ee=te.x+ee.measured.width-G.x2+j[1][0],Te=te.y-G.y+j[0][1],Ke=te.y+ee.measured.height-G.y2+j[1][1];ne=[[de,Te],[Ee,Ke]]}const{position:me,positionAbsolute:ye}=WD({nodeId:ue,nextPosition:le,nodeLookup:M,nodeExtent:ne||j,nodeOrigin:R,onError:V});P=P||ee.position.x!==me.x||ee.position.y!==me.y,ee.position=me,ee.internals.positionAbsolute=ye}if(m=m||P,!!P&&(W(o,!0),y&&(r||F||!N&&I))){const[ue,ee]=Ky({nodeId:N,dragItems:o,nodeLookup:M});r==null||r(y,o,ue,ee),F==null||F(y,ue,ee),N||I==null||I(y,ee)}}async function A(){if(!d)return;const{transform:U,panBy:X,autoPanSpeed:M,autoPanOnNodeDrag:j}=t();if(!j){c=!1,cancelAnimationFrame(a);return}const[T,L]=Sv(u,d,M);(T!==0||L!==0)&&(i.x=(i.x??0)-T/U[2],i.y=(i.y??0)-L/U[2],await X({x:T,y:L})&&S(i)),a=requestAnimationFrame(A)}function O(U){var ie;const{nodeLookup:X,multiSelectionActive:M,nodesDraggable:j,transform:T,snapGrid:L,snapToGrid:R,selectNodesOnDrag:F,onNodeDragStart:I,onSelectionDragStart:V,unselectNodesAndEdges:W}=t();f=!0,(!F||!k)&&!M&&N&&((ie=X.get(N))!=null&&ie.selected||W()),k&&F&&N&&(e==null||e(N));const P=bd(U.sourceEvent,{transform:T,snapGrid:L,snapToGrid:R,containerBounds:d});if(i=P,o=xoe(X,j,P,N),o.size>0&&(n||I||!N&&V)){const[G,re]=Ky({nodeId:N,dragItems:o,nodeLookup:X});n==null||n(U.sourceEvent,o,G,re),I==null||I(U.sourceEvent,G,re),N||V==null||V(U.sourceEvent,re)}}const D=SD().clickDistance(C).on("start",U=>{const{domNode:X,nodeDragThreshold:M,transform:j,snapGrid:T,snapToGrid:L}=t();d=(X==null?void 0:X.getBoundingClientRect())||null,p=!1,m=!1,y=U.sourceEvent,M===0&&O(U),i=bd(U.sourceEvent,{transform:j,snapGrid:T,snapToGrid:L,containerBounds:d}),u=Ks(U.sourceEvent,d)}).on("drag",U=>{const{autoPanOnNodeDrag:X,transform:M,snapGrid:j,snapToGrid:T,nodeDragThreshold:L,nodeLookup:R}=t(),F=bd(U.sourceEvent,{transform:M,snapGrid:j,snapToGrid:T,containerBounds:d});if(y=U.sourceEvent,(U.sourceEvent.type==="touchmove"&&U.sourceEvent.touches.length>1||N&&!R.has(N))&&(p=!0),!p){if(!c&&X&&f&&(c=!0,A()),!f){const I=Ks(U.sourceEvent,d),V=I.x-u.x,W=I.y-u.y;Math.sqrt(V*V+W*W)>L&&O(U)}(i.x!==F.xSnapped||i.y!==F.ySnapped)&&o&&f&&(u=Ks(U.sourceEvent,d),S(F))}}).on("end",U=>{if(!f||p){p&&o.size>0&&t().updateNodePositions(o,!1);return}if(c=!1,f=!1,cancelAnimationFrame(a),o.size>0){const{nodeLookup:X,updateNodePositions:M,onNodeDragStop:j,onSelectionDragStop:T}=t();if(m&&(M(o,!1),m=!1),s||j||!N&&T){const[L,R]=Ky({nodeId:N,dragItems:o,nodeLookup:X,dragging:!1});s==null||s(U.sourceEvent,o,L,R),j==null||j(U.sourceEvent,L,R),N||T==null||T(U.sourceEvent,R)}}}).filter(U=>{const X=U.target;return!U.button&&(!x||!$2(X,`.${x}`,_))&&(!b||$2(X,b,_))});h.call(D)}function g(){h==null||h.on(".drag",null)}return{update:E,destroy:g}}function _oe(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())lf(s,Lc(i))>0&&r.push(i);return r}const koe=250;function Noe(e,t,n,r){var o,c;let s=[],i=1/0;const a=_oe(e,n,t+koe);for(const u of a){const d=[...((o=u.internals.handleBounds)==null?void 0:o.source)??[],...((c=u.internals.handleBounds)==null?void 0:c.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}=Vo(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 cP(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)??[]],c=(n?o==null?void 0:o.find(h=>h.id===n):o==null?void 0:o[0])??null;return c&&i?{...c,...Vo(a,c,c.position,!0)}:c}function uP(e,t){return e||(t!=null&&t.classList.contains("target")?"target":t!=null&&t.classList.contains("source")?"source":null)}function Soe(e,t){let n=null;return t?n=!0:e&&!t&&(n=!1),n}const dP=()=>!0;function Toe(e,{connectionMode:t,connectionRadius:n,handleId:r,nodeId:s,edgeUpdaterType:i,isTarget:a,domNode:o,nodeLookup:c,lib:u,autoPanOnConnect:d,flowId:f,panBy:h,cancelConnection:p,onConnectStart:m,onConnect:y,onConnectEnd:E,isValidConnection:g=dP,onReconnectEnd:x,updateConnection:b,getTransform:_,getFromHandle:k,autoPanSpeed:N,dragThreshold:C=1,handleDomNode:S}){const A=ZD(e.target);let O=0,D;const{x:U,y:X}=Ks(e),M=uP(i,S),j=o==null?void 0:o.getBoundingClientRect();let T=!1;if(!j||!M)return;const L=cP(s,M,r,c,t);if(!L)return;let R=Ks(e,j),F=!1,I=null,V=!1,W=null;function P(){if(!d||!j)return;const[me,ye]=Sv(R,j,N);h({x:me,y:ye}),O=requestAnimationFrame(P)}const ie={...L,nodeId:s,type:M,position:L.position},G=c.get(s);let ue={inProgress:!0,isValid:null,from:Vo(G,ie,Pe.Left,!0),fromHandle:ie,fromPosition:ie.position,fromNode:G,to:R,toHandle:null,toPosition:C2[ie.position],toNode:null,pointer:R};function ee(){T=!0,b(ue),m==null||m(e,{nodeId:s,handleId:r,handleType:M})}C===0&&ee();function le(me){if(!T){const{x:Ke,y:Ne}=Ks(me),it=Ke-U,He=Ne-X;if(!(it*it+He*He>C*C))return;ee()}if(!k()||!ie){ne(me);return}const ye=_();R=Ks(me,j),D=Noe(Zc(R,ye,!1,[1,1]),n,c,ie),F||(P(),F=!0);const te=fP(me,{handle:D,connectionMode:t,fromNodeId:s,fromHandleId:r,fromType:a?"target":"source",isValidConnection:g,doc:A,lib:u,flowId:f,nodeLookup:c});W=te.handleDomNode,I=te.connection,V=Soe(!!D,te.isValid);const de=c.get(s),Ee=de?Vo(de,ie,Pe.Left,!0):ue.from,Te={...ue,from:Ee,isValid:V,to:te.toHandle&&V?Mc({x:te.toHandle.x,y:te.toHandle.y},ye):R,toHandle:te.toHandle,toPosition:V&&te.toHandle?te.toHandle.position:C2[ie.position],toNode:te.toHandle?c.get(te.toHandle.nodeId):null,pointer:R};b(Te),ue=Te}function ne(me){if(!("touches"in me&&me.touches.length>0)){if(T){(D||W)&&I&&V&&(y==null||y(I));const{inProgress:ye,...te}=ue,de={...te,toPosition:ue.toHandle?ue.toPosition:null};E==null||E(me,de),i&&(x==null||x(me,de))}p(),cancelAnimationFrame(O),F=!1,V=!1,I=null,W=null,A.removeEventListener("mousemove",le),A.removeEventListener("mouseup",ne),A.removeEventListener("touchmove",le),A.removeEventListener("touchend",ne)}}A.addEventListener("mousemove",le),A.addEventListener("mouseup",ne),A.addEventListener("touchmove",le),A.addEventListener("touchend",ne)}function fP(e,{handle:t,connectionMode:n,fromNodeId:r,fromHandleId:s,fromType:i,doc:a,lib:o,flowId:c,isValidConnection:u=dP,nodeLookup:d}){const f=i==="target",h=t?a.querySelector(`.${o}-flow__handle[data-id="${c}-${t==null?void 0:t.nodeId}-${t==null?void 0:t.id}-${t==null?void 0:t.type}"]`):null,{x:p,y:m}=Ks(e),y=a.elementFromPoint(p,m),E=y!=null&&y.classList.contains(`${o}-flow__handle`)?y:h,g={handleDomNode:E,isValid:!1,connection:null,toHandle:null};if(E){const x=uP(void 0,E),b=E.getAttribute("data-nodeid"),_=E.getAttribute("data-handleid"),k=E.classList.contains("connectable"),N=E.classList.contains("connectableend");if(!b||!x)return g;const C={source:f?b:r,sourceHandle:f?_:s,target:f?r:b,targetHandle:f?s:_};g.connection=C;const A=k&&N&&(n===Ic.Strict?f&&x==="source"||!f&&x==="target":b!==r||_!==s);g.isValid=A&&u(C),g.toHandle=cP(b,x,_,d,n,!0)}return g}const RE={onPointerDown:Toe,isValid:fP};function Aoe({domNode:e,panZoom:t,getTransform:n,getViewScale:r}){const s=Qr(e);function i({translateExtent:o,width:c,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&&cf()?10:1,N=-b.sourceEvent.deltaY*(b.sourceEvent.deltaMode===1?.05:b.sourceEvent.deltaMode?1:.002)*d,C=_[2]*Math.pow(2,N*k);t.scaleTo(C)};let y=[0,0];const E=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],N=[k[0]-y[0],k[1]-y[1]];y=k;const C=r()*Math.max(_[2],Math.log(_[2]))*(p?-1:1),S={x:_[0]-N[0]*C,y:_[1]-N[1]*C},A=[[0,0],[c,u]];t.setViewportConstrained({x:S.x,y:S.y,zoom:_[2]},A,o)},x=$D().on("start",E).on("zoom",f?g:null).on("zoom.wheel",h?m:null);s.call(x,{})}function a(){s.on("zoom",null)}return{update:i,destroy:a,pointer:Us}}const Jg=e=>({x:e.x,y:e.y,zoom:e.k}),Yy=({x:e,y:t,zoom:n})=>Xg.translate(e,t).scale(n),$l=(e,t)=>e.target.closest(`.${t}`),hP=(e,t)=>t===2&&Array.isArray(e)&&e.includes(2),Coe=e=>((e*=2)<=1?e*e*e:(e-=2)*e*e+2)/2,Wy=(e,t=0,n=Coe,r=()=>{})=>{const s=typeof t=="number"&&t>0;return s||r(),s?e.transition().duration(t).ease(n).on("end",r):e},pP=e=>{const t=e.ctrlKey&&cf()?10:1;return-e.deltaY*(e.deltaMode===1?.05:e.deltaMode?1:.002)*t};function Ioe({zoomPanValues:e,noWheelClassName:t,d3Selection:n,d3Zoom:r,panOnScrollMode:s,panOnScrollSpeed:i,zoomOnPinch:a,onPanZoomStart:o,onPanZoom:c,onPanZoomEnd:u}){return d=>{if($l(d,t))return d.ctrlKey&&d.preventDefault(),!1;d.preventDefault(),d.stopImmediatePropagation();const f=n.property("__zoom").k||1;if(d.ctrlKey&&a){const E=Us(d),g=pP(d),x=f*Math.pow(2,g);r.scaleTo(n,x,E,d);return}const h=d.deltaMode===1?20:1;let p=s===Io.Vertical?0:d.deltaX*h,m=s===Io.Horizontal?0:d.deltaY*h;!cf()&&d.shiftKey&&s!==Io.Vertical&&(p=d.deltaY*h,m=0),r.translateBy(n,-(p/f)*i,-(m/f)*i,{internal:!0});const y=Jg(n.property("__zoom"));clearTimeout(e.panScrollTimeout),e.isPanScrolling?(c==null||c(d,y),e.panScrollTimeout=setTimeout(()=>{u==null||u(d,y),e.isPanScrolling=!1},150)):(e.isPanScrolling=!0,o==null||o(d,y))}}function Ooe({noWheelClassName:e,preventScrolling:t,d3ZoomHandler:n}){return function(r,s){const i=r.type==="wheel",a=!t&&i&&!r.ctrlKey,o=$l(r,e);if(r.ctrlKey&&i&&o&&r.preventDefault(),a||o)return null;r.preventDefault(),n.call(this,r,s)}}function Roe({zoomPanValues:e,onDraggingChange:t,onPanZoomStart:n}){return r=>{var i,a,o;if((i=r.sourceEvent)!=null&&i.internal)return;const s=Jg(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 Loe({zoomPanValues:e,panOnDrag:t,onPaneContextMenu:n,onTransformChange:r,onPanZoom:s}){return i=>{var a,o;e.usedRightMouseButton=!!(n&&hP(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,Jg(i.transform)))}}function Moe({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&&hP(t,e.mouseButton??0)&&!e.usedRightMouseButton&&a.sourceEvent&&i(a.sourceEvent),e.usedRightMouseButton=!1,r(!1),s)){const c=Jg(a.transform);e.prevViewport=c,clearTimeout(e.timerId),e.timerId=setTimeout(()=>{s==null||s(a.sourceEvent,c)},n?150:0)}}}function joe({zoomActivationKeyPressed:e,zoomOnScroll:t,zoomOnPinch:n,panOnDrag:r,panOnScroll:s,zoomOnDoubleClick:i,userSelectionActive:a,noWheelClassName:o,noPanClassName:c,lib:u,connectionInProgress:d}){return f=>{var E;const h=e||t,p=n&&f.ctrlKey,m=f.type==="wheel";if(f.button===1&&f.type==="mousedown"&&($l(f,`${u}-flow__node`)||$l(f,`${u}-flow__edge`)))return!0;if(!r&&!h&&!s&&!i&&!n||a||d&&!m||$l(f,o)&&m||$l(f,c)&&(!m||s&&m&&!e)||!n&&f.ctrlKey&&m)return!1;if(!n&&f.type==="touchstart"&&((E=f.touches)==null?void 0:E.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 Doe({domNode:e,minZoom:t,maxZoom:n,translateExtent:r,viewport:s,onPanZoom:i,onPanZoomStart:a,onPanZoomEnd:o,onDraggingChange:c}){const u={isZoomingOrPanning:!1,usedRightMouseButton:!1,prevViewport:{},mouseButton:0,timerId:void 0,panScrollTimeout:void 0,isPanScrolling:!1},d=e.getBoundingClientRect(),f=$D().scaleExtent([t,n]).translateExtent(r),h=Qr(e).call(f);x({x:s.x,y:s.y,zoom:Rc(s.zoom,t,n)},[[0,0],[d.width,d.height]],r);const p=h.on("wheel.zoom"),m=h.on("dblclick.zoom");f.wheelDelta(pP);async function y(D,U){return h?new Promise(X=>{f==null||f.interpolate((U==null?void 0:U.interpolate)==="linear"?yd:Lp).transform(Wy(h,U==null?void 0:U.duration,U==null?void 0:U.ease,()=>X(!0)),D)}):!1}function E({noWheelClassName:D,noPanClassName:U,onPaneContextMenu:X,userSelectionActive:M,panOnScroll:j,panOnDrag:T,panOnScrollMode:L,panOnScrollSpeed:R,preventScrolling:F,zoomOnPinch:I,zoomOnScroll:V,zoomOnDoubleClick:W,zoomActivationKeyPressed:P,lib:ie,onTransformChange:G,connectionInProgress:re,paneClickDistance:ue,selectionOnDrag:ee}){M&&!u.isZoomingOrPanning&&g();const le=j&&!P&&!M;f.clickDistance(ee?1/0:!Vs(ue)||ue<0?0:ue);const ne=le?Ioe({zoomPanValues:u,noWheelClassName:D,d3Selection:h,d3Zoom:f,panOnScrollMode:L,panOnScrollSpeed:R,zoomOnPinch:I,onPanZoomStart:a,onPanZoom:i,onPanZoomEnd:o}):Ooe({noWheelClassName:D,preventScrolling:F,d3ZoomHandler:p});h.on("wheel.zoom",ne,{passive:!1});const me=Roe({zoomPanValues:u,onDraggingChange:c,onPanZoomStart:a});f.on("start",me);const ye=Loe({zoomPanValues:u,panOnDrag:T,onPaneContextMenu:!!X,onPanZoom:i,onTransformChange:G});f.on("zoom",ye);const te=Moe({zoomPanValues:u,panOnDrag:T,panOnScroll:j,onPaneContextMenu:X,onPanZoomEnd:o,onDraggingChange:c});f.on("end",te);const de=joe({zoomActivationKeyPressed:P,panOnDrag:T,zoomOnScroll:V,panOnScroll:j,zoomOnDoubleClick:W,zoomOnPinch:I,userSelectionActive:M,noPanClassName:U,noWheelClassName:D,lib:ie,connectionInProgress:re});f.filter(de),W?h.on("dblclick.zoom",m):h.on("dblclick.zoom",null)}function g(){f.on("zoom",null)}async function x(D,U,X){const M=Yy(D),j=f==null?void 0:f.constrain()(M,U,X);return j&&await y(j),j}async function b(D,U){const X=Yy(D);return await y(X,U),X}function _(D){if(h){const U=Yy(D),X=h.property("__zoom");(X.k!==D.zoom||X.x!==D.x||X.y!==D.y)&&(f==null||f.transform(h,U,null,{sync:!0}))}}function k(){const D=h?UD(h.node()):{x:0,y:0,k:1};return{x:D.x,y:D.y,zoom:D.k}}async function N(D,U){return h?new Promise(X=>{f==null||f.interpolate((U==null?void 0:U.interpolate)==="linear"?yd:Lp).scaleTo(Wy(h,U==null?void 0:U.duration,U==null?void 0:U.ease,()=>X(!0)),D)}):!1}async function C(D,U){return h?new Promise(X=>{f==null||f.interpolate((U==null?void 0:U.interpolate)==="linear"?yd:Lp).scaleBy(Wy(h,U==null?void 0:U.duration,U==null?void 0:U.ease,()=>X(!0)),D)}):!1}function S(D){f==null||f.scaleExtent(D)}function A(D){f==null||f.translateExtent(D)}function O(D){const U=!Vs(D)||D<0?0:D;f==null||f.clickDistance(U)}return{update:E,destroy:g,setViewport:b,setViewportConstrained:x,getViewport:k,scaleTo:N,scaleBy:C,setScaleExtent:S,setTranslateExtent:A,syncViewport:_,setClickDistance:O}}var jc;(function(e){e.Line="line",e.Handle="handle"})(jc||(jc={}));function Poe({width:e,prevWidth:t,height:n,prevHeight:r,affectsX:s,affectsY:i}){const a=e-t,o=n-r,c=[a>0?1:a<0?-1:0,o>0?1:o<0?-1:0];return a&&s&&(c[0]=c[0]*-1),o&&i&&(c[1]=c[1]*-1),c}function H2(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 ua(e,t){return Math.max(0,t-e)}function da(e,t){return Math.max(0,e-t)}function Xh(e,t,n){return Math.max(0,t-e,e-n)}function z2(e,t){return e?!t:t}function Boe(e,t,n,r,s,i,a,o){let{affectsX:c,affectsY:u}=t;const{isHorizontal:d,isVertical:f}=t,h=d&&f,{xSnapped:p,ySnapped:m}=n,{minWidth:y,maxWidth:E,minHeight:g,maxHeight:x}=r,{x:b,y:_,width:k,height:N,aspectRatio:C}=e;let S=Math.floor(d?p-e.pointerX:0),A=Math.floor(f?m-e.pointerY:0);const O=k+(c?-S:S),D=N+(u?-A:A),U=-i[0]*k,X=-i[1]*N;let M=Xh(O,y,E),j=Xh(D,g,x);if(a){let R=0,F=0;c&&S<0?R=ua(b+S+U,a[0][0]):!c&&S>0&&(R=da(b+O+U,a[1][0])),u&&A<0?F=ua(_+A+X,a[0][1]):!u&&A>0&&(F=da(_+D+X,a[1][1])),M=Math.max(M,R),j=Math.max(j,F)}if(o){let R=0,F=0;c&&S>0?R=da(b+S,o[0][0]):!c&&S<0&&(R=ua(b+O,o[1][0])),u&&A>0?F=da(_+A,o[0][1]):!u&&A<0&&(F=ua(_+D,o[1][1])),M=Math.max(M,R),j=Math.max(j,F)}if(s){if(d){const R=Xh(O/C,g,x)*C;if(M=Math.max(M,R),a){let F=0;!c&&!u||c&&!u&&h?F=da(_+X+O/C,a[1][1])*C:F=ua(_+X+(c?S:-S)/C,a[0][1])*C,M=Math.max(M,F)}if(o){let F=0;!c&&!u||c&&!u&&h?F=ua(_+O/C,o[1][1])*C:F=da(_+(c?S:-S)/C,o[0][1])*C,M=Math.max(M,F)}}if(f){const R=Xh(D*C,y,E)/C;if(j=Math.max(j,R),a){let F=0;!c&&!u||u&&!c&&h?F=da(b+D*C+U,a[1][0])/C:F=ua(b+(u?A:-A)*C+U,a[0][0])/C,j=Math.max(j,F)}if(o){let F=0;!c&&!u||u&&!c&&h?F=ua(b+D*C,o[1][0])/C:F=da(b+(u?A:-A)*C,o[0][0])/C,j=Math.max(j,F)}}}A=A+(A<0?j:-j),S=S+(S<0?M:-M),s&&(h?O>D*C?A=(z2(c,u)?-S:S)/C:S=(z2(c,u)?-A:A)*C:d?(A=S/C,u=c):(S=A*C,c=u));const T=c?b+S:b,L=u?_+A:_;return{width:k+(c?-S:S),height:N+(u?-A:A),x:i[0]*S*(c?-1:1)+T,y:i[1]*A*(u?-1:1)+L}}const mP={width:0,height:0,x:0,y:0},Foe={...mP,pointerX:0,pointerY:0,aspectRatio:1};function Uoe(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,c=n[1]*a;return[[r-o,s-c],[r+i-o,s+a-c]]}function $oe({domNode:e,nodeId:t,getStoreItems:n,onChange:r,onEnd:s}){const i=Qr(e);let a={controlDirection:H2("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:E}){let g={...mP},x={...Foe};a={boundaries:d,resizeDirection:h,keepAspectRatio:f,controlDirection:H2(u)};let b,_=null,k=[],N,C,S,A=!1;const O=SD().on("start",D=>{const{nodeLookup:U,transform:X,snapGrid:M,snapToGrid:j,nodeOrigin:T,paneDomNode:L}=n();if(b=U.get(t),!b)return;_=(L==null?void 0:L.getBoundingClientRect())??null;const{xSnapped:R,ySnapped:F}=bd(D.sourceEvent,{transform:X,snapGrid:M,snapToGrid:j,containerBounds:_});g={width:b.measured.width??0,height:b.measured.height??0,x:b.position.x??0,y:b.position.y??0},x={...g,pointerX:R,pointerY:F,aspectRatio:g.width/g.height},N=void 0,C=zo(b.extent)?b.extent:void 0,b.parentId&&(b.extent==="parent"||b.expandParent)&&(N=U.get(b.parentId)),N&&b.extent==="parent"&&(C=[[0,0],[N.measured.width,N.measured.height]]),k=[],S=void 0;for(const[I,V]of U)if(V.parentId===t&&(k.push({id:I,position:{...V.position},extent:V.extent}),V.extent==="parent"||V.expandParent)){const W=Uoe(V,b,V.origin??T);S?S=[[Math.min(W[0][0],S[0][0]),Math.min(W[0][1],S[0][1])],[Math.max(W[1][0],S[1][0]),Math.max(W[1][1],S[1][1])]]:S=W}p==null||p(D,{...g})}).on("drag",D=>{const{transform:U,snapGrid:X,snapToGrid:M,nodeOrigin:j}=n(),T=bd(D.sourceEvent,{transform:U,snapGrid:X,snapToGrid:M,containerBounds:_}),L=[];if(!b)return;const{x:R,y:F,width:I,height:V}=g,W={},P=b.origin??j,{width:ie,height:G,x:re,y:ue}=Boe(x,a.controlDirection,T,a.boundaries,a.keepAspectRatio,P,C,S),ee=ie!==I,le=G!==V,ne=re!==R&&ee,me=ue!==F&≤if(!ne&&!me&&!ee&&!le)return;if((ne||me||P[0]===1||P[1]===1)&&(W.x=ne?re:g.x,W.y=me?ue:g.y,g.x=W.x,g.y=W.y,k.length>0)){const Ee=re-R,Te=ue-F;for(const Ke of k)Ke.position={x:Ke.position.x-Ee+P[0]*(ie-I),y:Ke.position.y-Te+P[1]*(G-V)},L.push(Ke)}if((ee||le)&&(W.width=ee&&(!a.resizeDirection||a.resizeDirection==="horizontal")?ie:g.width,W.height=le&&(!a.resizeDirection||a.resizeDirection==="vertical")?G:g.height,g.width=W.width,g.height=W.height),N&&b.expandParent){const Ee=P[0]*(W.width??0);W.x&&W.x{A&&(y==null||y(D,{...g}),s==null||s({...g}),A=!1)});i.call(O)}function c(){i.on(".drag",null)}return{update:o,destroy:c}}var gP={exports:{}},yP={},bP={exports:{}},EP={};/** - * @license React - * use-sync-external-store-shim.production.js - * - * Copyright (c) Meta Platforms, Inc. and affiliates. - * - * This source code is licensed under the MIT license found in the - * LICENSE file in the root directory of this source tree. - */var Dc=w;function Hoe(e,t){return e===t&&(e!==0||1/e===1/t)||e!==e&&t!==t}var zoe=typeof Object.is=="function"?Object.is:Hoe,Voe=Dc.useState,Koe=Dc.useEffect,Yoe=Dc.useLayoutEffect,Woe=Dc.useDebugValue;function Goe(e,t){var n=t(),r=Voe({inst:{value:n,getSnapshot:t}}),s=r[0].inst,i=r[1];return Yoe(function(){s.value=n,s.getSnapshot=t,Gy(s)&&i({inst:s})},[e,n,t]),Koe(function(){return Gy(s)&&i({inst:s}),e(function(){Gy(s)&&i({inst:s})})},[e]),Woe(n),n}function Gy(e){var t=e.getSnapshot;e=e.value;try{var n=t();return!zoe(e,n)}catch{return!0}}function qoe(e,t){return t()}var Xoe=typeof window>"u"||typeof window.document>"u"||typeof window.document.createElement>"u"?qoe:Goe;EP.useSyncExternalStore=Dc.useSyncExternalStore!==void 0?Dc.useSyncExternalStore:Xoe;bP.exports=EP;var Qoe=bP.exports;/** - * @license React - * use-sync-external-store-shim/with-selector.production.js - * - * Copyright (c) Meta Platforms, Inc. and affiliates. - * - * This source code is licensed under the MIT license found in the - * LICENSE file in the root directory of this source tree. - */var e0=w,Zoe=Qoe;function Joe(e,t){return e===t&&(e!==0||1/e===1/t)||e!==e&&t!==t}var ele=typeof Object.is=="function"?Object.is:Joe,tle=Zoe.useSyncExternalStore,nle=e0.useRef,rle=e0.useEffect,sle=e0.useMemo,ile=e0.useDebugValue;yP.useSyncExternalStoreWithSelector=function(e,t,n,r,s){var i=nle(null);if(i.current===null){var a={hasValue:!1,value:null};i.current=a}else a=i.current;i=sle(function(){function c(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,ele(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 c(t())},h===null?void 0:function(){return c(h())}]},[t,n,r,s]);var o=tle(e,i[0],i[1]);return rle(function(){a.hasValue=!0,a.value=o},[o]),ile(o),o};gP.exports=yP;var ale=gP.exports;const ole=pf(ale),lle={},V2=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,c={setState:r,getState:s,getInitialState:()=>u,subscribe:d=>(n.add(d),()=>n.delete(d)),destroy:()=>{(lle?"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,c);return c},cle=e=>e?V2(e):V2,{useDebugValue:ule}=dt,{useSyncExternalStoreWithSelector:dle}=ole,fle=e=>e;function xP(e,t=fle,n){const r=dle(e.subscribe,e.getState,e.getServerState||e.getInitialState,t,n);return ule(r),r}const K2=(e,t)=>{const n=cle(e),r=(s,i=t)=>xP(n,s,i);return Object.assign(r,n),r},hle=(e,t)=>e?K2(e,t):K2;function en(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 t0=w.createContext(null),ple=t0.Provider,wP=Zs.error001("react");function wt(e,t){const n=w.useContext(t0);if(n===null)throw new Error(wP);return xP(n,e,t)}function tn(){const e=w.useContext(t0);if(e===null)throw new Error(wP);return w.useMemo(()=>({getState:e.getState,setState:e.setState,subscribe:e.subscribe}),[e])}const Y2={display:"none"},mle={position:"absolute",width:1,height:1,margin:-1,border:0,padding:0,overflow:"hidden",clip:"rect(0px, 0px, 0px, 0px)",clipPath:"inset(100%)"},vP="react-flow__node-desc",_P="react-flow__edge-desc",gle="react-flow__aria-live",yle=e=>e.ariaLiveMessage,ble=e=>e.ariaLabelConfig;function Ele({rfId:e}){const t=wt(yle);return l.jsx("div",{id:`${gle}-${e}`,"aria-live":"assertive","aria-atomic":"true",style:mle,children:t})}function xle({rfId:e,disableKeyboardA11y:t}){const n=wt(ble);return l.jsxs(l.Fragment,{children:[l.jsx("div",{id:`${vP}-${e}`,style:Y2,children:t?n["node.a11yDescription.default"]:n["node.a11yDescription.keyboardDisabled"]}),l.jsx("div",{id:`${_P}-${e}`,style:Y2,children:n["edge.a11yDescription.default"]}),!t&&l.jsx(Ele,{rfId:e})]})}const n0=w.forwardRef(({position:e="top-left",children:t,className:n,style:r,...s},i)=>{const a=`${e}`.split("-");return l.jsx("div",{className:Ln(["react-flow__panel",n,...a]),style:r,ref:i,...s,children:t})});n0.displayName="Panel";function wle({proOptions:e,position:t="bottom-right"}){return e!=null&&e.hideAttribution?null:l.jsx(n0,{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:l.jsx("a",{href:"https://reactflow.dev",target:"_blank",rel:"noopener noreferrer","aria-label":"React Flow attribution",children:"React Flow"})})}const vle=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}},Qh=e=>e.id;function _le(e,t){return en(e.selectedNodes.map(Qh),t.selectedNodes.map(Qh))&&en(e.selectedEdges.map(Qh),t.selectedEdges.map(Qh))}function kle({onSelectionChange:e}){const t=tn(),{selectedNodes:n,selectedEdges:r}=wt(vle,_le);return w.useEffect(()=>{const s={nodes:n,edges:r};e==null||e(s),t.getState().onSelectionChangeHandlers.forEach(i=>i(s))},[n,r,e]),null}const Nle=e=>!!e.onSelectionChangeHandlers;function Sle({onSelectionChange:e}){const t=wt(Nle);return e||t?l.jsx(kle,{onSelectionChange:e}):null}const kP=[0,0],Tle={x:0,y:0,zoom:1},Ale=["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"],W2=[...Ale,"rfId"],Cle=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}),G2={translateExtent:af,nodeOrigin:kP,minZoom:.5,maxZoom:2,elementsSelectable:!0,noPanClassName:"nopan",rfId:"1"};function Ile(e){const{setNodes:t,setEdges:n,setMinZoom:r,setMaxZoom:s,setTranslateExtent:i,setNodeExtent:a,reset:o,setDefaultNodesAndEdges:c}=wt(Cle,en),u=tn();w.useEffect(()=>(c(e.defaultNodes,e.defaultEdges),()=>{d.current=G2,o()}),[]);const d=w.useRef(G2);return w.useEffect(()=>{for(const f of W2){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:eoe(h)}):f==="fitView"?u.setState({fitViewQueued:h}):f==="fitViewOptions"?u.setState({fitViewOptions:h}):u.setState({[f]:h})))}d.current=e},W2.map(f=>e[f])),null}function q2(){return typeof window>"u"||!window.matchMedia?null:window.matchMedia("(prefers-color-scheme: dark)")}function Ole(e){var r;const[t,n]=w.useState(e==="system"?null:e);return w.useEffect(()=>{if(e!=="system"){n(e);return}const s=q2(),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=q2())!=null&&r.matches?"dark":"light"}const X2=typeof document<"u"?document:null;function uf(e=null,t={target:X2,actInsideInputWithModifier:!0}){const[n,r]=w.useState(!1),s=w.useRef(!1),i=w.useRef(new Set([])),[a,o]=w.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 w.useEffect(()=>{const c=(t==null?void 0:t.target)??X2,u=(t==null?void 0:t.actInsideInputWithModifier)??!0;if(e!==null){const d=p=>{var E,g;if(s.current=p.ctrlKey||p.metaKey||p.shiftKey||p.altKey,(!s.current||s.current&&!u)&&JD(p))return!1;const y=Z2(p.code,o);if(i.current.add(p[y]),Q2(a,i.current,!1)){const x=((g=(E=p.composedPath)==null?void 0:E.call(p))==null?void 0:g[0])||p.target,b=(x==null?void 0:x.nodeName)==="BUTTON"||(x==null?void 0:x.nodeName)==="A";t.preventDefault!==!1&&(s.current||!b)&&p.preventDefault(),r(!0)}},f=p=>{const m=Z2(p.code,o);Q2(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 c==null||c.addEventListener("keydown",d),c==null||c.addEventListener("keyup",f),window.addEventListener("blur",h),window.addEventListener("contextmenu",h),()=>{c==null||c.removeEventListener("keydown",d),c==null||c.removeEventListener("keyup",f),window.removeEventListener("blur",h),window.removeEventListener("contextmenu",h)}}},[e,r]),n}function Q2(e,t,n){return e.filter(r=>n||r.length===t.size).some(r=>r.every(s=>t.has(s)))}function Z2(e,t){return t.includes(e)?"code":"key"}const Rle=()=>{const e=tn();return w.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(),c=Tv(t,r,s,i,a,(n==null?void 0:n.padding)??.1);return o?(await o.setViewport(c,{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:c}=a.getBoundingClientRect(),u={x:t.x-o,y:t.y-c},d=n.snapGrid??s,f=n.snapToGrid??i;return Zc(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=Mc(t,n);return{x:a.x+s,y:a.y+i}}}),[])};function NP(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 c of a)Lle(c,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 Lle(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 SP(e,t){return NP(e,t)}function TP(e,t){return NP(e,t)}function lo(e,t){return{id:e,type:"select",selected:t}}function Hl(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(lo(i.id,a)))}return r}function J2({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),c=((s=o==null?void 0:o.internals)==null?void 0:s.userNode)??o;c!==void 0&&c!==a&&n.push({id:a.id,item:a,type:"replace"}),c===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 eA(e){return{id:e.id,type:"remove"}}const Mle=XD();function AP(e,t,n={}){return aoe(e,t,{...n,onError:n.onError??Mle})}const tA=e=>Kae(e),jle=e=>YD(e);function CP(e){return w.forwardRef(e)}const Dle=typeof window<"u"?w.useLayoutEffect:w.useEffect;function nA(e){const[t,n]=w.useState(BigInt(0)),[r]=w.useState(()=>Ple(()=>n(s=>s+BigInt(1))));return Dle(()=>{const s=r.get();s.length&&(e(s),r.reset())},[t]),r}function Ple(e){let t=[];return{get:()=>t,reset:()=>{t=[]},push:n=>{t.push(n),e()}}}const IP=w.createContext(null);function Ble({children:e}){const t=tn(),n=w.useCallback(o=>{const{nodes:c=[],setNodes:u,hasDefaultNodes:d,onNodesChange:f,nodeLookup:h,fitViewQueued:p,onNodesChangeMiddlewareMap:m}=t.getState();let y=c;for(const g of o)y=typeof g=="function"?g(y):g;let E=J2({items:y,lookup:h});for(const g of m.values())E=g(E);d&&u(y),E.length>0?f==null||f(E):p&&window.requestAnimationFrame(()=>{const{fitViewQueued:g,nodes:x,setNodes:b}=t.getState();g&&b(x)})},[]),r=nA(n),s=w.useCallback(o=>{const{edges:c=[],setEdges:u,hasDefaultEdges:d,onEdgesChange:f,edgeLookup:h}=t.getState();let p=c;for(const m of o)p=typeof m=="function"?m(p):m;d?u(p):f&&f(J2({items:p,lookup:h}))},[]),i=nA(s),a=w.useMemo(()=>({nodeQueue:r,edgeQueue:i}),[]);return l.jsx(IP.Provider,{value:a,children:e})}function Fle(){const e=w.useContext(IP);if(!e)throw new Error("useBatchContext must be used within a BatchProvider");return e}const Ule=e=>!!e.panZoom;function r0(){const e=Rle(),t=tn(),n=Fle(),r=wt(Ule),s=w.useMemo(()=>{const i=f=>t.getState().nodeLookup.get(f),a=f=>{n.nodeQueue.push(f)},o=f=>{n.edgeQueue.push(f)},c=f=>{var g,x;const{nodeLookup:h,nodeOrigin:p}=t.getState(),m=tA(f)?f:h.get(f.id),y=m.parentId?QD(m.position,m.measured,m.parentId,h,p):m.position,E={...m,position:y,width:((g=m.measured)==null?void 0:g.width)??m.width,height:((x=m.measured)==null?void 0:x.height)??m.height};return Lc(E)},u=(f,h,p={replace:!1})=>{a(m=>m.map(y=>{if(y.id===f){const E=typeof h=="function"?h(y):h;return p.replace&&tA(E)?E:{...y,...E}}return y}))},d=(f,h,p={replace:!1})=>{o(m=>m.map(y=>{if(y.id===f){const E=typeof h=="function"?h(y):h;return p.replace&&jle(E)?E:{...y,...E}}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,E]=p;return{nodes:f.map(g=>({...g})),edges:h.map(g=>({...g})),viewport:{x:m,y,zoom:E}}},deleteElements:async({nodes:f=[],edges:h=[]})=>{const{nodes:p,edges:m,onNodesDelete:y,onEdgesDelete:E,triggerNodeChanges:g,triggerEdgeChanges:x,onDelete:b,onBeforeDelete:_}=t.getState(),{nodes:k,edges:N}=await Xae({nodesToRemove:f,edgesToRemove:h,nodes:p,edges:m,onBeforeDelete:_}),C=N.length>0,S=k.length>0;if(C){const A=N.map(eA);E==null||E(N),x(A)}if(S){const A=k.map(eA);y==null||y(k),g(A)}return(S||C)&&(b==null||b({nodes:k,edges:N})),{deletedNodes:k,deletedEdges:N}},getIntersectingNodes:(f,h=!0,p)=>{const m=O2(f),y=m?f:c(f),E=p!==void 0;return y?(p||t.getState().nodes).filter(g=>{const x=t.getState().nodeLookup.get(g.id);if(x&&!m&&(g.id===f.id||!x.internals.positionAbsolute))return!1;const b=Lc(E?g:x),_=lf(b,y);return h&&_>0||_>=b.width*b.height||_>=y.width*y.height}):[]},isNodeIntersecting:(f,h,p=!0)=>{const y=O2(f)?f:c(f);if(!y)return!1;const E=lf(y,h);return p&&E>0||E>=h.width*h.height||E>=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 Yae(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??Jae();return t.setState({fitViewQueued:!0,fitViewOptions:f,fitViewResolver:h}),n.nodeQueue.push(p=>[...p]),h.promise}}},[]);return w.useMemo(()=>({...s,...e,viewportInitialized:r}),[r])}const rA=e=>e.selected,$le=typeof window<"u"?window:void 0;function Hle({deleteKeyCode:e,multiSelectionKeyCode:t}){const n=tn(),{deleteElements:r}=r0(),s=uf(e,{actInsideInputWithModifier:!1}),i=uf(t,{target:$le});w.useEffect(()=>{if(s){const{edges:a,nodes:o}=n.getState();r({nodes:o.filter(rA),edges:a.filter(rA)}),n.setState({nodesSelectionActive:!1})}},[s]),w.useEffect(()=>{n.setState({multiSelectionActive:i})},[i])}function zle(e){const t=tn();w.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=Cv(e.current);(r.height===0||r.width===0)&&((o=(a=t.getState()).onError)==null||o.call(a,"004",Zs.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 s0={position:"absolute",width:"100%",height:"100%",top:0,left:0},Vle=e=>({userSelectionActive:e.userSelectionActive,lib:e.lib,connectionInProgress:e.connection.inProgress});function Kle({onPaneContextMenu:e,zoomOnScroll:t=!0,zoomOnPinch:n=!0,panOnScroll:r=!1,panOnScrollSpeed:s=.5,panOnScrollMode:i=Io.Free,zoomOnDoubleClick:a=!0,panOnDrag:o=!0,defaultViewport:c,translateExtent:u,minZoom:d,maxZoom:f,zoomActivationKeyCode:h,preventScrolling:p=!0,children:m,noWheelClassName:y,noPanClassName:E,onViewportChange:g,isControlledViewport:x,paneClickDistance:b,selectionOnDrag:_}){const k=tn(),N=w.useRef(null),{userSelectionActive:C,lib:S,connectionInProgress:A}=wt(Vle,en),O=uf(h),D=w.useRef();zle(N);const U=w.useCallback(X=>{g==null||g({x:X[0],y:X[1],zoom:X[2]}),x||k.setState({transform:X})},[g,x]);return w.useEffect(()=>{if(N.current){D.current=Doe({domNode:N.current,minZoom:d,maxZoom:f,translateExtent:u,viewport:c,onDraggingChange:T=>k.setState(L=>L.paneDragging===T?L:{paneDragging:T}),onPanZoomStart:(T,L)=>{const{onViewportChangeStart:R,onMoveStart:F}=k.getState();F==null||F(T,L),R==null||R(L)},onPanZoom:(T,L)=>{const{onViewportChange:R,onMove:F}=k.getState();F==null||F(T,L),R==null||R(L)},onPanZoomEnd:(T,L)=>{const{onViewportChangeEnd:R,onMoveEnd:F}=k.getState();F==null||F(T,L),R==null||R(L)}});const{x:X,y:M,zoom:j}=D.current.getViewport();return k.setState({panZoom:D.current,transform:[X,M,j],domNode:N.current.closest(".react-flow")}),()=>{var T;(T=D.current)==null||T.destroy()}}},[]),w.useEffect(()=>{var X;(X=D.current)==null||X.update({onPaneContextMenu:e,zoomOnScroll:t,zoomOnPinch:n,panOnScroll:r,panOnScrollSpeed:s,panOnScrollMode:i,zoomOnDoubleClick:a,panOnDrag:o,zoomActivationKeyPressed:O,preventScrolling:p,noPanClassName:E,userSelectionActive:C,noWheelClassName:y,lib:S,onTransformChange:U,connectionInProgress:A,selectionOnDrag:_,paneClickDistance:b})},[e,t,n,r,s,i,a,o,O,p,E,C,y,S,U,A,_,b]),l.jsx("div",{className:"react-flow__renderer",ref:N,style:s0,children:m})}const Yle=e=>({userSelectionActive:e.userSelectionActive,userSelectionRect:e.userSelectionRect});function Wle(){const{userSelectionActive:e,userSelectionRect:t}=wt(Yle,en);return e&&t?l.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 qy=(e,t)=>n=>{n.target===t.current&&(e==null||e(n))},Gle=e=>({userSelectionActive:e.userSelectionActive,elementsSelectable:e.elementsSelectable,connectionInProgress:e.connection.inProgress,dragging:e.paneDragging,panBy:e.panBy,autoPanSpeed:e.autoPanSpeed});function qle({isSelecting:e,selectionKeyPressed:t,selectionMode:n=of.Full,panOnDrag:r,autoPanOnSelection:s,paneClickDistance:i,selectionOnDrag:a,onSelectionStart:o,onSelectionEnd:c,onPaneClick:u,onPaneContextMenu:d,onPaneScroll:f,onPaneMouseEnter:h,onPaneMouseMove:p,onPaneMouseLeave:m,children:y}){const E=w.useRef(0),g=tn(),{userSelectionActive:x,elementsSelectable:b,dragging:_,connectionInProgress:k,panBy:N,autoPanSpeed:C}=wt(Gle,en),S=b&&(e||x),A=w.useRef(null),O=w.useRef(),D=w.useRef(new Set),U=w.useRef(new Set),X=w.useRef(!1),M=w.useRef({x:0,y:0}),j=w.useRef(!1),T=ee=>{if(X.current||k){X.current=!1;return}u==null||u(ee),g.getState().resetSelectedElements(),g.setState({nodesSelectionActive:!1})},L=ee=>{if(Array.isArray(r)&&(r!=null&&r.includes(2))){ee.preventDefault();return}d==null||d(ee)},R=f?ee=>f(ee):void 0,F=ee=>{X.current&&(ee.stopPropagation(),X.current=!1)},I=ee=>{var Ke,Ne;const{domNode:le,transform:ne}=g.getState();if(O.current=le==null?void 0:le.getBoundingClientRect(),!O.current)return;const me=ee.target===A.current;if(!me&&!!ee.target.closest(".nokey")||!e||!(a&&me||t)||ee.button!==0||!ee.isPrimary)return;(Ne=(Ke=ee.target)==null?void 0:Ke.setPointerCapture)==null||Ne.call(Ke,ee.pointerId),X.current=!1;const{x:de,y:Ee}=Ks(ee.nativeEvent,O.current),Te=Zc({x:de,y:Ee},ne);g.setState({userSelectionRect:{width:0,height:0,startX:Te.x,startY:Te.y,x:de,y:Ee}}),me||(ee.stopPropagation(),ee.preventDefault())};function V(ee,le){const{userSelectionRect:ne}=g.getState();if(!ne)return;const{transform:me,nodeLookup:ye,edgeLookup:te,connectionLookup:de,triggerNodeChanges:Ee,triggerEdgeChanges:Te,defaultEdgeOptions:Ke}=g.getState(),Ne={x:ne.startX,y:ne.startY},{x:it,y:He}=Mc(Ne,me),Ue={startX:Ne.x,startY:Ne.y,x:eect.id)),U.current=new Set;const St=(Ke==null?void 0:Ke.selectable)??!0;for(const ct of D.current){const B=de.get(ct);if(B)for(const{edgeId:Q}of B.values()){const oe=te.get(Q);oe&&(oe.selectable??St)&&U.current.add(Q)}}if(!R2(Et,D.current)){const ct=Hl(ye,D.current,!0);Ee(ct)}if(!R2(rt,U.current)){const ct=Hl(te,U.current);Te(ct)}g.setState({userSelectionRect:Ue,userSelectionActive:!0,nodesSelectionActive:!1})}function W(){if(!s||!O.current)return;const[ee,le]=Sv(M.current,O.current,C);N({x:ee,y:le}).then(ne=>{if(!X.current||!ne){E.current=requestAnimationFrame(W);return}const{x:me,y:ye}=M.current;V(me,ye),E.current=requestAnimationFrame(W)})}const P=()=>{cancelAnimationFrame(E.current),E.current=0,j.current=!1};w.useEffect(()=>()=>P(),[]);const ie=ee=>{const{userSelectionRect:le,transform:ne,resetSelectedElements:me}=g.getState();if(!O.current||!le)return;const{x:ye,y:te}=Ks(ee.nativeEvent,O.current);M.current={x:ye,y:te};const de=Mc({x:le.startX,y:le.startY},ne);if(!X.current){const Ee=t?0:i;if(Math.hypot(ye-de.x,te-de.y)<=Ee)return;me(),o==null||o(ee)}X.current=!0,j.current||(W(),j.current=!0),V(ye,te)},G=ee=>{var le,ne;ee.button===0&&((ne=(le=ee.target)==null?void 0:le.releasePointerCapture)==null||ne.call(le,ee.pointerId),!x&&ee.target===A.current&&g.getState().userSelectionRect&&(T==null||T(ee)),g.setState({userSelectionActive:!1,userSelectionRect:null}),X.current&&(c==null||c(ee),g.setState({nodesSelectionActive:D.current.size>0})),P())},re=ee=>{var le,ne;(ne=(le=ee.target)==null?void 0:le.releasePointerCapture)==null||ne.call(le,ee.pointerId),P()},ue=r===!0||Array.isArray(r)&&r.includes(0);return l.jsxs("div",{className:Ln(["react-flow__pane",{draggable:ue,dragging:_,selection:e}]),onClick:S?void 0:qy(T,A),onContextMenu:qy(L,A),onWheel:qy(R,A),onPointerEnter:S?void 0:h,onPointerMove:S?ie:p,onPointerUp:S?G:void 0,onPointerCancel:S?re:void 0,onPointerDownCapture:S?I:void 0,onClickCapture:S?F:void 0,onPointerLeave:m,ref:A,style:s0,children:[y,l.jsx(Wle,{})]})}function LE({id:e,store:t,unselect:n=!1,nodeRef:r}){const{addSelectedNodes:s,unselectNodesAndEdges:i,multiSelectionActive:a,nodeLookup:o,onError:c}=t.getState(),u=o.get(e);if(!u){c==null||c("012",Zs.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 OP({nodeRef:e,disabled:t=!1,noDragClassName:n,handleSelector:r,nodeId:s,isSelectable:i,nodeClickDistance:a}){const o=tn(),[c,u]=w.useState(!1),d=w.useRef();return w.useEffect(()=>{d.current=voe({getStoreItems:()=>o.getState(),onNodeMouseDown:f=>{LE({id:f,store:o,nodeRef:e})},onDragStart:()=>{u(!0)},onDragStop:()=>{u(!1)}})},[]),w.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]),c}const Xle=e=>t=>t.selected&&(t.draggable||e&&typeof t.draggable>"u");function RP(){const e=tn();return w.useCallback(n=>{const{nodeExtent:r,snapToGrid:s,snapGrid:i,nodesDraggable:a,onError:o,updateNodePositions:c,nodeLookup:u,nodeOrigin:d}=e.getState(),f=new Map,h=Xle(a),p=s?i[0]:5,m=s?i[1]:5,y=n.direction.x*p*n.factor,E=n.direction.y*m*n.factor;for(const[,g]of u){if(!h(g))continue;let x={x:g.internals.positionAbsolute.x+y,y:g.internals.positionAbsolute.y+E};s&&(x=Ff(x,i));const{position:b,positionAbsolute:_}=WD({nodeId:g.id,nextPosition:x,nodeLookup:u,nodeExtent:r,nodeOrigin:d,onError:o});g.position=b,g.internals.positionAbsolute=_,f.set(g.id,g)}c(f)},[])}const jv=w.createContext(null),Qle=jv.Provider;jv.Consumer;const LP=()=>w.useContext(jv),Zle=e=>({connectOnClick:e.connectOnClick,noPanClassName:e.noPanClassName,rfId:e.rfId}),Jle=(e,t,n)=>r=>{const{connectionClickStartHandle:s,connectionMode:i,connection:a}=r,{fromHandle:o,toHandle:c,isValid:u}=a,d=(c==null?void 0:c.nodeId)===e&&(c==null?void 0:c.id)===t&&(c==null?void 0:c.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===Ic.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 ece({type:e="source",position:t=Pe.Top,isValidConnection:n,isConnectable:r=!0,isConnectableStart:s=!0,isConnectableEnd:i=!0,id:a,onConnect:o,children:c,className:u,onMouseDown:d,onTouchStart:f,...h},p){var j,T;const m=a||null,y=e==="target",E=tn(),g=LP(),{connectOnClick:x,noPanClassName:b,rfId:_}=wt(Zle,en),{connectingFrom:k,connectingTo:N,clickConnecting:C,isPossibleEndHandle:S,connectionInProcess:A,clickConnectionInProcess:O,valid:D}=wt(Jle(g,m,e),en);g||(T=(j=E.getState()).onError)==null||T.call(j,"010",Zs.error010());const U=L=>{const{defaultEdgeOptions:R,onConnect:F,hasDefaultEdges:I}=E.getState(),V={...R,...L};if(I){const{edges:W,setEdges:P,onError:ie}=E.getState();P(AP(V,W,{onError:ie}))}F==null||F(V),o==null||o(V)},X=L=>{if(!g)return;const R=eP(L.nativeEvent);if(s&&(R&&L.button===0||!R)){const F=E.getState();RE.onPointerDown(L.nativeEvent,{handleDomNode:L.currentTarget,autoPanOnConnect:F.autoPanOnConnect,connectionMode:F.connectionMode,connectionRadius:F.connectionRadius,domNode:F.domNode,nodeLookup:F.nodeLookup,lib:F.lib,isTarget:y,handleId:m,nodeId:g,flowId:F.rfId,panBy:F.panBy,cancelConnection:F.cancelConnection,onConnectStart:F.onConnectStart,onConnectEnd:(...I)=>{var V,W;return(W=(V=E.getState()).onConnectEnd)==null?void 0:W.call(V,...I)},updateConnection:F.updateConnection,onConnect:U,isValidConnection:n||((...I)=>{var V,W;return((W=(V=E.getState()).isValidConnection)==null?void 0:W.call(V,...I))??!0}),getTransform:()=>E.getState().transform,getFromHandle:()=>E.getState().connection.fromHandle,autoPanSpeed:F.autoPanSpeed,dragThreshold:F.connectionDragThreshold})}R?d==null||d(L):f==null||f(L)},M=L=>{const{onClickConnectStart:R,onClickConnectEnd:F,connectionClickStartHandle:I,connectionMode:V,isValidConnection:W,lib:P,rfId:ie,nodeLookup:G,connection:re}=E.getState();if(!g||!I&&!s)return;if(!I){R==null||R(L.nativeEvent,{nodeId:g,handleId:m,handleType:e}),E.setState({connectionClickStartHandle:{nodeId:g,type:e,id:m}});return}const ue=ZD(L.target),ee=n||W,{connection:le,isValid:ne}=RE.isValid(L.nativeEvent,{handle:{nodeId:g,id:m,type:e},connectionMode:V,fromNodeId:I.nodeId,fromHandleId:I.id||null,fromType:I.type,isValidConnection:ee,flowId:ie,doc:ue,lib:P,nodeLookup:G});ne&&le&&U(le);const me=structuredClone(re);delete me.inProgress,me.toPosition=me.toHandle?me.toHandle.position:null,F==null||F(L,me),E.setState({connectionClickStartHandle:null})};return l.jsx("div",{"data-handleid":m,"data-nodeid":g,"data-handlepos":t,"data-id":`${_}-${g}-${m}-${e}`,className:Ln(["react-flow__handle",`react-flow__handle-${t}`,"nodrag",b,u,{source:!y,target:y,connectable:r,connectablestart:s,connectableend:i,clickconnecting:C,connectingfrom:k,connectingto:N,valid:D,connectionindicator:r&&(!A||S)&&(A||O?i:s)}]),onMouseDown:X,onTouchStart:X,onClick:x?M:void 0,ref:p,...h,children:c})}const mr=w.memo(CP(ece));function tce({data:e,isConnectable:t,sourcePosition:n=Pe.Bottom}){return l.jsxs(l.Fragment,{children:[e==null?void 0:e.label,l.jsx(mr,{type:"source",position:n,isConnectable:t})]})}function nce({data:e,isConnectable:t,targetPosition:n=Pe.Top,sourcePosition:r=Pe.Bottom}){return l.jsxs(l.Fragment,{children:[l.jsx(mr,{type:"target",position:n,isConnectable:t}),e==null?void 0:e.label,l.jsx(mr,{type:"source",position:r,isConnectable:t})]})}function rce(){return null}function sce({data:e,isConnectable:t,targetPosition:n=Pe.Top}){return l.jsxs(l.Fragment,{children:[l.jsx(mr,{type:"target",position:n,isConnectable:t}),e==null?void 0:e.label]})}const Km={ArrowUp:{x:0,y:-1},ArrowDown:{x:0,y:1},ArrowLeft:{x:-1,y:0},ArrowRight:{x:1,y:0}},sA={input:tce,default:nce,output:sce,group:rce};function ice(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 ace=e=>{const{width:t,height:n,x:r,y:s}=Bf(e.nodeLookup,{filter:i=>!!i.selected});return{width:Vs(t)?t:null,height:Vs(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 oce({onSelectionContextMenu:e,noPanClassName:t,disableKeyboardA11y:n}){const r=tn(),{width:s,height:i,transformString:a,userSelectionActive:o}=wt(ace,en),c=RP(),u=w.useRef(null);w.useEffect(()=>{var p;n||(p=u.current)==null||p.focus({preventScroll:!0})},[n]);const d=!o&&s!==null&&i!==null;if(OP({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(Km,p.key)&&(p.preventDefault(),c({direction:Km[p.key],factor:p.shiftKey?4:1}))};return l.jsx("div",{className:Ln(["react-flow__nodesselection","react-flow__container",t]),style:{transform:a},children:l.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 iA=typeof window<"u"?window:void 0,lce=e=>({nodesSelectionActive:e.nodesSelectionActive,userSelectionActive:e.userSelectionActive});function MP({children:e,onPaneClick:t,onPaneMouseEnter:n,onPaneMouseMove:r,onPaneMouseLeave:s,onPaneContextMenu:i,onPaneScroll:a,paneClickDistance:o,deleteKeyCode:c,selectionKeyCode:u,selectionOnDrag:d,selectionMode:f,onSelectionStart:h,onSelectionEnd:p,multiSelectionKeyCode:m,panActivationKeyCode:y,zoomActivationKeyCode:E,elementsSelectable:g,zoomOnScroll:x,zoomOnPinch:b,panOnScroll:_,panOnScrollSpeed:k,panOnScrollMode:N,zoomOnDoubleClick:C,panOnDrag:S,autoPanOnSelection:A,defaultViewport:O,translateExtent:D,minZoom:U,maxZoom:X,preventScrolling:M,onSelectionContextMenu:j,noWheelClassName:T,noPanClassName:L,disableKeyboardA11y:R,onViewportChange:F,isControlledViewport:I}){const{nodesSelectionActive:V,userSelectionActive:W}=wt(lce,en),P=uf(u,{target:iA}),ie=uf(y,{target:iA}),G=ie||S,re=ie||_,ue=d&&G!==!0,ee=P||W||ue;return Hle({deleteKeyCode:c,multiSelectionKeyCode:m}),l.jsx(Kle,{onPaneContextMenu:i,elementsSelectable:g,zoomOnScroll:x,zoomOnPinch:b,panOnScroll:re,panOnScrollSpeed:k,panOnScrollMode:N,zoomOnDoubleClick:C,panOnDrag:!P&&G,defaultViewport:O,translateExtent:D,minZoom:U,maxZoom:X,zoomActivationKeyCode:E,preventScrolling:M,noWheelClassName:T,noPanClassName:L,onViewportChange:F,isControlledViewport:I,paneClickDistance:o,selectionOnDrag:ue,children:l.jsxs(qle,{onSelectionStart:h,onSelectionEnd:p,onPaneClick:t,onPaneMouseEnter:n,onPaneMouseMove:r,onPaneMouseLeave:s,onPaneContextMenu:i,onPaneScroll:a,panOnDrag:G,autoPanOnSelection:A,isSelecting:!!ee,selectionMode:f,selectionKeyPressed:P,paneClickDistance:o,selectionOnDrag:ue,children:[e,V&&l.jsx(oce,{onSelectionContextMenu:j,noPanClassName:L,disableKeyboardA11y:R})]})})}MP.displayName="FlowRenderer";const cce=w.memo(MP),uce=e=>t=>e?Nv(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 dce(e){return wt(w.useCallback(uce(e),[e]),en)}const fce=e=>e.updateNodeInternals;function hce(){const e=wt(fce),[t]=w.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 w.useEffect(()=>()=>{t==null||t.disconnect()},[t]),t}function pce({node:e,nodeType:t,hasDimensions:n,resizeObserver:r}){const s=tn(),i=w.useRef(null),a=w.useRef(null),o=w.useRef(e.sourcePosition),c=w.useRef(e.targetPosition),u=w.useRef(t),d=n&&!!e.internals.handleBounds;return w.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]),w.useEffect(()=>()=>{a.current&&(r==null||r.unobserve(a.current),a.current=null)},[]),w.useEffect(()=>{if(i.current){const f=u.current!==t,h=o.current!==e.sourcePosition,p=c.current!==e.targetPosition;(f||h||p)&&(u.current=t,o.current=e.sourcePosition,c.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 mce({id:e,onClick:t,onMouseEnter:n,onMouseMove:r,onMouseLeave:s,onContextMenu:i,onDoubleClick:a,nodesDraggable:o,elementsSelectable:c,nodesConnectable:u,nodesFocusable:d,resizeObserver:f,noDragClassName:h,noPanClassName:p,disableKeyboardA11y:m,rfId:y,nodeTypes:E,nodeClickDistance:g,onError:x}){const{node:b,internals:_,isParent:k}=wt(ee=>{const le=ee.nodeLookup.get(e),ne=ee.parentLookup.has(e);return{node:le,internals:le.internals,isParent:ne}},en);let N=b.type||"default",C=(E==null?void 0:E[N])||sA[N];C===void 0&&(x==null||x("003",Zs.error003(N)),N="default",C=(E==null?void 0:E.default)||sA.default);const S=!!(b.draggable||o&&typeof b.draggable>"u"),A=!!(b.selectable||c&&typeof b.selectable>"u"),O=!!(b.connectable||u&&typeof b.connectable>"u"),D=!!(b.focusable||d&&typeof b.focusable>"u"),U=tn(),X=Av(b),M=pce({node:b,nodeType:N,hasDimensions:X,resizeObserver:f}),j=OP({nodeRef:M,disabled:b.hidden||!S,noDragClassName:h,handleSelector:b.dragHandle,nodeId:e,isSelectable:A,nodeClickDistance:g}),T=RP();if(b.hidden)return null;const L=ia(b),R=ice(b),F=A||S||t||n||r||s,I=n?ee=>n(ee,{..._.userNode}):void 0,V=r?ee=>r(ee,{..._.userNode}):void 0,W=s?ee=>s(ee,{..._.userNode}):void 0,P=i?ee=>i(ee,{..._.userNode}):void 0,ie=a?ee=>a(ee,{..._.userNode}):void 0,G=ee=>{const{selectNodesOnDrag:le,nodeDragThreshold:ne}=U.getState();A&&(!le||!S||ne>0)&&LE({id:e,store:U,nodeRef:M}),t&&t(ee,{..._.userNode})},re=ee=>{if(!(JD(ee.nativeEvent)||m)){if(HD.includes(ee.key)&&A){const le=ee.key==="Escape";LE({id:e,store:U,unselect:le,nodeRef:M})}else if(S&&b.selected&&Object.prototype.hasOwnProperty.call(Km,ee.key)){ee.preventDefault();const{ariaLabelConfig:le}=U.getState();U.setState({ariaLiveMessage:le["node.a11yDescription.ariaLiveMessage"]({direction:ee.key.replace("Arrow","").toLowerCase(),x:~~_.positionAbsolute.x,y:~~_.positionAbsolute.y})}),T({direction:Km[ee.key],factor:ee.shiftKey?4:1})}}},ue=()=>{var de;if(m||!((de=M.current)!=null&&de.matches(":focus-visible")))return;const{transform:ee,width:le,height:ne,autoPanOnNodeFocus:me,setCenter:ye}=U.getState();if(!me)return;Nv(new Map([[e,b]]),{x:0,y:0,width:le,height:ne},ee,!0).length>0||ye(b.position.x+L.width/2,b.position.y+L.height/2,{zoom:ee[2]})};return l.jsx("div",{className:Ln(["react-flow__node",`react-flow__node-${N}`,{[p]:S},b.className,{selected:b.selected,selectable:A,parent:k,draggable:S,dragging:j}]),ref:M,style:{zIndex:_.z,transform:`translate(${_.positionAbsolute.x}px,${_.positionAbsolute.y}px)`,pointerEvents:F?"all":"none",visibility:X?"visible":"hidden",...b.style,...R},"data-id":e,"data-testid":`rf__node-${e}`,onMouseEnter:I,onMouseMove:V,onMouseLeave:W,onContextMenu:P,onClick:G,onDoubleClick:ie,onKeyDown:D?re:void 0,tabIndex:D?0:void 0,onFocus:D?ue:void 0,role:b.ariaRole??(D?"group":void 0),"aria-roledescription":"node","aria-describedby":m?void 0:`${vP}-${y}`,"aria-label":b.ariaLabel,...b.domAttributes,children:l.jsx(Qle,{value:e,children:l.jsx(C,{id:e,data:b.data,type:N,positionAbsoluteX:_.positionAbsolute.x,positionAbsoluteY:_.positionAbsolute.y,selected:b.selected??!1,selectable:A,draggable:S,deletable:b.deletable??!0,isConnectable:O,sourcePosition:b.sourcePosition,targetPosition:b.targetPosition,dragging:j,dragHandle:b.dragHandle,zIndex:_.z,parentId:b.parentId,...L})})})}var gce=w.memo(mce);const yce=e=>({nodesDraggable:e.nodesDraggable,nodesConnectable:e.nodesConnectable,nodesFocusable:e.nodesFocusable,elementsSelectable:e.elementsSelectable,onError:e.onError});function jP(e){const{nodesDraggable:t,nodesConnectable:n,nodesFocusable:r,elementsSelectable:s,onError:i}=wt(yce,en),a=dce(e.onlyRenderVisibleElements),o=hce();return l.jsx("div",{className:"react-flow__nodes",style:s0,children:a.map(c=>l.jsx(gce,{id:c,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},c))})}jP.displayName="NodeRenderer";const bce=w.memo(jP);function Ece(e){return wt(w.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&&roe({sourceNode:i,targetNode:a,width:n.width,height:n.height,transform:n.transform})&&r.push(s.id)}return r},[e]),en)}const xce=({color:e="none",strokeWidth:t=1})=>{const n={strokeWidth:t,...e&&{stroke:e}};return l.jsx("polyline",{className:"arrow",style:n,strokeLinecap:"round",fill:"none",strokeLinejoin:"round",points:"-5,-4 0,0 -5,4"})},wce=({color:e="none",strokeWidth:t=1})=>{const n={strokeWidth:t,...e&&{stroke:e,fill:e}};return l.jsx("polyline",{className:"arrowclosed",style:n,strokeLinecap:"round",strokeLinejoin:"round",points:"-5,-4 0,0 -5,4 -5,-4"})},aA={[Oc.Arrow]:xce,[Oc.ArrowClosed]:wce};function vce(e){const t=tn();return w.useMemo(()=>{var s,i;return Object.prototype.hasOwnProperty.call(aA,e)?aA[e]:((i=(s=t.getState()).onError)==null||i.call(s,"009",Zs.error009(e)),null)},[e])}const _ce=({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 c=vce(t);return c?l.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:l.jsx(c,{color:n,strokeWidth:a})}):null},DP=({defaultColor:e,rfId:t})=>{const n=wt(i=>i.edges),r=wt(i=>i.defaultEdgeOptions),s=w.useMemo(()=>doe(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?l.jsx("svg",{className:"react-flow__marker","aria-hidden":"true",children:l.jsx("defs",{children:s.map(i=>l.jsx(_ce,{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};DP.displayName="MarkerDefinitions";var kce=w.memo(DP);function PP({x:e,y:t,label:n,labelStyle:r,labelShowBg:s=!0,labelBgStyle:i,labelBgPadding:a=[2,4],labelBgBorderRadius:o=2,children:c,className:u,...d}){const[f,h]=w.useState({x:1,y:0,width:0,height:0}),p=Ln(["react-flow__edge-textwrapper",u]),m=w.useRef(null);return w.useEffect(()=>{if(m.current){const y=m.current.getBBox();h({x:y.x,y:y.y,width:y.width,height:y.height})}},[n]),n?l.jsxs("g",{transform:`translate(${e-f.width/2} ${t-f.height/2})`,className:p,visibility:f.width?"visible":"hidden",...d,children:[s&&l.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}),l.jsx("text",{className:"react-flow__edge-text",y:f.height/2,dy:"0.3em",ref:m,style:r,children:n}),c]}):null}PP.displayName="EdgeText";const Nce=w.memo(PP);function Uf({path:e,labelX:t,labelY:n,label:r,labelStyle:s,labelShowBg:i,labelBgStyle:a,labelBgPadding:o,labelBgBorderRadius:c,interactionWidth:u=20,...d}){return l.jsxs(l.Fragment,{children:[l.jsx("path",{...d,d:e,fill:"none",className:Ln(["react-flow__edge-path",d.className])}),u?l.jsx("path",{d:e,fill:"none",strokeOpacity:0,strokeWidth:u,className:"react-flow__edge-interaction"}):null,r&&Vs(t)&&Vs(n)?l.jsx(Nce,{x:t,y:n,label:r,labelStyle:s,labelShowBg:i,labelBgStyle:a,labelBgPadding:o,labelBgBorderRadius:c}):null]})}function oA({pos:e,x1:t,y1:n,x2:r,y2:s}){return e===Pe.Left||e===Pe.Right?[.5*(t+r),n]:[t,.5*(n+s)]}function BP({sourceX:e,sourceY:t,sourcePosition:n=Pe.Bottom,targetX:r,targetY:s,targetPosition:i=Pe.Top}){const[a,o]=oA({pos:n,x1:e,y1:t,x2:r,y2:s}),[c,u]=oA({pos:i,x1:r,y1:s,x2:e,y2:t}),[d,f,h,p]=tP({sourceX:e,sourceY:t,targetX:r,targetY:s,sourceControlX:a,sourceControlY:o,targetControlX:c,targetControlY:u});return[`M${e},${t} C${a},${o} ${c},${u} ${r},${s}`,d,f,h,p]}function FP(e){return w.memo(({id:t,sourceX:n,sourceY:r,targetX:s,targetY:i,sourcePosition:a,targetPosition:o,label:c,labelStyle:u,labelShowBg:d,labelBgStyle:f,labelBgPadding:h,labelBgBorderRadius:p,style:m,markerEnd:y,markerStart:E,interactionWidth:g})=>{const[x,b,_]=BP({sourceX:n,sourceY:r,sourcePosition:a,targetX:s,targetY:i,targetPosition:o}),k=e.isInternal?void 0:t;return l.jsx(Uf,{id:k,path:x,labelX:b,labelY:_,label:c,labelStyle:u,labelShowBg:d,labelBgStyle:f,labelBgPadding:h,labelBgBorderRadius:p,style:m,markerEnd:y,markerStart:E,interactionWidth:g})})}const Sce=FP({isInternal:!1}),UP=FP({isInternal:!0});Sce.displayName="SimpleBezierEdge";UP.displayName="SimpleBezierEdgeInternal";function $P(e){return w.memo(({id:t,sourceX:n,sourceY:r,targetX:s,targetY:i,label:a,labelStyle:o,labelShowBg:c,labelBgStyle:u,labelBgPadding:d,labelBgBorderRadius:f,style:h,sourcePosition:p=Pe.Bottom,targetPosition:m=Pe.Top,markerEnd:y,markerStart:E,pathOptions:g,interactionWidth:x})=>{const[b,_,k]=Vm({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}),N=e.isInternal?void 0:t;return l.jsx(Uf,{id:N,path:b,labelX:_,labelY:k,label:a,labelStyle:o,labelShowBg:c,labelBgStyle:u,labelBgPadding:d,labelBgBorderRadius:f,style:h,markerEnd:y,markerStart:E,interactionWidth:x})})}const HP=$P({isInternal:!1}),zP=$P({isInternal:!0});HP.displayName="SmoothStepEdge";zP.displayName="SmoothStepEdgeInternal";function VP(e){return w.memo(({id:t,...n})=>{var s;const r=e.isInternal?void 0:t;return l.jsx(HP,{...n,id:r,pathOptions:w.useMemo(()=>{var i;return{borderRadius:0,offset:(i=n.pathOptions)==null?void 0:i.offset}},[(s=n.pathOptions)==null?void 0:s.offset])})})}const Tce=VP({isInternal:!1}),KP=VP({isInternal:!0});Tce.displayName="StepEdge";KP.displayName="StepEdgeInternal";function YP(e){return w.memo(({id:t,sourceX:n,sourceY:r,targetX:s,targetY:i,label:a,labelStyle:o,labelShowBg:c,labelBgStyle:u,labelBgPadding:d,labelBgBorderRadius:f,style:h,markerEnd:p,markerStart:m,interactionWidth:y})=>{const[E,g,x]=sP({sourceX:n,sourceY:r,targetX:s,targetY:i}),b=e.isInternal?void 0:t;return l.jsx(Uf,{id:b,path:E,labelX:g,labelY:x,label:a,labelStyle:o,labelShowBg:c,labelBgStyle:u,labelBgPadding:d,labelBgBorderRadius:f,style:h,markerEnd:p,markerStart:m,interactionWidth:y})})}const Ace=YP({isInternal:!1}),WP=YP({isInternal:!0});Ace.displayName="StraightEdge";WP.displayName="StraightEdgeInternal";function GP(e){return w.memo(({id:t,sourceX:n,sourceY:r,targetX:s,targetY:i,sourcePosition:a=Pe.Bottom,targetPosition:o=Pe.Top,label:c,labelStyle:u,labelShowBg:d,labelBgStyle:f,labelBgPadding:h,labelBgBorderRadius:p,style:m,markerEnd:y,markerStart:E,pathOptions:g,interactionWidth:x})=>{const[b,_,k]=nP({sourceX:n,sourceY:r,sourcePosition:a,targetX:s,targetY:i,targetPosition:o,curvature:g==null?void 0:g.curvature}),N=e.isInternal?void 0:t;return l.jsx(Uf,{id:N,path:b,labelX:_,labelY:k,label:c,labelStyle:u,labelShowBg:d,labelBgStyle:f,labelBgPadding:h,labelBgBorderRadius:p,style:m,markerEnd:y,markerStart:E,interactionWidth:x})})}const Cce=GP({isInternal:!1}),qP=GP({isInternal:!0});Cce.displayName="BezierEdge";qP.displayName="BezierEdgeInternal";const lA={default:qP,straight:WP,step:KP,smoothstep:zP,simplebezier:UP},cA={sourceX:null,sourceY:null,targetX:null,targetY:null,sourcePosition:null,targetPosition:null},Ice=(e,t,n)=>n===Pe.Left?e-t:n===Pe.Right?e+t:e,Oce=(e,t,n)=>n===Pe.Top?e-t:n===Pe.Bottom?e+t:e,uA="react-flow__edgeupdater";function dA({position:e,centerX:t,centerY:n,radius:r=10,onMouseDown:s,onMouseEnter:i,onMouseOut:a,type:o}){return l.jsx("circle",{onMouseDown:s,onMouseEnter:i,onMouseOut:a,className:Ln([uA,`${uA}-${o}`]),cx:Ice(t,r,e),cy:Oce(n,r,e),r,stroke:"transparent",fill:"transparent"})}function Rce({isReconnectable:e,reconnectRadius:t,edge:n,sourceX:r,sourceY:s,targetX:i,targetY:a,sourcePosition:o,targetPosition:c,onReconnect:u,onReconnectStart:d,onReconnectEnd:f,setReconnecting:h,setUpdateHover:p}){const m=tn(),y=(_,k)=>{if(_.button!==0)return;const{autoPanOnConnect:N,domNode:C,connectionMode:S,connectionRadius:A,lib:O,onConnectStart:D,cancelConnection:U,nodeLookup:X,rfId:M,panBy:j,updateConnection:T}=m.getState(),L=k.type==="target",R=(V,W)=>{h(!1),f==null||f(V,n,k.type,W)},F=V=>u==null?void 0:u(n,V),I=(V,W)=>{h(!0),d==null||d(_,n,k.type),D==null||D(V,W)};RE.onPointerDown(_.nativeEvent,{autoPanOnConnect:N,connectionMode:S,connectionRadius:A,domNode:C,handleId:k.id,nodeId:k.nodeId,nodeLookup:X,isTarget:L,edgeUpdaterType:k.type,lib:O,flowId:M,cancelConnection:U,panBy:j,isValidConnection:(...V)=>{var W,P;return((P=(W=m.getState()).isValidConnection)==null?void 0:P.call(W,...V))??!0},onConnect:F,onConnectStart:I,onConnectEnd:(...V)=>{var W,P;return(P=(W=m.getState()).onConnectEnd)==null?void 0:P.call(W,...V)},onReconnectEnd:R,updateConnection:T,getTransform:()=>m.getState().transform,getFromHandle:()=>m.getState().connection.fromHandle,dragThreshold:m.getState().connectionDragThreshold,handleDomNode:_.currentTarget})},E=_=>y(_,{nodeId:n.target,id:n.targetHandle??null,type:"target"}),g=_=>y(_,{nodeId:n.source,id:n.sourceHandle??null,type:"source"}),x=()=>p(!0),b=()=>p(!1);return l.jsxs(l.Fragment,{children:[(e===!0||e==="source")&&l.jsx(dA,{position:o,centerX:r,centerY:s,radius:t,onMouseDown:E,onMouseEnter:x,onMouseOut:b,type:"source"}),(e===!0||e==="target")&&l.jsx(dA,{position:c,centerX:i,centerY:a,radius:t,onMouseDown:g,onMouseEnter:x,onMouseOut:b,type:"target"})]})}function Lce({id:e,edgesFocusable:t,edgesReconnectable:n,elementsSelectable:r,onClick:s,onDoubleClick:i,onContextMenu:a,onMouseEnter:o,onMouseMove:c,onMouseLeave:u,reconnectRadius:d,onReconnect:f,onReconnectStart:h,onReconnectEnd:p,rfId:m,edgeTypes:y,noPanClassName:E,onError:g,disableKeyboardA11y:x}){let b=wt(ye=>ye.edgeLookup.get(e));const _=wt(ye=>ye.defaultEdgeOptions);b=_?{..._,...b}:b;let k=b.type||"default",N=(y==null?void 0:y[k])||lA[k];N===void 0&&(g==null||g("011",Zs.error011(k)),k="default",N=(y==null?void 0:y.default)||lA.default);const C=!!(b.focusable||t&&typeof b.focusable>"u"),S=typeof f<"u"&&(b.reconnectable||n&&typeof b.reconnectable>"u"),A=!!(b.selectable||r&&typeof b.selectable>"u"),O=w.useRef(null),[D,U]=w.useState(!1),[X,M]=w.useState(!1),j=tn(),{zIndex:T,sourceX:L,sourceY:R,targetX:F,targetY:I,sourcePosition:V,targetPosition:W}=wt(w.useCallback(ye=>{const te=ye.nodeLookup.get(b.source),de=ye.nodeLookup.get(b.target);if(!te||!de)return{zIndex:b.zIndex,...cA};const Ee=uoe({id:e,sourceNode:te,targetNode:de,sourceHandle:b.sourceHandle||null,targetHandle:b.targetHandle||null,connectionMode:ye.connectionMode,onError:g});return{zIndex:noe({selected:b.selected,zIndex:b.zIndex,sourceNode:te,targetNode:de,elevateOnSelect:ye.elevateEdgesOnSelect,zIndexMode:ye.zIndexMode}),...Ee||cA}},[b.source,b.target,b.sourceHandle,b.targetHandle,b.selected,b.zIndex]),en),P=w.useMemo(()=>b.markerStart?`url('#${IE(b.markerStart,m)}')`:void 0,[b.markerStart,m]),ie=w.useMemo(()=>b.markerEnd?`url('#${IE(b.markerEnd,m)}')`:void 0,[b.markerEnd,m]);if(b.hidden||L===null||R===null||F===null||I===null)return null;const G=ye=>{var Te;const{addSelectedEdges:te,unselectNodesAndEdges:de,multiSelectionActive:Ee}=j.getState();A&&(j.setState({nodesSelectionActive:!1}),b.selected&&Ee?(de({nodes:[],edges:[b]}),(Te=O.current)==null||Te.blur()):te([e])),s&&s(ye,b)},re=i?ye=>{i(ye,{...b})}:void 0,ue=a?ye=>{a(ye,{...b})}:void 0,ee=o?ye=>{o(ye,{...b})}:void 0,le=c?ye=>{c(ye,{...b})}:void 0,ne=u?ye=>{u(ye,{...b})}:void 0,me=ye=>{var te;if(!x&&HD.includes(ye.key)&&A){const{unselectNodesAndEdges:de,addSelectedEdges:Ee}=j.getState();ye.key==="Escape"?((te=O.current)==null||te.blur(),de({edges:[b]})):Ee([e])}};return l.jsx("svg",{style:{zIndex:T},children:l.jsxs("g",{className:Ln(["react-flow__edge",`react-flow__edge-${k}`,b.className,E,{selected:b.selected,animated:b.animated,inactive:!A&&!s,updating:D,selectable:A}]),onClick:G,onDoubleClick:re,onContextMenu:ue,onMouseEnter:ee,onMouseMove:le,onMouseLeave:ne,onKeyDown:C?me:void 0,tabIndex:C?0:void 0,role:b.ariaRole??(C?"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":C?`${_P}-${m}`:void 0,ref:O,...b.domAttributes,children:[!X&&l.jsx(N,{id:e,source:b.source,target:b.target,type:b.type,selected:b.selected,animated:b.animated,selectable:A,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:R,targetX:F,targetY:I,sourcePosition:V,targetPosition:W,data:b.data,style:b.style,sourceHandleId:b.sourceHandle,targetHandleId:b.targetHandle,markerStart:P,markerEnd:ie,pathOptions:"pathOptions"in b?b.pathOptions:void 0,interactionWidth:b.interactionWidth}),S&&l.jsx(Rce,{edge:b,isReconnectable:S,reconnectRadius:d,onReconnect:f,onReconnectStart:h,onReconnectEnd:p,sourceX:L,sourceY:R,targetX:F,targetY:I,sourcePosition:V,targetPosition:W,setUpdateHover:U,setReconnecting:M})]})})}var Mce=w.memo(Lce);const jce=e=>({edgesFocusable:e.edgesFocusable,edgesReconnectable:e.edgesReconnectable,elementsSelectable:e.elementsSelectable,connectionMode:e.connectionMode,onError:e.onError});function XP({defaultMarkerColor:e,onlyRenderVisibleElements:t,rfId:n,edgeTypes:r,noPanClassName:s,onReconnect:i,onEdgeContextMenu:a,onEdgeMouseEnter:o,onEdgeMouseMove:c,onEdgeMouseLeave:u,onEdgeClick:d,reconnectRadius:f,onEdgeDoubleClick:h,onReconnectStart:p,onReconnectEnd:m,disableKeyboardA11y:y}){const{edgesFocusable:E,edgesReconnectable:g,elementsSelectable:x,onError:b}=wt(jce,en),_=Ece(t);return l.jsxs("div",{className:"react-flow__edges",children:[l.jsx(kce,{defaultColor:e,rfId:n}),_.map(k=>l.jsx(Mce,{id:k,edgesFocusable:E,edgesReconnectable:g,elementsSelectable:x,noPanClassName:s,onReconnect:i,onContextMenu:a,onMouseEnter:o,onMouseMove:c,onMouseLeave:u,onClick:d,reconnectRadius:f,onDoubleClick:h,onReconnectStart:p,onReconnectEnd:m,rfId:n,onError:b,edgeTypes:r,disableKeyboardA11y:y},k))]})}XP.displayName="EdgeRenderer";const Dce=w.memo(XP),Pce=e=>`translate(${e.transform[0]}px,${e.transform[1]}px) scale(${e.transform[2]})`;function Bce({children:e}){const t=wt(Pce);return l.jsx("div",{className:"react-flow__viewport xyflow__viewport react-flow__container",style:{transform:t},children:e})}function Fce(e){const t=r0(),n=w.useRef(!1);w.useEffect(()=>{!n.current&&t.viewportInitialized&&e&&(setTimeout(()=>e(t),1),n.current=!0)},[e,t.viewportInitialized])}const Uce=e=>{var t;return(t=e.panZoom)==null?void 0:t.syncViewport};function $ce(e){const t=wt(Uce),n=tn();return w.useEffect(()=>{e&&(t==null||t(e),n.setState({transform:[e.x,e.y,e.zoom]}))},[e,t]),null}function Hce(e){return e.connection.inProgress?{...e.connection,to:Zc(e.connection.to,e.transform)}:{...e.connection}}function zce(e){return Hce}function Vce(e){const t=zce();return wt(t,en)}const Kce=e=>({nodesConnectable:e.nodesConnectable,isValid:e.connection.isValid,inProgress:e.connection.inProgress,width:e.width,height:e.height});function Yce({containerStyle:e,style:t,type:n,component:r}){const{nodesConnectable:s,width:i,height:a,isValid:o,inProgress:c}=wt(Kce,en);return!(i&&s&&c)?null:l.jsx("svg",{style:e,width:i,height:a,className:"react-flow__connectionline react-flow__container",children:l.jsx("g",{className:Ln(["react-flow__connection",KD(o)]),children:l.jsx(QP,{style:t,type:n,CustomComponent:r,isValid:o})})})}const QP=({style:e,type:t=va.Bezier,CustomComponent:n,isValid:r})=>{const{inProgress:s,from:i,fromNode:a,fromHandle:o,fromPosition:c,to:u,toNode:d,toHandle:f,toPosition:h,pointer:p}=Vce();if(!s)return;if(n)return l.jsx(n,{connectionLineType:t,connectionLineStyle:e,fromNode:a,fromHandle:o,fromX:i.x,fromY:i.y,toX:u.x,toY:u.y,fromPosition:c,toPosition:h,connectionStatus:KD(r),toNode:d,toHandle:f,pointer:p});let m="";const y={sourceX:i.x,sourceY:i.y,sourcePosition:c,targetX:u.x,targetY:u.y,targetPosition:h};switch(t){case va.Bezier:[m]=nP(y);break;case va.SimpleBezier:[m]=BP(y);break;case va.Step:[m]=Vm({...y,borderRadius:0});break;case va.SmoothStep:[m]=Vm(y);break;default:[m]=sP(y)}return l.jsx("path",{d:m,fill:"none",className:"react-flow__connection-path",style:e})};QP.displayName="ConnectionLine";const Wce={};function fA(e=Wce){w.useRef(e),tn(),w.useEffect(()=>{},[e])}function Gce(){tn(),w.useRef(!1),w.useEffect(()=>{},[])}function ZP({nodeTypes:e,edgeTypes:t,onInit:n,onNodeClick:r,onEdgeClick:s,onNodeDoubleClick:i,onEdgeDoubleClick:a,onNodeMouseEnter:o,onNodeMouseMove:c,onNodeMouseLeave:u,onNodeContextMenu:d,onSelectionContextMenu:f,onSelectionStart:h,onSelectionEnd:p,connectionLineType:m,connectionLineStyle:y,connectionLineComponent:E,connectionLineContainerStyle:g,selectionKeyCode:x,selectionOnDrag:b,selectionMode:_,multiSelectionKeyCode:k,panActivationKeyCode:N,zoomActivationKeyCode:C,deleteKeyCode:S,onlyRenderVisibleElements:A,elementsSelectable:O,defaultViewport:D,translateExtent:U,minZoom:X,maxZoom:M,preventScrolling:j,defaultMarkerColor:T,zoomOnScroll:L,zoomOnPinch:R,panOnScroll:F,panOnScrollSpeed:I,panOnScrollMode:V,zoomOnDoubleClick:W,panOnDrag:P,autoPanOnSelection:ie,onPaneClick:G,onPaneMouseEnter:re,onPaneMouseMove:ue,onPaneMouseLeave:ee,onPaneScroll:le,onPaneContextMenu:ne,paneClickDistance:me,nodeClickDistance:ye,onEdgeContextMenu:te,onEdgeMouseEnter:de,onEdgeMouseMove:Ee,onEdgeMouseLeave:Te,reconnectRadius:Ke,onReconnect:Ne,onReconnectStart:it,onReconnectEnd:He,noDragClassName:Ue,noWheelClassName:Et,noPanClassName:rt,disableKeyboardA11y:St,nodeExtent:ct,rfId:B,viewport:Q,onViewportChange:oe}){return fA(e),fA(t),Gce(),Fce(n),$ce(Q),l.jsx(cce,{onPaneClick:G,onPaneMouseEnter:re,onPaneMouseMove:ue,onPaneMouseLeave:ee,onPaneContextMenu:ne,onPaneScroll:le,paneClickDistance:me,deleteKeyCode:S,selectionKeyCode:x,selectionOnDrag:b,selectionMode:_,onSelectionStart:h,onSelectionEnd:p,multiSelectionKeyCode:k,panActivationKeyCode:N,zoomActivationKeyCode:C,elementsSelectable:O,zoomOnScroll:L,zoomOnPinch:R,zoomOnDoubleClick:W,panOnScroll:F,panOnScrollSpeed:I,panOnScrollMode:V,panOnDrag:P,autoPanOnSelection:ie,defaultViewport:D,translateExtent:U,minZoom:X,maxZoom:M,onSelectionContextMenu:f,preventScrolling:j,noDragClassName:Ue,noWheelClassName:Et,noPanClassName:rt,disableKeyboardA11y:St,onViewportChange:oe,isControlledViewport:!!Q,children:l.jsxs(Bce,{children:[l.jsx(Dce,{edgeTypes:t,onEdgeClick:s,onEdgeDoubleClick:a,onReconnect:Ne,onReconnectStart:it,onReconnectEnd:He,onlyRenderVisibleElements:A,onEdgeContextMenu:te,onEdgeMouseEnter:de,onEdgeMouseMove:Ee,onEdgeMouseLeave:Te,reconnectRadius:Ke,defaultMarkerColor:T,noPanClassName:rt,disableKeyboardA11y:St,rfId:B}),l.jsx(Yce,{style:y,type:m,component:E,containerStyle:g}),l.jsx("div",{className:"react-flow__edgelabel-renderer"}),l.jsx(bce,{nodeTypes:e,onNodeClick:r,onNodeDoubleClick:i,onNodeMouseEnter:o,onNodeMouseMove:c,onNodeMouseLeave:u,onNodeContextMenu:d,nodeClickDistance:ye,onlyRenderVisibleElements:A,noPanClassName:rt,noDragClassName:Ue,disableKeyboardA11y:St,nodeExtent:ct,rfId:B}),l.jsx("div",{className:"react-flow__viewport-portal"})]})})}ZP.displayName="GraphView";const qce=w.memo(ZP),Xce=XD(),hA=({nodes:e,edges:t,defaultNodes:n,defaultEdges:r,width:s,height:i,fitView:a,fitViewOptions:o,minZoom:c=.5,maxZoom:u=2,nodeOrigin:d,nodeExtent:f,zIndexMode:h="basic"}={})=>{const p=new Map,m=new Map,y=new Map,E=new Map,g=r??t??[],x=n??e??[],b=d??[0,0],_=f??af;oP(y,E,g);const{nodesInitialized:k}=OE(x,p,m,{nodeOrigin:b,nodeExtent:_,zIndexMode:h});let N=[0,0,1];if(a&&s&&i){const C=Bf(p,{filter:D=>!!((D.width||D.initialWidth)&&(D.height||D.initialHeight))}),{x:S,y:A,zoom:O}=Tv(C,s,i,c,u,(o==null?void 0:o.padding)??.1);N=[S,A,O]}return{rfId:"1",width:s??0,height:i??0,transform:N,nodes:x,nodesInitialized:k,nodeLookup:p,parentLookup:m,edges:g,edgeLookup:E,connectionLookup:y,onNodesChange:null,onEdgesChange:null,hasDefaultNodes:n!==void 0,hasDefaultEdges:r!==void 0,panZoom:null,minZoom:c,maxZoom:u,translateExtent:af,nodeExtent:_,nodesSelectionActive:!1,userSelectionActive:!1,userSelectionRect:null,connectionMode:Ic.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:{...VD},connectionClickStartHandle:null,connectOnClick:!0,ariaLiveMessage:"",autoPanOnConnect:!0,autoPanOnNodeDrag:!0,autoPanOnNodeFocus:!0,autoPanSpeed:15,connectionRadius:20,onError:Xce,isValidConnection:void 0,onSelectionChangeHandlers:[],lib:"react",debug:!1,ariaLabelConfig:zD,zIndexMode:h,onNodesChangeMiddlewareMap:new Map,onEdgesChangeMiddlewareMap:new Map}},Qce=({nodes:e,edges:t,defaultNodes:n,defaultEdges:r,width:s,height:i,fitView:a,fitViewOptions:o,minZoom:c,maxZoom:u,nodeOrigin:d,nodeExtent:f,zIndexMode:h})=>hle((p,m)=>{async function y(){const{nodeLookup:E,panZoom:g,fitViewOptions:x,fitViewResolver:b,width:_,height:k,minZoom:N,maxZoom:C}=m();g&&(await qae({nodes:E,width:_,height:k,panZoom:g,minZoom:N,maxZoom:C},x),b==null||b.resolve(!0),p({fitViewResolver:null}))}return{...hA({nodes:e,edges:t,width:s,height:i,fitView:a,fitViewOptions:o,minZoom:c,maxZoom:u,nodeOrigin:d,nodeExtent:f,defaultNodes:n,defaultEdges:r,zIndexMode:h}),setNodes:E=>{const{nodeLookup:g,parentLookup:x,nodeOrigin:b,elevateNodesOnSelect:_,fitViewQueued:k,zIndexMode:N,nodesSelectionActive:C}=m(),{nodesInitialized:S,hasSelectedNodes:A}=OE(E,g,x,{nodeOrigin:b,nodeExtent:f,elevateNodesOnSelect:_,checkEquality:!0,zIndexMode:N}),O=C&&A;k&&S?(y(),p({nodes:E,nodesInitialized:S,fitViewQueued:!1,fitViewOptions:void 0,nodesSelectionActive:O})):p({nodes:E,nodesInitialized:S,nodesSelectionActive:O})},setEdges:E=>{const{connectionLookup:g,edgeLookup:x}=m();oP(g,x,E),p({edges:E})},setDefaultNodesAndEdges:(E,g)=>{if(E){const{setNodes:x}=m();x(E),p({hasDefaultNodes:!0})}if(g){const{setEdges:x}=m();x(g),p({hasDefaultEdges:!0})}},updateNodeInternals:E=>{const{triggerNodeChanges:g,nodeLookup:x,parentLookup:b,domNode:_,nodeOrigin:k,nodeExtent:N,debug:C,fitViewQueued:S,zIndexMode:A}=m(),{changes:O,updatedInternals:D}=boe(E,x,b,_,k,N,A);D&&(poe(x,b,{nodeOrigin:k,nodeExtent:N,zIndexMode:A}),S?(y(),p({fitViewQueued:!1,fitViewOptions:void 0})):p({}),(O==null?void 0:O.length)>0&&(C&&console.log("React Flow: trigger node changes",O),g==null||g(O)))},updateNodePositions:(E,g=!1)=>{const x=[];let b=[];const{nodeLookup:_,triggerNodeChanges:k,connection:N,updateConnection:C,onNodesChangeMiddlewareMap:S}=m();for(const[A,O]of E){const D=_.get(A),U=!!(D!=null&&D.expandParent&&(D!=null&&D.parentId)&&(O!=null&&O.position)),X={id:A,type:"position",position:U?{x:Math.max(0,O.position.x),y:Math.max(0,O.position.y)}:O.position,dragging:g};if(D&&N.inProgress&&N.fromNode.id===D.id){const M=Vo(D,N.fromHandle,Pe.Left,!0);C({...N,from:M})}U&&D.parentId&&x.push({id:A,parentId:D.parentId,rect:{...O.internals.positionAbsolute,width:O.measured.width??0,height:O.measured.height??0}}),b.push(X)}if(x.length>0){const{parentLookup:A,nodeOrigin:O}=m(),D=Mv(x,_,A,O);b.push(...D)}for(const A of S.values())b=A(b);k(b)},triggerNodeChanges:E=>{const{onNodesChange:g,setNodes:x,nodes:b,hasDefaultNodes:_,debug:k}=m();if(E!=null&&E.length){if(_){const N=SP(E,b);x(N)}k&&console.log("React Flow: trigger node changes",E),g==null||g(E)}},triggerEdgeChanges:E=>{const{onEdgesChange:g,setEdges:x,edges:b,hasDefaultEdges:_,debug:k}=m();if(E!=null&&E.length){if(_){const N=TP(E,b);x(N)}k&&console.log("React Flow: trigger edge changes",E),g==null||g(E)}},addSelectedNodes:E=>{const{multiSelectionActive:g,edgeLookup:x,nodeLookup:b,triggerNodeChanges:_,triggerEdgeChanges:k}=m();if(g){const N=E.map(C=>lo(C,!0));_(N);return}_(Hl(b,new Set([...E]),!0)),k(Hl(x))},addSelectedEdges:E=>{const{multiSelectionActive:g,edgeLookup:x,nodeLookup:b,triggerNodeChanges:_,triggerEdgeChanges:k}=m();if(g){const N=E.map(C=>lo(C,!0));k(N);return}k(Hl(x,new Set([...E]))),_(Hl(b,new Set,!0))},unselectNodesAndEdges:({nodes:E,edges:g}={})=>{const{edges:x,nodes:b,nodeLookup:_,triggerNodeChanges:k,triggerEdgeChanges:N}=m(),C=E||b,S=g||x,A=[];for(const D of C){if(!D.selected)continue;const U=_.get(D.id);U&&(U.selected=!1),A.push(lo(D.id,!1))}const O=[];for(const D of S)D.selected&&O.push(lo(D.id,!1));k(A),N(O)},setMinZoom:E=>{const{panZoom:g,maxZoom:x}=m();g==null||g.setScaleExtent([E,x]),p({minZoom:E})},setMaxZoom:E=>{const{panZoom:g,minZoom:x}=m();g==null||g.setScaleExtent([x,E]),p({maxZoom:E})},setTranslateExtent:E=>{var g;(g=m().panZoom)==null||g.setTranslateExtent(E),p({translateExtent:E})},resetSelectedElements:()=>{const{edges:E,nodes:g,triggerNodeChanges:x,triggerEdgeChanges:b,elementsSelectable:_}=m();if(!_)return;const k=g.reduce((C,S)=>S.selected?[...C,lo(S.id,!1)]:C,[]),N=E.reduce((C,S)=>S.selected?[...C,lo(S.id,!1)]:C,[]);x(k),b(N)},setNodeExtent:E=>{const{nodes:g,nodeLookup:x,parentLookup:b,nodeOrigin:_,elevateNodesOnSelect:k,nodeExtent:N,zIndexMode:C}=m();E[0][0]===N[0][0]&&E[0][1]===N[0][1]&&E[1][0]===N[1][0]&&E[1][1]===N[1][1]||(OE(g,x,b,{nodeOrigin:_,nodeExtent:E,elevateNodesOnSelect:k,checkEquality:!1,zIndexMode:C}),p({nodeExtent:E}))},panBy:E=>{const{transform:g,width:x,height:b,panZoom:_,translateExtent:k}=m();return Eoe({delta:E,panZoom:_,transform:g,translateExtent:k,width:x,height:b})},setCenter:async(E,g,x)=>{const{width:b,height:_,maxZoom:k,panZoom:N}=m();if(!N)return!1;const C=typeof(x==null?void 0:x.zoom)<"u"?x.zoom:k;return await N.setViewport({x:b/2-E*C,y:_/2-g*C,zoom:C},{duration:x==null?void 0:x.duration,ease:x==null?void 0:x.ease,interpolate:x==null?void 0:x.interpolate}),!0},cancelConnection:()=>{p({connection:{...VD}})},updateConnection:E=>{p({connection:E})},reset:()=>p({...hA()})}},Object.is);function Dv({initialNodes:e,initialEdges:t,defaultNodes:n,defaultEdges:r,initialWidth:s,initialHeight:i,initialMinZoom:a,initialMaxZoom:o,initialFitViewOptions:c,fitView:u,nodeOrigin:d,nodeExtent:f,zIndexMode:h,children:p}){const[m]=w.useState(()=>Qce({nodes:e,edges:t,defaultNodes:n,defaultEdges:r,width:s,height:i,fitView:u,minZoom:a,maxZoom:o,fitViewOptions:c,nodeOrigin:d,nodeExtent:f,zIndexMode:h}));return l.jsx(ple,{value:m,children:l.jsx(Ble,{children:p})})}function Zce({children:e,nodes:t,edges:n,defaultNodes:r,defaultEdges:s,width:i,height:a,fitView:o,fitViewOptions:c,minZoom:u,maxZoom:d,nodeOrigin:f,nodeExtent:h,zIndexMode:p}){return w.useContext(t0)?l.jsx(l.Fragment,{children:e}):l.jsx(Dv,{initialNodes:t,initialEdges:n,defaultNodes:r,defaultEdges:s,initialWidth:i,initialHeight:a,fitView:o,initialFitViewOptions:c,initialMinZoom:u,initialMaxZoom:d,nodeOrigin:f,nodeExtent:h,zIndexMode:p,children:e})}const Jce={width:"100%",height:"100%",overflow:"hidden",position:"relative",zIndex:0};function eue({nodes:e,edges:t,defaultNodes:n,defaultEdges:r,className:s,nodeTypes:i,edgeTypes:a,onNodeClick:o,onEdgeClick:c,onInit:u,onMove:d,onMoveStart:f,onMoveEnd:h,onConnect:p,onConnectStart:m,onConnectEnd:y,onClickConnectStart:E,onClickConnectEnd:g,onNodeMouseEnter:x,onNodeMouseMove:b,onNodeMouseLeave:_,onNodeContextMenu:k,onNodeDoubleClick:N,onNodeDragStart:C,onNodeDrag:S,onNodeDragStop:A,onNodesDelete:O,onEdgesDelete:D,onDelete:U,onSelectionChange:X,onSelectionDragStart:M,onSelectionDrag:j,onSelectionDragStop:T,onSelectionContextMenu:L,onSelectionStart:R,onSelectionEnd:F,onBeforeDelete:I,connectionMode:V,connectionLineType:W=va.Bezier,connectionLineStyle:P,connectionLineComponent:ie,connectionLineContainerStyle:G,deleteKeyCode:re="Backspace",selectionKeyCode:ue="Shift",selectionOnDrag:ee=!1,selectionMode:le=of.Full,panActivationKeyCode:ne="Space",multiSelectionKeyCode:me=cf()?"Meta":"Control",zoomActivationKeyCode:ye=cf()?"Meta":"Control",snapToGrid:te,snapGrid:de,onlyRenderVisibleElements:Ee=!1,selectNodesOnDrag:Te,nodesDraggable:Ke,autoPanOnNodeFocus:Ne,nodesConnectable:it,nodesFocusable:He,nodeOrigin:Ue=kP,edgesFocusable:Et,edgesReconnectable:rt,elementsSelectable:St=!0,defaultViewport:ct=Tle,minZoom:B=.5,maxZoom:Q=2,translateExtent:oe=af,preventScrolling:be=!0,nodeExtent:Oe,defaultMarkerColor:Ye="#b1b1b7",zoomOnScroll:tt=!0,zoomOnPinch:ze=!0,panOnScroll:Tt=!1,panOnScrollSpeed:Re=.5,panOnScrollMode:kt=Io.Free,zoomOnDoubleClick:Pt=!0,panOnDrag:Bt=!0,onPaneClick:bn,onPaneMouseEnter:Xe,onPaneMouseMove:ft,onPaneMouseLeave:xt,onPaneScroll:vt,onPaneContextMenu:fe,paneClickDistance:$e=1,nodeClickDistance:nt=0,children:qt,onReconnect:fn,onReconnectStart:Lt,onReconnectEnd:J,onEdgeContextMenu:he,onEdgeDoubleClick:Le,onEdgeMouseEnter:Be,onEdgeMouseMove:ot,onEdgeMouseLeave:It,reconnectRadius:st=10,onNodesChange:Z,onEdgesChange:we,noDragClassName:_e="nodrag",noWheelClassName:We="nowheel",noPanClassName:Ve="nopan",fitView:Je,fitViewOptions:ut,connectOnClick:Vt,attributionPosition:Ft,proOptions:hn,defaultEdgeOptions:Tn,elevateNodesOnSelect:Kt=!0,elevateEdgesOnSelect:os=!1,disableKeyboardA11y:Er=!1,autoPanOnConnect:Xn,autoPanOnNodeDrag:Or,autoPanOnSelection:Qn=!0,autoPanSpeed:ar,connectionRadius:An,isValidConnection:Xt,onError:En,style:Un,id:or,nodeDragThreshold:nn,connectionDragThreshold:ls,viewport:Zn,onViewportChange:$n,width:Jn,height:Is,colorMode:Rr="light",debug:xr,onScroll:cs,ariaLabelConfig:Kr,zIndexMode:Ga="basic",...qa},Xa){const Si=or||"1",Hn=Ole(Rr),Qa=w.useCallback(Ti=>{Ti.currentTarget.scrollTo({top:0,left:0,behavior:"instant"}),cs==null||cs(Ti)},[cs]);return l.jsx("div",{"data-testid":"rf__wrapper",...qa,onScroll:Qa,style:{...Un,...Jce},ref:Xa,className:Ln(["react-flow",s,Hn]),id:or,role:"application",children:l.jsxs(Zce,{nodes:e,edges:t,width:Jn,height:Is,fitView:Je,fitViewOptions:ut,minZoom:B,maxZoom:Q,nodeOrigin:Ue,nodeExtent:Oe,zIndexMode:Ga,children:[l.jsx(Ile,{nodes:e,edges:t,defaultNodes:n,defaultEdges:r,onConnect:p,onConnectStart:m,onConnectEnd:y,onClickConnectStart:E,onClickConnectEnd:g,nodesDraggable:Ke,autoPanOnNodeFocus:Ne,nodesConnectable:it,nodesFocusable:He,edgesFocusable:Et,edgesReconnectable:rt,elementsSelectable:St,elevateNodesOnSelect:Kt,elevateEdgesOnSelect:os,minZoom:B,maxZoom:Q,nodeExtent:Oe,onNodesChange:Z,onEdgesChange:we,snapToGrid:te,snapGrid:de,connectionMode:V,translateExtent:oe,connectOnClick:Vt,defaultEdgeOptions:Tn,fitView:Je,fitViewOptions:ut,onNodesDelete:O,onEdgesDelete:D,onDelete:U,onNodeDragStart:C,onNodeDrag:S,onNodeDragStop:A,onSelectionDrag:j,onSelectionDragStart:M,onSelectionDragStop:T,onMove:d,onMoveStart:f,onMoveEnd:h,noPanClassName:Ve,nodeOrigin:Ue,rfId:Si,autoPanOnConnect:Xn,autoPanOnNodeDrag:Or,autoPanSpeed:ar,onError:En,connectionRadius:An,isValidConnection:Xt,selectNodesOnDrag:Te,nodeDragThreshold:nn,connectionDragThreshold:ls,onBeforeDelete:I,debug:xr,ariaLabelConfig:Kr,zIndexMode:Ga}),l.jsx(qce,{onInit:u,onNodeClick:o,onEdgeClick:c,onNodeMouseEnter:x,onNodeMouseMove:b,onNodeMouseLeave:_,onNodeContextMenu:k,onNodeDoubleClick:N,nodeTypes:i,edgeTypes:a,connectionLineType:W,connectionLineStyle:P,connectionLineComponent:ie,connectionLineContainerStyle:G,selectionKeyCode:ue,selectionOnDrag:ee,selectionMode:le,deleteKeyCode:re,multiSelectionKeyCode:me,panActivationKeyCode:ne,zoomActivationKeyCode:ye,onlyRenderVisibleElements:Ee,defaultViewport:ct,translateExtent:oe,minZoom:B,maxZoom:Q,preventScrolling:be,zoomOnScroll:tt,zoomOnPinch:ze,zoomOnDoubleClick:Pt,panOnScroll:Tt,panOnScrollSpeed:Re,panOnScrollMode:kt,panOnDrag:Bt,autoPanOnSelection:Qn,onPaneClick:bn,onPaneMouseEnter:Xe,onPaneMouseMove:ft,onPaneMouseLeave:xt,onPaneScroll:vt,onPaneContextMenu:fe,paneClickDistance:$e,nodeClickDistance:nt,onSelectionContextMenu:L,onSelectionStart:R,onSelectionEnd:F,onReconnect:fn,onReconnectStart:Lt,onReconnectEnd:J,onEdgeContextMenu:he,onEdgeDoubleClick:Le,onEdgeMouseEnter:Be,onEdgeMouseMove:ot,onEdgeMouseLeave:It,reconnectRadius:st,defaultMarkerColor:Ye,noDragClassName:_e,noWheelClassName:We,noPanClassName:Ve,rfId:Si,disableKeyboardA11y:Er,nodeExtent:Oe,viewport:Zn,onViewportChange:$n}),l.jsx(Sle,{onSelectionChange:X}),qt,l.jsx(wle,{proOptions:hn,position:Ft}),l.jsx(xle,{rfId:Si,disableKeyboardA11y:Er})]})})}var JP=CP(eue);const tue=e=>{var t;return(t=e.domNode)==null?void 0:t.querySelector(".react-flow__edgelabel-renderer")};function nue({children:e}){const t=wt(tue);return t?Ss.createPortal(e,t):null}function e4(e){const[t,n]=w.useState(e),r=w.useCallback(s=>n(i=>SP(s,i)),[]);return[t,n,r]}function t4(e){const[t,n]=w.useState(e),r=w.useCallback(s=>n(i=>TP(s,i)),[]);return[t,n,r]}const rue=e=>t=>{if(!e.includeHiddenNodes)return t.nodesInitialized;if(t.nodeLookup.size===0)return!1;for(const[,{internals:n}]of t.nodeLookup)if(n.handleBounds===void 0||!Av(n.userNode))return!1;return!0};function sue(e={includeHiddenNodes:!1}){return wt(rue(e))}function iue({dimensions:e,lineWidth:t,variant:n,className:r}){return l.jsx("path",{strokeWidth:t,d:`M${e[0]/2} 0 V${e[1]} M0 ${e[1]/2} H${e[0]}`,className:Ln(["react-flow__background-pattern",n,r])})}function aue({radius:e,className:t}){return l.jsx("circle",{cx:e,cy:e,r:e,className:Ln(["react-flow__background-pattern","dots",t])})}var ja;(function(e){e.Lines="lines",e.Dots="dots",e.Cross="cross"})(ja||(ja={}));const oue={[ja.Dots]:1,[ja.Lines]:1,[ja.Cross]:6},lue=e=>({transform:e.transform,patternId:`pattern-${e.rfId}`});function n4({id:e,variant:t=ja.Dots,gap:n=20,size:r,lineWidth:s=1,offset:i=0,color:a,bgColor:o,style:c,className:u,patternClassName:d}){const f=w.useRef(null),{transform:h,patternId:p}=wt(lue,en),m=r||oue[t],y=t===ja.Dots,E=t===ja.Cross,g=Array.isArray(n)?n:[n,n],x=[g[0]*h[2]||1,g[1]*h[2]||1],b=m*h[2],_=Array.isArray(i)?i:[i,i],k=E?[b,b]:x,N=[_[0]*h[2]||1+k[0]/2,_[1]*h[2]||1+k[1]/2],C=`${p}${e||""}`;return l.jsxs("svg",{className:Ln(["react-flow__background",u]),style:{...c,...s0,"--xy-background-color-props":o,"--xy-background-pattern-color-props":a},ref:f,"data-testid":"rf__background",children:[l.jsx("pattern",{id:C,x:h[0]%x[0],y:h[1]%x[1],width:x[0],height:x[1],patternUnits:"userSpaceOnUse",patternTransform:`translate(-${N[0]},-${N[1]})`,children:y?l.jsx(aue,{radius:b/2,className:d}):l.jsx(iue,{dimensions:k,lineWidth:s,variant:t,className:d})}),l.jsx("rect",{x:"0",y:"0",width:"100%",height:"100%",fill:`url(#${C})`})]})}n4.displayName="Background";const r4=w.memo(n4);function cue(){return l.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 32 32",children:l.jsx("path",{d:"M32 18.133H18.133V32h-4.266V18.133H0v-4.266h13.867V0h4.266v13.867H32z"})})}function uue(){return l.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 32 5",children:l.jsx("path",{d:"M0 0h32v4.2H0z"})})}function due(){return l.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 32 30",children:l.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 fue(){return l.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 25 32",children:l.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 hue(){return l.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 25 32",children:l.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 Zh({children:e,className:t,...n}){return l.jsx("button",{type:"button",className:Ln(["react-flow__controls-button",t]),...n,children:e})}const pue=e=>({isInteractive:e.nodesDraggable||e.nodesConnectable||e.elementsSelectable,minZoomReached:e.transform[2]<=e.minZoom,maxZoomReached:e.transform[2]>=e.maxZoom,ariaLabelConfig:e.ariaLabelConfig});function s4({style:e,showZoom:t=!0,showFitView:n=!0,showInteractive:r=!0,fitViewOptions:s,onZoomIn:i,onZoomOut:a,onFitView:o,onInteractiveChange:c,className:u,children:d,position:f="bottom-left",orientation:h="vertical","aria-label":p}){const m=tn(),{isInteractive:y,minZoomReached:E,maxZoomReached:g,ariaLabelConfig:x}=wt(pue,en),{zoomIn:b,zoomOut:_,fitView:k}=r0(),N=()=>{b(),i==null||i()},C=()=>{_(),a==null||a()},S=()=>{k(s),o==null||o()},A=()=>{m.setState({nodesDraggable:!y,nodesConnectable:!y,elementsSelectable:!y}),c==null||c(!y)},O=h==="horizontal"?"horizontal":"vertical";return l.jsxs(n0,{className:Ln(["react-flow__controls",O,u]),position:f,style:e,"data-testid":"rf__controls","aria-label":p??x["controls.ariaLabel"],children:[t&&l.jsxs(l.Fragment,{children:[l.jsx(Zh,{onClick:N,className:"react-flow__controls-zoomin",title:x["controls.zoomIn.ariaLabel"],"aria-label":x["controls.zoomIn.ariaLabel"],disabled:g,children:l.jsx(cue,{})}),l.jsx(Zh,{onClick:C,className:"react-flow__controls-zoomout",title:x["controls.zoomOut.ariaLabel"],"aria-label":x["controls.zoomOut.ariaLabel"],disabled:E,children:l.jsx(uue,{})})]}),n&&l.jsx(Zh,{className:"react-flow__controls-fitview",onClick:S,title:x["controls.fitView.ariaLabel"],"aria-label":x["controls.fitView.ariaLabel"],children:l.jsx(due,{})}),r&&l.jsx(Zh,{className:"react-flow__controls-interactive",onClick:A,title:x["controls.interactive.ariaLabel"],"aria-label":x["controls.interactive.ariaLabel"],children:y?l.jsx(hue,{}):l.jsx(fue,{})}),d]})}s4.displayName="Controls";const i4=w.memo(s4);function mue({id:e,x:t,y:n,width:r,height:s,style:i,color:a,strokeColor:o,strokeWidth:c,className:u,borderRadius:d,shapeRendering:f,selected:h,onClick:p}){const{background:m,backgroundColor:y}=i||{},E=a||m||y;return l.jsx("rect",{className:Ln(["react-flow__minimap-node",{selected:h},u]),x:t,y:n,rx:d,ry:d,width:r,height:s,style:{fill:E,stroke:o,strokeWidth:c},shapeRendering:f,onClick:p?g=>p(g,e):void 0})}const gue=w.memo(mue),yue=e=>e.nodes.map(t=>t.id),Xy=e=>e instanceof Function?e:()=>e;function bue({nodeStrokeColor:e,nodeColor:t,nodeClassName:n="",nodeBorderRadius:r=5,nodeStrokeWidth:s,nodeComponent:i=gue,onClick:a}){const o=wt(yue,en),c=Xy(t),u=Xy(e),d=Xy(n),f=typeof window>"u"||window.chrome?"crispEdges":"geometricPrecision";return l.jsx(l.Fragment,{children:o.map(h=>l.jsx(xue,{id:h,nodeColorFunc:c,nodeStrokeColorFunc:u,nodeClassNameFunc:d,nodeBorderRadius:r,nodeStrokeWidth:s,NodeComponent:i,onClick:a,shapeRendering:f},h))})}function Eue({id:e,nodeColorFunc:t,nodeStrokeColorFunc:n,nodeClassNameFunc:r,nodeBorderRadius:s,nodeStrokeWidth:i,shapeRendering:a,NodeComponent:o,onClick:c}){const{node:u,x:d,y:f,width:h,height:p}=wt(m=>{const y=m.nodeLookup.get(e);if(!y)return{node:void 0,x:0,y:0,width:0,height:0};const E=y.internals.userNode,{x:g,y:x}=y.internals.positionAbsolute,{width:b,height:_}=ia(E);return{node:E,x:g,y:x,width:b,height:_}},en);return!u||u.hidden||!Av(u)?null:l.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:c,id:u.id})}const xue=w.memo(Eue);var wue=w.memo(bue);const vue=200,_ue=150,kue=e=>!e.hidden,Nue=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?qD(Bf(e.nodeLookup,{filter:kue}),t):t,rfId:e.rfId,panZoom:e.panZoom,translateExtent:e.translateExtent,flowWidth:e.width,flowHeight:e.height,ariaLabelConfig:e.ariaLabelConfig}},Sue="react-flow__minimap-desc";function a4({style:e,className:t,nodeStrokeColor:n,nodeColor:r,nodeClassName:s="",nodeBorderRadius:i=5,nodeStrokeWidth:a,nodeComponent:o,bgColor:c,maskColor:u,maskStrokeColor:d,maskStrokeWidth:f,position:h="bottom-right",onClick:p,onNodeClick:m,pannable:y=!1,zoomable:E=!1,ariaLabel:g,inversePan:x,zoomStep:b=1,offsetScale:_=5}){const k=tn(),N=w.useRef(null),{boundingRect:C,viewBB:S,rfId:A,panZoom:O,translateExtent:D,flowWidth:U,flowHeight:X,ariaLabelConfig:M}=wt(Nue,en),j=(e==null?void 0:e.width)??vue,T=(e==null?void 0:e.height)??_ue,L=C.width/j,R=C.height/T,F=Math.max(L,R),I=F*j,V=F*T,W=_*F,P=C.x-(I-C.width)/2-W,ie=C.y-(V-C.height)/2-W,G=I+W*2,re=V+W*2,ue=`${Sue}-${A}`,ee=w.useRef(0),le=w.useRef();ee.current=F,w.useEffect(()=>{if(N.current&&O)return le.current=Aoe({domNode:N.current,panZoom:O,getTransform:()=>k.getState().transform,getViewScale:()=>ee.current}),()=>{var te;(te=le.current)==null||te.destroy()}},[O]),w.useEffect(()=>{var te;(te=le.current)==null||te.update({translateExtent:D,width:U,height:X,inversePan:x,pannable:y,zoomStep:b,zoomable:E})},[y,E,x,b,D,U,X]);const ne=p?te=>{var Te;const[de,Ee]=((Te=le.current)==null?void 0:Te.pointer(te))||[0,0];p(te,{x:de,y:Ee})}:void 0,me=m?w.useCallback((te,de)=>{const Ee=k.getState().nodeLookup.get(de).internals.userNode;m(te,Ee)},[]):void 0,ye=g??M["minimap.ariaLabel"];return l.jsx(n0,{position:h,style:{...e,"--xy-minimap-background-color-props":typeof c=="string"?c: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*F: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:Ln(["react-flow__minimap",t]),"data-testid":"rf__minimap",children:l.jsxs("svg",{width:j,height:T,viewBox:`${P} ${ie} ${G} ${re}`,className:"react-flow__minimap-svg",role:"img","aria-labelledby":ue,ref:N,onClick:ne,children:[ye&&l.jsx("title",{id:ue,children:ye}),l.jsx(wue,{onClick:me,nodeColor:r,nodeStrokeColor:n,nodeBorderRadius:i,nodeClassName:s,nodeStrokeWidth:a,nodeComponent:o}),l.jsx("path",{className:"react-flow__minimap-mask",d:`M${P-W},${ie-W}h${G+W*2}v${re+W*2}h${-G-W*2}z - M${S.x},${S.y}h${S.width}v${S.height}h${-S.width}z`,fillRule:"evenodd",pointerEvents:"none"})]})})}a4.displayName="MiniMap";const Tue=w.memo(a4),Aue=e=>t=>e?`${Math.max(1/t.transform[2],1)}`:void 0,Cue={[jc.Line]:"right",[jc.Handle]:"bottom-right"};function Iue({nodeId:e,position:t,variant:n=jc.Handle,className:r,style:s=void 0,children:i,color:a,minWidth:o=10,minHeight:c=10,maxWidth:u=Number.MAX_VALUE,maxHeight:d=Number.MAX_VALUE,keepAspectRatio:f=!1,resizeDirection:h,autoScale:p=!0,shouldResize:m,onResizeStart:y,onResize:E,onResizeEnd:g}){const x=LP(),b=typeof e=="string"?e:x,_=tn(),k=w.useRef(null),N=n===jc.Handle,C=wt(w.useCallback(Aue(N&&p),[N,p]),en),S=w.useRef(null),A=t??Cue[n];w.useEffect(()=>{if(!(!k.current||!b))return S.current||(S.current=$oe({domNode:k.current,nodeId:b,getStoreItems:()=>{const{nodeLookup:D,transform:U,snapGrid:X,snapToGrid:M,nodeOrigin:j,domNode:T}=_.getState();return{nodeLookup:D,transform:U,snapGrid:X,snapToGrid:M,nodeOrigin:j,paneDomNode:T}},onChange:(D,U)=>{const{triggerNodeChanges:X,nodeLookup:M,parentLookup:j,nodeOrigin:T}=_.getState(),L=[],R={x:D.x,y:D.y},F=M.get(b);if(F&&F.expandParent&&F.parentId){const I=F.origin??T,V=D.width??F.measured.width??0,W=D.height??F.measured.height??0,P={id:F.id,parentId:F.parentId,rect:{width:V,height:W,...QD({x:D.x??F.position.x,y:D.y??F.position.y},{width:V,height:W},F.parentId,M,I)}},ie=Mv([P],M,j,T);L.push(...ie),R.x=D.x?Math.max(I[0]*V,D.x):void 0,R.y=D.y?Math.max(I[1]*W,D.y):void 0}if(R.x!==void 0&&R.y!==void 0){const I={id:b,type:"position",position:{...R}};L.push(I)}if(D.width!==void 0&&D.height!==void 0){const V={id:b,type:"dimensions",resizing:!0,setAttributes:h?h==="horizontal"?"width":"height":!0,dimensions:{width:D.width,height:D.height}};L.push(V)}for(const I of U){const V={...I,type:"position"};L.push(V)}X(L)},onEnd:({width:D,height:U})=>{const X={id:b,type:"dimensions",resizing:!1,dimensions:{width:D,height:U}};_.getState().triggerNodeChanges([X])}})),S.current.update({controlPosition:A,boundaries:{minWidth:o,minHeight:c,maxWidth:u,maxHeight:d},keepAspectRatio:f,resizeDirection:h,onResizeStart:y,onResize:E,onResizeEnd:g,shouldResize:m}),()=>{var D;(D=S.current)==null||D.destroy()}},[A,o,c,u,d,f,y,E,g,m]);const O=A.split("-");return l.jsx("div",{className:Ln(["react-flow__resize-control","nodrag",...O,n,r]),ref:k,style:{...s,scale:C,...a&&{[N?"backgroundColor":"borderColor"]:a}},children:i})}w.memo(Iue);var o4=Object.defineProperty,Oue=(e,t,n)=>t in e?o4(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,Rue=(e,t)=>{for(var n in t)o4(e,n,{get:t[n],enumerable:!0})},Lue=(e,t,n)=>Oue(e,t+"",n),l4={};Rue(l4,{Graph:()=>Cs,alg:()=>Pv,json:()=>u4,version:()=>Due});var Mue=Object.defineProperty,c4=(e,t)=>{for(var n in t)Mue(e,n,{get:t[n],enumerable:!0})},Cs=class{constructor(e){this._isDirected=!0,this._isMultigraph=!1,this._isCompound=!1,this._nodes={},this._in={},this._preds={},this._out={},this._sucs={},this._edgeObjs={},this._edgeLabels={},this._nodeCount=0,this._edgeCount=0,this._defaultNodeLabelFn=()=>{},this._defaultEdgeLabelFn=()=>{},e&&(this._isDirected="directed"in e?e.directed:!0,this._isMultigraph="multigraph"in e?e.multigraph:!1,this._isCompound="compound"in e?e.compound:!1),this._isCompound&&(this._parent={},this._children={},this._children["\0"]={})}isDirected(){return this._isDirected}isMultigraph(){return this._isMultigraph}isCompound(){return this._isCompound}setGraph(e){return this._label=e,this}graph(){return this._label}setDefaultNodeLabel(e){return typeof e!="function"?this._defaultNodeLabelFn=()=>e:this._defaultNodeLabelFn=e,this}nodeCount(){return this._nodeCount}nodes(){return Object.keys(this._nodes)}sources(){return this.nodes().filter(e=>Object.keys(this._in[e]).length===0)}sinks(){return this.nodes().filter(e=>Object.keys(this._out[e]).length===0)}setNodes(e,t){return e.forEach(n=>{t!==void 0?this.setNode(n,t):this.setNode(n)}),this}setNode(e,t){return e in this._nodes?(arguments.length>1&&(this._nodes[e]=t),this):(this._nodes[e]=arguments.length>1?t:this._defaultNodeLabelFn(e),this._isCompound&&(this._parent[e]="\0",this._children[e]={},this._children["\0"][e]=!0),this._in[e]={},this._preds[e]={},this._out[e]={},this._sucs[e]={},++this._nodeCount,this)}node(e){return this._nodes[e]}hasNode(e){return e in this._nodes}removeNode(e){if(e in this._nodes){let t=n=>this.removeEdge(this._edgeObjs[n]);delete this._nodes[e],this._isCompound&&(this._removeFromParentsChildList(e),delete this._parent[e],this.children(e).forEach(n=>{this.setParent(n)}),delete this._children[e]),Object.keys(this._in[e]).forEach(t),delete this._in[e],delete this._preds[e],Object.keys(this._out[e]).forEach(t),delete this._out[e],delete this._sucs[e],--this._nodeCount}return this}setParent(e,t){if(!this._isCompound)throw new Error("Cannot set parent in a non-compound graph");if(t===void 0)t="\0";else{t+="";for(let n=t;n!==void 0;n=this.parent(n))if(n===e)throw new Error("Setting "+t+" as parent of "+e+" would create a cycle");this.setNode(t)}return this.setNode(e),this._removeFromParentsChildList(e),this._parent[e]=t,this._children[t][e]=!0,this}parent(e){if(this._isCompound){let t=this._parent[e];if(t!=="\0")return t}}children(e="\0"){if(this._isCompound){let t=this._children[e];if(t)return Object.keys(t)}else{if(e==="\0")return this.nodes();if(this.hasNode(e))return[]}return[]}predecessors(e){let t=this._preds[e];if(t)return Object.keys(t)}successors(e){let t=this._sucs[e];if(t)return Object.keys(t)}neighbors(e){let t=this.predecessors(e);if(t){let n=new Set(t);for(let r of this.successors(e))n.add(r);return Array.from(n.values())}}isLeaf(e){let t;return this.isDirected()?t=this.successors(e):t=this.neighbors(e),t.length===0}filterNodes(e){let t=new this.constructor({directed:this._isDirected,multigraph:this._isMultigraph,compound:this._isCompound});t.setGraph(this.graph()),Object.entries(this._nodes).forEach(([s,i])=>{e(s)&&t.setNode(s,i)}),Object.values(this._edgeObjs).forEach(s=>{t.hasNode(s.v)&&t.hasNode(s.w)&&t.setEdge(s,this.edge(s))});let n={},r=s=>{let i=this.parent(s);return!i||t.hasNode(i)?(n[s]=i??void 0,i??void 0):i in n?n[i]:r(i)};return this._isCompound&&t.nodes().forEach(s=>t.setParent(s,r(s))),t}setDefaultEdgeLabel(e){return typeof e!="function"?this._defaultEdgeLabelFn=()=>e:this._defaultEdgeLabelFn=e,this}edgeCount(){return this._edgeCount}edges(){return Object.values(this._edgeObjs)}setPath(e,t){return e.reduce((n,r)=>(t!==void 0?this.setEdge(n,r,t):this.setEdge(n,r),r)),this}setEdge(e,t,n,r){let s,i,a,o,c=!1;typeof e=="object"&&e!==null&&"v"in e?(s=e.v,i=e.w,a=e.name,arguments.length===2&&(o=t,c=!0)):(s=e,i=t,a=r,arguments.length>2&&(o=n,c=!0)),s=""+s,i=""+i,a!==void 0&&(a=""+a);let u=zu(this._isDirected,s,i,a);if(u in this._edgeLabels)return c&&(this._edgeLabels[u]=o),this;if(a!==void 0&&!this._isMultigraph)throw new Error("Cannot set a named edge when isMultigraph = false");this.setNode(s),this.setNode(i),this._edgeLabels[u]=c?o:this._defaultEdgeLabelFn(s,i,a);let d=jue(this._isDirected,s,i,a);return s=d.v,i=d.w,Object.freeze(d),this._edgeObjs[u]=d,pA(this._preds[i],s),pA(this._sucs[s],i),this._in[i][u]=d,this._out[s][u]=d,this._edgeCount++,this}edge(e,t,n){let r=arguments.length===1?Qy(this._isDirected,e):zu(this._isDirected,e,t,n);return this._edgeLabels[r]}edgeAsObj(e,t,n){let r=arguments.length===1?this.edge(e):this.edge(e,t,n);return typeof r!="object"?{label:r}:r}hasEdge(e,t,n){return(arguments.length===1?Qy(this._isDirected,e):zu(this._isDirected,e,t,n))in this._edgeLabels}removeEdge(e,t,n){let r=arguments.length===1?Qy(this._isDirected,e):zu(this._isDirected,e,t,n),s=this._edgeObjs[r];if(s){let i=s.v,a=s.w;delete this._edgeLabels[r],delete this._edgeObjs[r],mA(this._preds[a],i),mA(this._sucs[i],a),delete this._in[a][r],delete this._out[i][r],this._edgeCount--}return this}inEdges(e,t){return this.isDirected()?this.filterEdges(this._in[e],e,t):this.nodeEdges(e,t)}outEdges(e,t){return this.isDirected()?this.filterEdges(this._out[e],e,t):this.nodeEdges(e,t)}nodeEdges(e,t){if(e in this._nodes)return this.filterEdges({...this._in[e],...this._out[e]},e,t)}_removeFromParentsChildList(e){delete this._children[this._parent[e]][e]}filterEdges(e,t,n){if(!e)return;let r=Object.values(e);return n?r.filter(s=>s.v===t&&s.w===n||s.v===n&&s.w===t):r}};function pA(e,t){e[t]?e[t]++:e[t]=1}function mA(e,t){e[t]!==void 0&&!--e[t]&&delete e[t]}function zu(e,t,n,r){let s=""+t,i=""+n;if(!e&&s>i){let a=s;s=i,i=a}return s+""+i+""+(r===void 0?"\0":r)}function jue(e,t,n,r){let s=""+t,i=""+n;if(!e&&s>i){let o=s;s=i,i=o}let a={v:s,w:i};return r&&(a.name=r),a}function Qy(e,t){return zu(e,t.v,t.w,t.name)}var Due="4.0.1",u4={};c4(u4,{read:()=>Uue,write:()=>Pue});function Pue(e){let t={options:{directed:e.isDirected(),multigraph:e.isMultigraph(),compound:e.isCompound()},nodes:Bue(e),edges:Fue(e)},n=e.graph();return n!==void 0&&(t.value=structuredClone(n)),t}function Bue(e){return e.nodes().map(t=>{let n=e.node(t),r=e.parent(t),s={v:t};return n!==void 0&&(s.value=n),r!==void 0&&(s.parent=r),s})}function Fue(e){return e.edges().map(t=>{let n=e.edge(t),r={v:t.v,w:t.w};return t.name!==void 0&&(r.name=t.name),n!==void 0&&(r.value=n),r})}function Uue(e){let t=new Cs(e.options);return e.value!==void 0&&t.setGraph(e.value),e.nodes.forEach(n=>{t.setNode(n.v,n.value),n.parent&&t.setParent(n.v,n.parent)}),e.edges.forEach(n=>{t.setEdge({v:n.v,w:n.w,name:n.name},n.value)}),t}var Pv={};c4(Pv,{CycleException:()=>Wm,bellmanFord:()=>d4,components:()=>zue,dijkstra:()=>Ym,dijkstraAll:()=>Yue,findCycles:()=>Wue,floydWarshall:()=>que,isAcyclic:()=>Que,postorder:()=>Jue,preorder:()=>ede,prim:()=>tde,shortestPaths:()=>nde,tarjan:()=>h4,topsort:()=>p4});var $ue=()=>1;function d4(e,t,n,r){return Hue(e,String(t),n||$ue,r||function(s){return e.outEdges(s)})}function Hue(e,t,n,r){let s={},i,a=0,o=e.nodes(),c=function(f){let h=n(f);s[f.v].distance+he.key)}has(e){return e in this._keyIndices}priority(e){let t=this._keyIndices[e];if(t!==void 0)return this._arr[t].priority}min(){if(this.size()===0)throw new Error("Queue underflow");return this._arr[0].key}add(e,t){let n=this._keyIndices,r=String(e);if(!(r in n)){let s=this._arr,i=s.length;return n[r]=i,s.push({key:r,priority:t}),this._decrease(i),!0}return!1}removeMin(){this._swap(0,this._arr.length-1);let e=this._arr.pop();return delete this._keyIndices[e.key],this._heapify(0),e.key}decrease(e,t){let n=this._keyIndices[e];if(n===void 0)throw new Error(`Key not found: ${e}`);let r=this._arr[n].priority;if(t>r)throw new Error(`New priority is greater than current priority. Key: ${e} Old: ${r} New: ${t}`);this._arr[n].priority=t,this._decrease(n)}_heapify(e){let t=this._arr,n=2*e,r=n+1,s=e;n>1,!(t[r].priority1;function Ym(e,t,n,r){let s=function(i){return e.outEdges(i)};return Kue(e,String(t),n||Vue,r||s)}function Kue(e,t,n,r){let s={},i=new f4,a,o,c=function(u){let d=u.v!==a?u.v:u.w,f=s[d],h=n(u),p=o.distance+h;if(h<0)throw new Error("dijkstra does not allow negative edge weights. Bad edge: "+u+" Weight: "+h);p0&&(a=i.removeMin(),o=s[a],o.distance!==Number.POSITIVE_INFINITY);)r(a).forEach(c);return s}function Yue(e,t,n){return e.nodes().reduce(function(r,s){return r[s]=Ym(e,s,t,n),r},{})}function h4(e){let t=0,n=[],r={},s=[];function i(a){let o=r[a]={onStack:!0,lowlink:t,index:t++};if(n.push(a),e.successors(a).forEach(function(c){c in r?r[c].onStack&&(o.lowlink=Math.min(o.lowlink,r[c].index)):(i(c),o.lowlink=Math.min(o.lowlink,r[c].lowlink))}),o.lowlink===o.index){let c=[],u;do u=n.pop(),r[u].onStack=!1,c.push(u);while(a!==u);s.push(c)}}return e.nodes().forEach(function(a){a in r||i(a)}),s}function Wue(e){return h4(e).filter(function(t){return t.length>1||t.length===1&&e.hasEdge(t[0],t[0])})}var Gue=()=>1;function que(e,t,n){return Xue(e,t||Gue,n||function(r){return e.outEdges(r)})}function Xue(e,t,n){let r={},s=e.nodes();return s.forEach(function(i){r[i]={},r[i][i]={distance:0,predecessor:""},s.forEach(function(a){i!==a&&(r[i][a]={distance:Number.POSITIVE_INFINITY,predecessor:""})}),n(i).forEach(function(a){let o=a.v===i?a.w:a.v,c=t(a);r[i][o]={distance:c,predecessor:i}})}),s.forEach(function(i){let a=r[i];s.forEach(function(o){let c=r[o];s.forEach(function(u){let d=c[i],f=a[u],h=c[u],p=d.distance+f.distance;p{var c;return(c=e.isDirected()?e.successors(o):e.neighbors(o))!=null?c:[]},a={};return t.forEach(function(o){if(!e.hasNode(o))throw new Error("Graph does not have node: "+o);s=m4(e,o,n==="post",a,i,r,s)}),s}function m4(e,t,n,r,s,i,a){return t in r||(r[t]=!0,n||(a=i(a,t)),s(t).forEach(function(o){a=m4(e,o,n,r,s,i,a)}),n&&(a=i(a,t))),a}function g4(e,t,n){return Zue(e,t,n,function(r,s){return r.push(s),r},[])}function Jue(e,t){return g4(e,t,"post")}function ede(e,t){return g4(e,t,"pre")}function tde(e,t){let n=new Cs,r={},s=new f4,i;function a(c){let u=c.v===i?c.w:c.v,d=s.priority(u);if(d!==void 0){let f=t(c);f0;){if(i=s.removeMin(),i in r)n.setEdge(i,r[i]);else{if(o)throw new Error("Input graph is not connected: "+e);o=!0}e.nodeEdges(i).forEach(a)}return n}function nde(e,t,n,r){return rde(e,t,n,r??(s=>{let i=e.outEdges(s);return i??[]}))}function rde(e,t,n,r){if(n===void 0)return Ym(e,t,n,r);let s=!1,i=e.nodes();for(let a=0;at.setNode(n,e.node(n))),e.edges().forEach(n=>{let r=t.edge(n.v,n.w)||{weight:0,minlen:1},s=e.edge(n);t.setEdge(n.v,n.w,{weight:r.weight+s.weight,minlen:Math.max(r.minlen,s.minlen)})}),t}function y4(e){let t=new Cs({multigraph:e.isMultigraph()}).setGraph(e.graph());return e.nodes().forEach(n=>{e.children(n).length||t.setNode(n,e.node(n))}),e.edges().forEach(n=>{t.setEdge(n,e.edge(n))}),t}function gA(e,t){let n=e.x,r=e.y,s=t.x-n,i=t.y-r,a=e.width/2,o=e.height/2;if(!s&&!i)throw new Error("Not possible to find intersection inside of the rectangle");let c,u;return Math.abs(i)*a>Math.abs(s)*o?(i<0&&(o=-o),c=o*s/i,u=o):(s<0&&(a=-a),c=a,u=a*i/s),{x:n+c,y:r+u}}function $f(e){let t=df(E4(e)+1).map(()=>[]);return e.nodes().forEach(n=>{let r=e.node(n),s=r.rank;s!==void 0&&(t[s]||(t[s]=[]),t[s][r.order]=n)}),t}function ide(e){let t=e.nodes().map(r=>{let s=e.node(r).rank;return s===void 0?Number.MAX_VALUE:s}),n=mi(Math.min,t);e.nodes().forEach(r=>{let s=e.node(r);Object.hasOwn(s,"rank")&&(s.rank-=n)})}function ade(e){let t=e.nodes().map(a=>e.node(a).rank).filter(a=>a!==void 0),n=mi(Math.min,t),r=[];e.nodes().forEach(a=>{let o=e.node(a).rank-n;r[o]||(r[o]=[]),r[o].push(a)});let s=0,i=e.graph().nodeRankFactor;Array.from(r).forEach((a,o)=>{a===void 0&&o%i!==0?--s:a!==void 0&&s&&a.forEach(c=>e.node(c).rank+=s)})}function yA(e,t,n,r){let s={width:0,height:0};return arguments.length>=4&&(s.rank=n,s.order=r),Jc(e,"border",s,t)}function ode(e,t=b4){let n=[];for(let r=0;rb4){let n=ode(t);return e(...n.map(r=>e(...r)))}else return e(...t)}function E4(e){let t=e.nodes().map(n=>{let r=e.node(n).rank;return r===void 0?Number.MIN_VALUE:r});return mi(Math.max,t)}function lde(e,t){let n={lhs:[],rhs:[]};return e.forEach(r=>{t(r)?n.lhs.push(r):n.rhs.push(r)}),n}function x4(e,t){let n=Date.now();try{return t()}finally{console.log(e+" time: "+(Date.now()-n)+"ms")}}function w4(e,t){return t()}var cde=0;function Bv(e){let t=++cde;return e+(""+t)}function df(e,t,n=1){t==null&&(t=e,e=0);let r=i=>itr[t]:n=t,Object.entries(e).reduce((r,[s,i])=>(r[s]=n(i,s),r),{})}function ude(e,t){return e.reduce((n,r,s)=>(n[r]=t[s],n),{})}var a0="\0",dde="3.0.0",fde=class{constructor(){Lue(this,"_sentinel");let e={};e._next=e._prev=e,this._sentinel=e}dequeue(){let e=this._sentinel,t=e._prev;if(t!==e)return bA(t),t}enqueue(e){let t=this._sentinel;e._prev&&e._next&&bA(e),e._next=t._next,t._next._prev=e,t._next=e,e._prev=t}toString(){let e=[],t=this._sentinel,n=t._prev;for(;n!==t;)e.push(JSON.stringify(n,hde)),n=n._prev;return"["+e.join(", ")+"]"}};function bA(e){e._prev._next=e._next,e._next._prev=e._prev,delete e._next,delete e._prev}function hde(e,t){if(e!=="_next"&&e!=="_prev")return t}var pde=fde,mde=()=>1;function gde(e,t){if(e.nodeCount()<=1)return[];let n=bde(e,t||mde);return yde(n.graph,n.buckets,n.zeroIdx).flatMap(r=>e.outEdges(r.v,r.w)||[])}function yde(e,t,n){var r;let s=[],i=t[t.length-1],a=t[0],o;for(;e.nodeCount();){for(;o=a.dequeue();)Zy(e,t,n,o);for(;o=i.dequeue();)Zy(e,t,n,o);if(e.nodeCount()){for(let c=t.length-2;c>0;--c)if(o=(r=t[c])==null?void 0:r.dequeue(),o){s=s.concat(Zy(e,t,n,o,!0)||[]);break}}}return s}function Zy(e,t,n,r,s){let i=[],a=s?i:void 0;return(e.inEdges(r.v)||[]).forEach(o=>{let c=e.edge(o),u=e.node(o.v);s&&i.push({v:o.v,w:o.w}),u.out-=c,ME(t,n,u)}),(e.outEdges(r.v)||[]).forEach(o=>{let c=e.edge(o),u=o.w,d=e.node(u);d.in-=c,ME(t,n,d)}),e.removeNode(r.v),a}function bde(e,t){let n=new Cs,r=0,s=0;e.nodes().forEach(o=>{n.setNode(o,{v:o,in:0,out:0})}),e.edges().forEach(o=>{let c=n.edge(o.v,o.w)||0,u=t(o),d=c+u;n.setEdge(o.v,o.w,d);let f=n.node(o.v),h=n.node(o.w);s=Math.max(s,f.out+=u),r=Math.max(r,h.in+=u)});let i=Ede(s+r+3).map(()=>new pde),a=r+1;return n.nodes().forEach(o=>{ME(i,a,n.node(o))}),{graph:n,buckets:i,zeroIdx:a}}function ME(e,t,n){var r,s,i;n.out?n.in?(i=e[n.out-n.in+t])==null||i.enqueue(n):(s=e[e.length-1])==null||s.enqueue(n):(r=e[0])==null||r.enqueue(n)}function Ede(e){let t=[];for(let n=0;n{let r=e.edge(n);e.removeEdge(n),r.forwardName=n.name,r.reversed=!0,e.setEdge(n.w,n.v,r,Bv("rev"))});function t(n){return r=>n.edge(r).weight}}function wde(e){let t=[],n={},r={};function s(i){Object.hasOwn(r,i)||(r[i]=!0,n[i]=!0,e.outEdges(i).forEach(a=>{Object.hasOwn(n,a.w)?t.push(a):s(a.w)}),delete n[i])}return e.nodes().forEach(s),t}function vde(e){e.edges().forEach(t=>{let n=e.edge(t);if(n.reversed){e.removeEdge(t);let r=n.forwardName;delete n.reversed,delete n.forwardName,e.setEdge(t.w,t.v,n,r)}})}function _de(e){e.graph().dummyChains=[],e.edges().forEach(t=>kde(e,t))}function kde(e,t){let n=t.v,r=e.node(n).rank,s=t.w,i=e.node(s).rank,a=t.name,o=e.edge(t),c=o.labelRank;if(i===r+1)return;e.removeEdge(t);let u,d,f;for(f=0,++r;r{let n=e.node(t),r=n.edgeLabel,s;for(e.setEdge(n.edgeObj,r);n.dummy;)s=e.successors(t)[0],e.removeNode(t),r.points.push({x:n.x,y:n.y}),n.dummy==="edge-label"&&(r.x=n.x,r.y=n.y,r.width=n.width,r.height=n.height),t=s,n=e.node(t)})}function Fv(e){let t={};function n(r){let s=e.node(r);if(Object.hasOwn(t,r))return s.rank;t[r]=!0;let i=e.outEdges(r),a=i?i.map(c=>c==null?Number.POSITIVE_INFINITY:n(c.w)-e.edge(c).minlen):[],o=mi(Math.min,a);return o===Number.POSITIVE_INFINITY&&(o=0),s.rank=o}e.sources().forEach(n)}function Pc(e,t){return e.node(t.w).rank-e.node(t.v).rank-e.edge(t).minlen}var v4=Sde;function Sde(e){let t=new Cs({directed:!1}),n=e.nodes();if(n.length===0)throw new Error("Graph must have at least one node");let r=n[0],s=e.nodeCount();t.setNode(r,{});let i,a;for(;Tde(t,e){let a=i.v,o=r===a?i.w:a;!e.hasNode(o)&&!Pc(t,i)&&(e.setNode(o,{}),e.setEdge(r,o,{}),n(o))})}return e.nodes().forEach(n),e.nodeCount()}function Ade(e,t){return t.edges().reduce((n,r)=>{let s=Number.POSITIVE_INFINITY;return e.hasNode(r.v)!==e.hasNode(r.w)&&(s=Pc(t,r)),st.node(r).rank+=n)}var{preorder:Ide,postorder:Ode}=Pv,Rde=Jo;Jo.initLowLimValues=$v;Jo.initCutValues=Uv;Jo.calcCutValue=_4;Jo.leaveEdge=N4;Jo.enterEdge=S4;Jo.exchangeEdges=T4;function Jo(e){e=sde(e),Fv(e);let t=v4(e);$v(t),Uv(t,e);let n,r;for(;n=N4(t);)r=S4(t,e,n),T4(t,e,n,r)}function Uv(e,t){let n=Ode(e,e.nodes());n=n.slice(0,n.length-1),n.forEach(r=>Lde(e,t,r))}function Lde(e,t,n){let r=e.node(n).parent,s=e.edge(n,r);s.cutvalue=_4(e,t,n)}function _4(e,t,n){let r=e.node(n).parent,s=!0,i=t.edge(n,r),a=0;i||(s=!1,i=t.edge(r,n)),a=i.weight;let o=t.nodeEdges(n);return o&&o.forEach(c=>{let u=c.v===n,d=u?c.w:c.v;if(d!==r){let f=u===s,h=t.edge(c).weight;if(a+=f?h:-h,jde(e,n,d)){let p=e.edge(n,d).cutvalue;a+=f?-p:p}}}),a}function $v(e,t){arguments.length<2&&(t=e.nodes()[0]),k4(e,{},1,t)}function k4(e,t,n,r,s){let i=n,a=e.node(r);t[r]=!0;let o=e.neighbors(r);return o&&o.forEach(c=>{Object.hasOwn(t,c)||(n=k4(e,t,n,c,r))}),a.low=i,a.lim=n++,s?a.parent=s:delete a.parent,n}function N4(e){return e.edges().find(t=>e.edge(t).cutvalue<0)}function S4(e,t,n){let r=n.v,s=n.w;t.hasEdge(r,s)||(r=n.w,s=n.v);let i=e.node(r),a=e.node(s),o=i,c=!1;return i.lim>a.lim&&(o=a,c=!0),t.edges().filter(u=>c===EA(e,e.node(u.v),o)&&c!==EA(e,e.node(u.w),o)).reduce((u,d)=>Pc(t,d)!e.node(s).parent);if(!n)return;let r=Ide(e,[n]);r=r.slice(1),r.forEach(s=>{let i=e.node(s).parent,a=t.edge(s,i),o=!1;a||(a=t.edge(i,s),o=!0),t.node(s).rank=t.node(i).rank+(o?a.minlen:-a.minlen)})}function jde(e,t,n){return e.hasEdge(t,n)}function EA(e,t,n){return n.low<=t.lim&&t.lim<=n.lim}var Dde=Pde;function Pde(e){let t=e.graph().ranker;if(typeof t=="function")return t(e);switch(t){case"network-simplex":xA(e);break;case"tight-tree":Fde(e);break;case"longest-path":Bde(e);break;case"none":break;default:xA(e)}}var Bde=Fv;function Fde(e){Fv(e),v4(e)}function xA(e){Rde(e)}var Ude=$de;function $de(e){let t=zde(e);e.graph().dummyChains.forEach(n=>{let r=e.node(n),s=r.edgeObj,i=Hde(e,t,s.v,s.w),a=i.path,o=i.lca,c=0,u=a[c],d=!0;for(;n!==s.w;){if(r=e.node(n),d){for(;(u=a[c])!==o&&e.node(u).maxRanka||o>t[c].lim));let u=c,d=r;for(;(d=e.parent(d))!==u;)i.push(d);return{path:s.concat(i.reverse()),lca:u}}function zde(e){let t={},n=0;function r(s){let i=n;e.children(s).forEach(r),t[s]={low:i,lim:n++}}return e.children(a0).forEach(r),t}function Vde(e){let t=Jc(e,"root",{},"_root"),n=Kde(e),r=Object.values(n),s=mi(Math.max,r)-1,i=2*s+1;e.graph().nestingRoot=t,e.edges().forEach(o=>e.edge(o).minlen*=i);let a=Yde(e)+1;e.children(a0).forEach(o=>A4(e,t,i,a,s,n,o)),e.graph().nodeRankFactor=i}function A4(e,t,n,r,s,i,a){var o;let c=e.children(a);if(!c.length){a!==t&&e.setEdge(t,a,{weight:0,minlen:n});return}let u=yA(e,"_bt"),d=yA(e,"_bb"),f=e.node(a);e.setParent(u,a),f.borderTop=u,e.setParent(d,a),f.borderBottom=d,c.forEach(h=>{var p;A4(e,t,n,r,s,i,h);let m=e.node(h),y=m.borderTop?m.borderTop:h,E=m.borderBottom?m.borderBottom:h,g=m.borderTop?r:2*r,x=y!==E?1:s-((p=i[a])!=null?p:0)+1;e.setEdge(u,y,{weight:g,minlen:x,nestingEdge:!0}),e.setEdge(E,d,{weight:g,minlen:x,nestingEdge:!0})}),e.parent(a)||e.setEdge(t,u,{weight:0,minlen:s+((o=i[a])!=null?o:0)})}function Kde(e){let t={};function n(r,s){let i=e.children(r);i&&i.length&&i.forEach(a=>n(a,s+1)),t[r]=s}return e.children(a0).forEach(r=>n(r,1)),t}function Yde(e){return e.edges().reduce((t,n)=>t+e.edge(n).weight,0)}function Wde(e){let t=e.graph();e.removeNode(t.nestingRoot),delete t.nestingRoot,e.edges().forEach(n=>{e.edge(n).nestingEdge&&e.removeEdge(n)})}var Gde=qde;function qde(e){function t(n){let r=e.children(n),s=e.node(n);if(r.length&&r.forEach(t),Object.hasOwn(s,"minRank")){s.borderLeft=[],s.borderRight=[];for(let i=s.minRank,a=s.maxRank+1;ivA(e.node(t))),e.edges().forEach(t=>vA(e.edge(t)))}function vA(e){let t=e.width;e.width=e.height,e.height=t}function Zde(e){e.nodes().forEach(t=>Jy(e.node(t))),e.edges().forEach(t=>{var n;let r=e.edge(t);(n=r.points)==null||n.forEach(Jy),Object.hasOwn(r,"y")&&Jy(r)})}function Jy(e){e.y=-e.y}function Jde(e){e.nodes().forEach(t=>eb(e.node(t))),e.edges().forEach(t=>{var n;let r=e.edge(t);(n=r.points)==null||n.forEach(eb),Object.hasOwn(r,"x")&&eb(r)})}function eb(e){let t=e.x;e.x=e.y,e.y=t}function efe(e){let t={},n=e.nodes().filter(o=>!e.children(o).length),r=n.map(o=>e.node(o).rank),s=mi(Math.max,r),i=df(s+1).map(()=>[]);function a(o){if(t[o])return;t[o]=!0;let c=e.node(o);i[c.rank].push(o);let u=e.successors(o);u&&u.forEach(a)}return n.sort((o,c)=>e.node(o).rank-e.node(c).rank).forEach(a),i}function tfe(e,t){let n=0;for(let r=1;rd)),s=t.flatMap(u=>{let d=e.outEdges(u);return d?d.map(f=>({pos:r[f.w],weight:e.edge(f).weight})).sort((f,h)=>f.pos-h.pos):[]}),i=1;for(;i{let d=u.pos+i;o[d]+=u.weight;let f=0;for(;d>0;)d%2&&(f+=o[d+1]),d=d-1>>1,o[d]+=u.weight;c+=u.weight*f}),c}function rfe(e,t=[]){return t.map(n=>{let r=e.inEdges(n);if(!r||!r.length)return{v:n};{let s=r.reduce((i,a)=>{let o=e.edge(a),c=e.node(a.v);return{sum:i.sum+o.weight*c.order,weight:i.weight+o.weight}},{sum:0,weight:0});return{v:n,barycenter:s.sum/s.weight,weight:s.weight}}})}function sfe(e,t){let n={};e.forEach((s,i)=>{let a={indegree:0,in:[],out:[],vs:[s.v],i};s.barycenter!==void 0&&(a.barycenter=s.barycenter,a.weight=s.weight),n[s.v]=a}),t.edges().forEach(s=>{let i=n[s.v],a=n[s.w];i!==void 0&&a!==void 0&&(a.indegree++,i.out.push(a))});let r=Object.values(n).filter(s=>!s.indegree);return ife(r)}function ife(e){let t=[];function n(s){return i=>{i.merged||(i.barycenter===void 0||s.barycenter===void 0||i.barycenter>=s.barycenter)&&afe(s,i)}}function r(s){return i=>{i.in.push(s),--i.indegree===0&&e.push(i)}}for(;e.length;){let s=e.pop();t.push(s),s.in.reverse().forEach(n(s)),s.out.forEach(r(s))}return t.filter(s=>!s.merged).map(s=>Gm(s,["vs","i","barycenter","weight"]))}function afe(e,t){let n=0,r=0;e.weight&&(n+=e.barycenter*e.weight,r+=e.weight),t.weight&&(n+=t.barycenter*t.weight,r+=t.weight),e.vs=t.vs.concat(e.vs),e.barycenter=n/r,e.weight=r,e.i=Math.min(t.i,e.i),t.merged=!0}function ofe(e,t){let n=lde(e,d=>Object.hasOwn(d,"barycenter")),r=n.lhs,s=n.rhs.sort((d,f)=>f.i-d.i),i=[],a=0,o=0,c=0;r.sort(lfe(!!t)),c=_A(i,s,c),r.forEach(d=>{c+=d.vs.length,i.push(d.vs),a+=d.barycenter*d.weight,o+=d.weight,c=_A(i,s,c)});let u={vs:i.flat(1)};return o&&(u.barycenter=a/o,u.weight=o),u}function _A(e,t,n){let r;for(;t.length&&(r=t[t.length-1]).i<=n;)t.pop(),e.push(r.vs),n++;return n}function lfe(e){return(t,n)=>t.barycentern.barycenter?1:e?n.i-t.i:t.i-n.i}function I4(e,t,n,r){let s=e.children(t),i=e.node(t),a=i?i.borderLeft:void 0,o=i?i.borderRight:void 0,c={};a&&(s=s.filter(h=>h!==a&&h!==o));let u=rfe(e,s);u.forEach(h=>{if(e.children(h.v).length){let p=I4(e,h.v,n,r);c[h.v]=p,Object.hasOwn(p,"barycenter")&&ufe(h,p)}});let d=sfe(u,n);cfe(d,c);let f=ofe(d,r);if(a&&o){f.vs=[a,f.vs,o].flat(1);let h=e.predecessors(a);if(h&&h.length){let p=e.node(h[0]),m=e.predecessors(o),y=e.node(m[0]);Object.hasOwn(f,"barycenter")||(f.barycenter=0,f.weight=0),f.barycenter=(f.barycenter*f.weight+p.order+y.order)/(f.weight+2),f.weight+=2}}return f}function cfe(e,t){e.forEach(n=>{n.vs=n.vs.flatMap(r=>t[r]?t[r].vs:r)})}function ufe(e,t){e.barycenter!==void 0?(e.barycenter=(e.barycenter*e.weight+t.barycenter*t.weight)/(e.weight+t.weight),e.weight+=t.weight):(e.barycenter=t.barycenter,e.weight=t.weight)}function dfe(e,t,n,r){r||(r=e.nodes());let s=ffe(e),i=new Cs({compound:!0}).setGraph({root:s}).setDefaultNodeLabel(a=>e.node(a));return r.forEach(a=>{let o=e.node(a),c=e.parent(a);if(o.rank===t||o.minRank<=t&&t<=o.maxRank){i.setNode(a),i.setParent(a,c||s);let u=e[n](a);u&&u.forEach(d=>{let f=d.v===a?d.w:d.v,h=i.edge(f,a),p=h!==void 0?h.weight:0;i.setEdge(f,a,{weight:e.edge(d).weight+p})}),Object.hasOwn(o,"minRank")&&i.setNode(a,{borderLeft:o.borderLeft[t],borderRight:o.borderRight[t]})}}),i}function ffe(e){let t;for(;e.hasNode(t=Bv("_root")););return t}function hfe(e,t,n){let r={},s;n.forEach(i=>{let a=e.parent(i),o,c;for(;a;){if(o=e.parent(a),o?(c=r[o],r[o]=a):(c=s,s=a),c&&c!==a){t.setEdge(c,a);return}a=o}})}function O4(e,t={}){if(typeof t.customOrder=="function"){t.customOrder(e,O4);return}let n=E4(e),r=kA(e,df(1,n+1),"inEdges"),s=kA(e,df(n-1,-1,-1),"outEdges"),i=efe(e);if(NA(e,i),t.disableOptimalOrderHeuristic)return;let a=Number.POSITIVE_INFINITY,o,c=t.constraints||[];for(let u=0,d=0;d<4;++u,++d){pfe(u%2?r:s,u%4>=2,c),i=$f(e);let f=tfe(e,i);f{r.has(i)||r.set(i,[]),r.get(i).push(a)};for(let i of e.nodes()){let a=e.node(i);if(typeof a.rank=="number"&&s(a.rank,i),typeof a.minRank=="number"&&typeof a.maxRank=="number")for(let o=a.minRank;o<=a.maxRank;o++)o!==a.rank&&s(o,i)}return t.map(function(i){return dfe(e,i,n,r.get(i)||[])})}function pfe(e,t,n){let r=new Cs;e.forEach(function(s){n.forEach(o=>r.setEdge(o.left,o.right));let i=s.graph().root,a=I4(s,i,r,t);a.vs.forEach((o,c)=>s.node(o).order=c),hfe(s,r,a.vs)})}function NA(e,t){Object.values(t).forEach(n=>n.forEach((r,s)=>e.node(r).order=s))}function mfe(e,t){let n={};function r(s,i){let a=0,o=0,c=s.length,u=i[i.length-1];return i.forEach((d,f)=>{let h=yfe(e,d),p=h?e.node(h).order:c;(h||d===u)&&(i.slice(o,f+1).forEach(m=>{let y=e.predecessors(m);y&&y.forEach(E=>{let g=e.node(E),x=g.order;(x{let f=i[d];if(f!==void 0&&e.node(f).dummy){let h=e.predecessors(f);h&&h.forEach(p=>{if(p===void 0)return;let m=e.node(p);m.dummy&&(m.orderu)&&R4(n,p,f)})}})}function s(i,a){let o=-1,c=-1,u=0;return a.forEach((d,f)=>{if(e.node(d).dummy==="border"){let h=e.predecessors(d);if(h&&h.length){let p=h[0];if(p===void 0)return;c=e.node(p).order,r(a,u,f,o,c),u=f,o=c}}r(a,u,a.length,c,i.length)}),a}return t.length&&t.reduce(s),n}function yfe(e,t){if(e.node(t).dummy){let n=e.predecessors(t);if(n)return n.find(r=>e.node(r).dummy)}}function R4(e,t,n){if(t>n){let s=t;t=n,n=s}let r=e[t];r||(e[t]=r={}),r[n]=!0}function bfe(e,t,n){if(t>n){let s=t;t=n,n=s}let r=e[t];return r!==void 0&&Object.hasOwn(r,n)}function Efe(e,t,n,r){let s={},i={},a={};return t.forEach(o=>{o.forEach((c,u)=>{s[c]=c,i[c]=c,a[c]=u})}),t.forEach(o=>{let c=-1;o.forEach(u=>{let d=r(u);if(d&&d.length){let f=d.sort((p,m)=>{let y=a[p],E=a[m];return(y!==void 0?y:0)-(E!==void 0?E:0)}),h=(f.length-1)/2;for(let p=Math.floor(h),m=Math.ceil(h);p<=m;++p){let y=f[p];if(y===void 0)continue;let E=a[y];if(E!==void 0&&i[u]===u&&c{var g;let x=(g=i[E.v])!=null?g:0,b=a.edge(E);return Math.max(y,x+(b!==void 0?b:0))},0):i[p]=0}function d(p){let m=a.outEdges(p),y=Number.POSITIVE_INFINITY;m&&(y=m.reduce((g,x)=>{let b=i[x.w],_=a.edge(x);return Math.min(g,(b!==void 0?b:0)-(_!==void 0?_:0))},Number.POSITIVE_INFINITY));let E=e.node(p);y!==Number.POSITIVE_INFINITY&&E.borderType!==o&&(i[p]=Math.max(i[p]!==void 0?i[p]:0,y))}function f(p){return a.predecessors(p)||[]}function h(p){return a.successors(p)||[]}return c(u,f),c(d,h),Object.keys(r).forEach(p=>{var m;let y=n[p];y!==void 0&&(i[p]=(m=i[y])!=null?m:0)}),i}function wfe(e,t,n,r){let s=new Cs,i=e.graph(),a=Sfe(i.nodesep,i.edgesep,r);return t.forEach(o=>{let c;o.forEach(u=>{let d=n[u];if(d!==void 0){if(s.setNode(d),c!==void 0){let f=n[c];if(f!==void 0){let h=s.edge(f,d);s.setEdge(f,d,Math.max(a(e,u,c),h||0))}}c=u}})}),s}function vfe(e,t){return Object.values(t).reduce((n,r)=>{let s=Number.NEGATIVE_INFINITY,i=Number.POSITIVE_INFINITY;Object.entries(r).forEach(([o,c])=>{let u=Tfe(e,o)/2;s=Math.max(c+u,s),i=Math.min(c-u,i)});let a=s-i;return a{["l","r"].forEach(a=>{let o=i+a,c=e[o];if(!c||c===t)return;let u=Object.values(c),d=r-mi(Math.min,u);a!=="l"&&(d=s-mi(Math.max,u)),d&&(e[o]=i0(c,f=>f+d))})})}function kfe(e,t=void 0){let n=e.ul;return n?i0(n,(r,s)=>{var i,a;if(t){let c=t.toLowerCase(),u=e[c];if(u&&u[s]!==void 0)return u[s]}let o=Object.values(e).map(c=>{let u=c[s];return u!==void 0?u:0}).sort((c,u)=>c-u);return(((i=o[1])!=null?i:0)+((a=o[2])!=null?a:0))/2}):{}}function Nfe(e){let t=$f(e),n=Object.assign(mfe(e,t),gfe(e,t)),r={},s;["u","d"].forEach(a=>{s=a==="u"?t:Object.values(t).reverse(),["l","r"].forEach(o=>{o==="r"&&(s=s.map(d=>Object.values(d).reverse()));let c=Efe(e,s,n,d=>(a==="u"?e.predecessors(d):e.successors(d))||[]),u=xfe(e,s,c.root,c.align,o==="r");o==="r"&&(u=i0(u,d=>-d)),r[a+o]=u})});let i=vfe(e,r);return _fe(r,i),kfe(r,e.graph().align)}function Sfe(e,t,n){return(r,s,i)=>{let a=r.node(s),o=r.node(i),c=0,u;if(c+=a.width/2,Object.hasOwn(a,"labelpos"))switch(a.labelpos.toLowerCase()){case"l":u=-a.width/2;break;case"r":u=a.width/2;break}if(u&&(c+=n?u:-u),u=void 0,c+=(a.dummy?t:e)/2,c+=(o.dummy?t:e)/2,c+=o.width/2,Object.hasOwn(o,"labelpos"))switch(o.labelpos.toLowerCase()){case"l":u=o.width/2;break;case"r":u=-o.width/2;break}return u&&(c+=n?u:-u),c}}function Tfe(e,t){return e.node(t).width}function Afe(e){e=y4(e),Cfe(e),Object.entries(Nfe(e)).forEach(([t,n])=>e.node(t).x=n)}function Cfe(e){let t=$f(e),n=e.graph(),r=n.ranksep,s=n.rankalign,i=0;t.forEach(a=>{let o=a.reduce((c,u)=>{var d;let f=(d=e.node(u).height)!=null?d:0;return c>f?c:f},0);a.forEach(c=>{let u=e.node(c);s==="top"?u.y=i+u.height/2:s==="bottom"?u.y=i+o-u.height/2:u.y=i+o/2}),i+=o+r})}function Ife(e,t={}){let n=t.debugTiming?x4:w4;return n("layout",()=>{let r=n(" buildLayoutGraph",()=>Ufe(e));return n(" runLayout",()=>Ofe(r,n,t)),n(" updateInputGraph",()=>Rfe(e,r)),r})}function Ofe(e,t,n){t(" makeSpaceForEdgeLabels",()=>$fe(e)),t(" removeSelfEdges",()=>Xfe(e)),t(" acyclic",()=>xde(e)),t(" nestingGraph.run",()=>Vde(e)),t(" rank",()=>Dde(y4(e))),t(" injectEdgeLabelProxies",()=>Hfe(e)),t(" removeEmptyRanks",()=>ade(e)),t(" nestingGraph.cleanup",()=>Wde(e)),t(" normalizeRanks",()=>ide(e)),t(" assignRankMinMax",()=>zfe(e)),t(" removeEdgeLabelProxies",()=>Vfe(e)),t(" normalize.run",()=>_de(e)),t(" parentDummyChains",()=>Ude(e)),t(" addBorderSegments",()=>Gde(e)),t(" order",()=>O4(e,n)),t(" insertSelfEdges",()=>Qfe(e)),t(" adjustCoordinateSystem",()=>Xde(e)),t(" position",()=>Afe(e)),t(" positionSelfEdges",()=>Zfe(e)),t(" removeBorderNodes",()=>qfe(e)),t(" normalize.undo",()=>Nde(e)),t(" fixupEdgeLabelCoords",()=>Wfe(e)),t(" undoCoordinateSystem",()=>Qde(e)),t(" translateGraph",()=>Kfe(e)),t(" assignNodeIntersects",()=>Yfe(e)),t(" reversePoints",()=>Gfe(e)),t(" acyclic.undo",()=>vde(e))}function Rfe(e,t){e.nodes().forEach(n=>{let r=e.node(n),s=t.node(n);r&&(r.x=s.x,r.y=s.y,r.order=s.order,r.rank=s.rank,t.children(n).length&&(r.width=s.width,r.height=s.height))}),e.edges().forEach(n=>{let r=e.edge(n),s=t.edge(n);r.points=s.points,Object.hasOwn(s,"x")&&(r.x=s.x,r.y=s.y)}),e.graph().width=t.graph().width,e.graph().height=t.graph().height}var Lfe=["nodesep","edgesep","ranksep","marginx","marginy"],Mfe={ranksep:50,edgesep:20,nodesep:50,rankdir:"TB",rankalign:"center"},jfe=["acyclicer","ranker","rankdir","align","rankalign"],Dfe=["width","height","rank"],SA={width:0,height:0},Pfe=["minlen","weight","width","height","labeloffset"],Bfe={minlen:1,weight:1,width:0,height:0,labeloffset:10,labelpos:"r"},Ffe=["labelpos"];function Ufe(e){let t=new Cs({multigraph:!0,compound:!0}),n=nb(e.graph());return t.setGraph(Object.assign({},Mfe,tb(n,Lfe),Gm(n,jfe))),e.nodes().forEach(r=>{let s=nb(e.node(r)),i=tb(s,Dfe);Object.keys(SA).forEach(o=>{i[o]===void 0&&(i[o]=SA[o])}),t.setNode(r,i);let a=e.parent(r);a!==void 0&&t.setParent(r,a)}),e.edges().forEach(r=>{let s=nb(e.edge(r));t.setEdge(r,Object.assign({},Bfe,tb(s,Pfe),Gm(s,Ffe)))}),t}function $fe(e){let t=e.graph();t.ranksep/=2,e.edges().forEach(n=>{let r=e.edge(n);r.minlen*=2,r.labelpos.toLowerCase()!=="c"&&(t.rankdir==="TB"||t.rankdir==="BT"?r.width+=r.labeloffset:r.height+=r.labeloffset)})}function Hfe(e){e.edges().forEach(t=>{let n=e.edge(t);if(n.width&&n.height){let r=e.node(t.v),s={rank:(e.node(t.w).rank-r.rank)/2+r.rank,e:t};Jc(e,"edge-proxy",s,"_ep")}})}function zfe(e){let t=0;e.nodes().forEach(n=>{let r=e.node(n);r.borderTop&&(r.minRank=e.node(r.borderTop).rank,r.maxRank=e.node(r.borderBottom).rank,t=Math.max(t,r.maxRank))}),e.graph().maxRank=t}function Vfe(e){e.nodes().forEach(t=>{let n=e.node(t);if(n.dummy==="edge-proxy"){let r=n;e.edge(r.e).labelRank=n.rank,e.removeNode(t)}})}function Kfe(e){let t=Number.POSITIVE_INFINITY,n=0,r=Number.POSITIVE_INFINITY,s=0,i=e.graph(),a=i.marginx||0,o=i.marginy||0;function c(u){let d=u.x,f=u.y,h=u.width,p=u.height;t=Math.min(t,d-h/2),n=Math.max(n,d+h/2),r=Math.min(r,f-p/2),s=Math.max(s,f+p/2)}e.nodes().forEach(u=>c(e.node(u))),e.edges().forEach(u=>{let d=e.edge(u);Object.hasOwn(d,"x")&&c(d)}),t-=a,r-=o,e.nodes().forEach(u=>{let d=e.node(u);d.x-=t,d.y-=r}),e.edges().forEach(u=>{let d=e.edge(u);d.points.forEach(f=>{f.x-=t,f.y-=r}),Object.hasOwn(d,"x")&&(d.x-=t),Object.hasOwn(d,"y")&&(d.y-=r)}),i.width=n-t+a,i.height=s-r+o}function Yfe(e){e.edges().forEach(t=>{let n=e.edge(t),r=e.node(t.v),s=e.node(t.w),i,a;n.points?(i=n.points[0],a=n.points[n.points.length-1]):(n.points=[],i=s,a=r),n.points.unshift(gA(r,i)),n.points.push(gA(s,a))})}function Wfe(e){e.edges().forEach(t=>{let n=e.edge(t);if(Object.hasOwn(n,"x"))switch((n.labelpos==="l"||n.labelpos==="r")&&(n.width-=n.labeloffset),n.labelpos){case"l":n.x-=n.width/2+n.labeloffset;break;case"r":n.x+=n.width/2+n.labeloffset;break}})}function Gfe(e){e.edges().forEach(t=>{let n=e.edge(t);n.reversed&&n.points.reverse()})}function qfe(e){e.nodes().forEach(t=>{if(e.children(t).length){let n=e.node(t),r=e.node(n.borderTop),s=e.node(n.borderBottom),i=e.node(n.borderLeft[n.borderLeft.length-1]),a=e.node(n.borderRight[n.borderRight.length-1]);n.width=Math.abs(a.x-i.x),n.height=Math.abs(s.y-r.y),n.x=i.x+n.width/2,n.y=r.y+n.height/2}}),e.nodes().forEach(t=>{e.node(t).dummy==="border"&&e.removeNode(t)})}function Xfe(e){e.edges().forEach(t=>{if(t.v===t.w){let n=e.node(t.v);n.selfEdges||(n.selfEdges=[]),n.selfEdges.push({e:t,label:e.edge(t)}),e.removeEdge(t)}})}function Qfe(e){$f(e).forEach(t=>{let n=0;t.forEach((r,s)=>{let i=e.node(r);i.order=s+n,(i.selfEdges||[]).forEach(a=>{Jc(e,"selfedge",{width:a.label.width,height:a.label.height,rank:i.rank,order:s+ ++n,e:a.e,label:a.label},"_se")}),delete i.selfEdges})})}function Zfe(e){e.nodes().forEach(t=>{let n=e.node(t);if(n.dummy==="selfedge"){let r=n,s=e.node(r.e.v),i=s.x+s.width/2,a=s.y,o=n.x-i,c=s.height/2;e.setEdge(r.e,r.label),e.removeNode(t),r.label.points=[{x:i+2*o/3,y:a-c},{x:i+5*o/6,y:a-c},{x:i+o,y:a},{x:i+5*o/6,y:a+c},{x:i+2*o/3,y:a+c}],r.label.x=n.x,r.label.y=n.y}})}function tb(e,t){return i0(Gm(e,t),Number)}function nb(e){let t={};return e&&Object.entries(e).forEach(([n,r])=>{typeof n=="string"&&(n=n.toLowerCase()),t[n]=r}),t}function Jfe(e){let t=$f(e),n=new Cs({compound:!0,multigraph:!0}).setGraph({});return e.nodes().forEach(r=>{n.setNode(r,{label:r}),n.setParent(r,"layer"+e.node(r).rank)}),e.edges().forEach(r=>n.setEdge(r.v,r.w,{},r.name)),t.forEach((r,s)=>{let i="layer"+s;n.setNode(i,{rank:"same"}),r.reduce((a,o)=>(n.setEdge(a,o,{style:"invis"}),o))}),n}var ehe={graphlib:l4,version:dde,layout:Ife,debug:Jfe,util:{time:x4,notime:w4}},TA=ehe;/*! For license information please see dagre.esm.js.LEGAL.txt */const zl={llm:{label:"智能体",description:"理解任务并直接完成一个具体工作",icon:Do},sequential:{label:"分步协作",description:"内部步骤按照顺序依次执行",icon:CL},parallel:{label:"同时处理",description:"内部步骤同时工作,完成后统一汇总",icon:bL},loop:{label:"循环执行",description:"重复执行内部步骤,直到满足停止条件",icon:Rw},a2a:{label:"远程智能体",description:"调用已经存在的远程 Agent",icon:Cg}},jE=220,DE=88,AA=96,CA=34,qm=64,IA=310,Vl=24,L4=56,PE=40,OA=40,the=18,nhe=58,rhe=!1,she=e=>e==="sequential"||e==="parallel"||e==="loop";function BE(e,t){const n=e.agentType??"llm";return she(n)||n==="llm"&&(t.length===0||e.subAgents.length>0)}function FE(e,t=[],n="horizontal"){const r=e.agentType??"llm";if(!BE(e,t))return{width:jE,height:DE};const s=e.subAgents.map((d,f)=>FE(d,[...t,f],n)),i=s.length?Math.max(...s.map(d=>d.width)):0,a=s.length?Math.max(...s.map(d=>d.height)):0,o=s.length&&r!=="parallel"?L4:Vl,c=n==="horizontal"?r!=="parallel":r==="parallel",u=s.length?r==="parallel"?the+OA:r==="loop"?nhe:0:OA;return c?{width:Math.max(IA,s.reduce((d,f)=>d+f.width,0)+PE*Math.max(0,s.length-1)+o*2),height:qm+Vl+a+u+Vl}:{width:Math.max(IA,i+Vl*2),height:qm+o+s.reduce((d,f)=>d+f.height,0)+PE*Math.max(0,s.length-1)+u+o}}function Su(e){return e.length===0?"agent-root":`agent-${e.join("-")}`}function ihe(e,t){return e.length===t.length&&e.every((n,r)=>n===t[r])}function RA(e){const t=n=>[n.agentType??"llm",n.subAgents.map(t)];return JSON.stringify(t(e))}function Tu(e,t,n,r){const s=(r==null?void 0:r.tone)==="sequential"?"hsl(213 40% 40%)":(r==null?void 0:r.tone)==="loop"?"hsl(151 34% 34%)":"hsl(220 9% 38%)";return{id:`${e}-${t}${r!=null&&r.loop?"-loop":""}`,source:e,target:t,sourceHandle:r!=null&&r.loop?"loop-source":void 0,targetHandle:r!=null&&r.loop?"loop-target":void 0,label:n,type:"insertStep",data:r?{insert:r.insert,loop:r.loop,tone:r.tone}:void 0,animated:r==null?void 0:r.loop,markerEnd:{type:Oc.ArrowClosed,width:16,height:16,color:s},style:{stroke:s,strokeWidth:1.5},labelStyle:{fill:"hsl(215 14% 42%)",fontSize:10,fontWeight:600},labelBgStyle:{fill:"hsl(var(--background))",fillOpacity:.92}}}function LA(e,t){const n=[{id:"terminal-input",type:"terminal",position:{x:0,y:0},data:{kind:"terminal",title:"用户请求"},selectable:!1,draggable:!1},{id:"terminal-output",type:"terminal",position:{x:0,y:0},data:{kind:"terminal",title:"最终回复"},selectable:!1,draggable:!1}],r=[];function s(u,d,f,h,p){const m=u.agentType??"llm",y=Su(d);return BE(u,d)?(i(u,d,f,h,p),y):(n.push({id:y,type:"agent",parentId:f,extent:"parent",position:h,data:{kind:"agent",path:d,agent:u,title:m==="a2a"?"远程智能体":u.name.trim()||(d.length===0?"主 Agent":"未命名步骤"),pattern:m,description:u.description.trim()||zl[m].description,childCount:u.subAgents.length,containedIn:p}}),y)}function i(u,d,f,h={x:0,y:0},p){const m=u.agentType??"sequential",y=Su(d),E=FE(u,d,t);n.push({id:y,type:"group",parentId:f,extent:f?"parent":void 0,position:h,style:{width:E.width,height:E.height},data:{kind:"agent",path:d,agent:u,title:u.name.trim()||(d.length===0?"主 Agent":zl[m].label),pattern:m,description:zl[m].description,childCount:u.subAgents.length,containedIn:p,layoutWidth:E.width,layoutHeight:E.height}});const g=u.subAgents.map((N,C)=>FE(N,[...d,C],t)),x=g.length&&m!=="parallel"?L4:Vl,b=t==="horizontal"?m!=="parallel":m==="parallel";let _=x;const k=u.subAgents.map((N,C)=>{const S=g[C],A=b?{x:_,y:qm+Vl}:{x:(E.width-S.width)/2,y:qm+_};return _+=(b?S.width:S.height)+PE,s(N,[...d,C],y,A,m)});if(m==="sequential"||m==="loop"){for(let N=0;N1&&r.push(Tu(k[k.length-1],k[0],"继续循环",{loop:!0,tone:"loop"}))}return y}const a=(u,d)=>{const f=u.agentType??"llm",h=Su(d);if(BE(u,d))return i(u,d),[h];if(n.push({id:h,type:"agent",position:{x:0,y:0},data:{kind:"agent",path:d,agent:u,title:f==="a2a"?"远程智能体":u.name.trim()||(d.length===0?"主 Agent":"未命名步骤"),pattern:f,description:u.description.trim()||zl[f].description,childCount:u.subAgents.length}}),u.subAgents.length===0)return[h];const p=[];return u.subAgents.forEach((m,y)=>{const E=[...d,y],g=Su(E);r.push(Tu(h,g,"调用",{insert:{parentPath:d,index:y}})),p.push(...a(m,E))}),p},o=Su([]),c=a(e,[]);return r.push(Tu("terminal-input",o)),c.forEach(u=>r.push(Tu(u,"terminal-output"))),ahe(n,r,t)}function ahe(e,t,n){const r=new TA.graphlib.Graph().setDefaultEdgeLabel(()=>({}));r.setGraph({rankdir:n==="vertical"?"TB":"LR",ranksep:50,nodesep:34,edgesep:14,marginx:24,marginy:24});const s=new Set(e.filter(i=>!i.parentId).map(i=>i.id));return e.filter(i=>!i.parentId).forEach(i=>{const a=i.data.kind==="terminal";r.setNode(i.id,{width:a?AA:i.data.layoutWidth??jE,height:a?CA:i.data.layoutHeight??DE})}),t.filter(i=>s.has(i.source)&&s.has(i.target)).forEach(i=>r.setEdge(i.source,i.target)),TA.layout(r),{nodes:e.map(i=>{if(i.parentId)return i;const a=r.node(i.id),o=i.data.kind==="terminal",c=o?AA:i.data.layoutWidth??jE,u=o?CA:i.data.layoutHeight??DE;return{...i,position:{x:a.x-c/2,y:a.y-u/2}}}),edges:t}}const o0=w.createContext(null),l0=w.createContext("horizontal");function ohe({id:e,sourceX:t,sourceY:n,targetX:r,targetY:s,sourcePosition:i,targetPosition:a,markerEnd:o,style:c,label:u,data:d}){const f=w.useContext(o0),[h,p]=w.useState(!1),[m,y,E]=Vm({sourceX:t,sourceY:n,targetX:r,targetY:s,sourcePosition:i,targetPosition:a,offset:d!=null&&d.loop?28:20});return l.jsxs(l.Fragment,{children:[l.jsx(Uf,{id:e,path:m,markerEnd:o,style:c}),f&&(d==null?void 0:d.insert)&&l.jsx("path",{d:m,className:"abc-edge-hover-path",onPointerEnter:()=>p(!0),onPointerLeave:()=>p(!1)}),(u||f&&(d==null?void 0:d.insert))&&l.jsx(nue,{children:l.jsxs("div",{className:`abc-edge-tools${f&&(d!=null&&d.insert)?" can-insert":""}${h?" is-visible":""}`,style:{transform:`translate(-50%, -50%) translate(${y}px, ${E}px)`},onPointerEnter:()=>p(!0),onPointerLeave:()=>p(!1),children:[u&&l.jsx("span",{className:"abc-edge-label",children:u}),f&&(d==null?void 0:d.insert)&&l.jsx("button",{type:"button",className:"abc-edge-add nodrag nopan","aria-label":"在这里插入步骤",title:"在这里插入步骤",onClick:g=>{g.stopPropagation(),f==null||f.onInsert(d.insert.parentPath,d.insert.index)},children:l.jsx(rr,{})})]})})]})}function lhe({data:e,selected:t}){const n=w.useContext(o0),r=w.useContext(l0),s=r==="vertical"?Pe.Top:Pe.Left,i=r==="vertical"?Pe.Bottom:Pe.Right,a=r==="vertical"?Pe.Right:Pe.Bottom,o=e.pattern??"llm",c=zl[o],u=c.icon;return l.jsxs("div",{className:`abc-node is-${o}${e.containedIn?` is-contained-in-${e.containedIn}`:""}${t?" is-selected":""}`,children:[l.jsx(mr,{type:"target",position:s,className:"abc-handle"}),o!=="llm"&&l.jsx("span",{className:"abc-node-icon",children:l.jsx(u,{})}),l.jsxs("span",{className:"abc-node-copy",children:[l.jsxs("span",{className:"abc-node-meta",children:[l.jsx("span",{children:c.label}),!!e.childCount&&l.jsxs("small",{children:[e.childCount," 个步骤"]})]}),l.jsx("strong",{children:e.title}),l.jsx("small",{children:e.description})]}),n&&e.path!==void 0&&e.path.length>0&&l.jsx("button",{type:"button",className:"abc-node-delete nodrag nopan","aria-label":`删除 ${e.title}`,title:"删除节点",onClick:d=>{d.stopPropagation(),n==null||n.onDelete(e.path)},children:l.jsx(ea,{})}),l.jsx(mr,{type:"source",position:i,className:"abc-handle"}),e.containedIn==="loop"&&l.jsxs(l.Fragment,{children:[l.jsx(mr,{id:"loop-target",type:"target",position:a,className:"abc-handle abc-loop-handle"}),l.jsx(mr,{id:"loop-source",type:"source",position:a,className:"abc-handle abc-loop-handle"})]})]})}function che({data:e,selected:t}){const n=w.useContext(o0),r=w.useContext(l0),s=r==="vertical"?Pe.Top:Pe.Left,i=r==="vertical"?Pe.Bottom:Pe.Right,a=r==="vertical"?Pe.Right:Pe.Bottom,o=e.pattern??"sequential",c=zl[o],u=o==="llm"?"子 Agent":"步骤",d=e.childCount??0,f=o==="llm"?"添加子 Agent":o==="parallel"?"添加一个同时处理的步骤":o==="loop"?"添加循环步骤":"添加下一个步骤";return l.jsxs("div",{className:`abc-group is-${o}${t?" is-selected":""}`,children:[l.jsx(mr,{type:"target",position:s,className:"abc-handle"}),l.jsxs("header",{className:"abc-group-head",children:[l.jsxs("span",{children:[l.jsx("strong",{title:e.title,children:e.title}),l.jsx("small",{children:o==="llm"?"智能体 · 可根据任务调用框内子 Agent":o==="parallel"?`${c.label} · 框内步骤同时开始,全部完成后再继续`:`${c.label} · ${c.description}`})]}),l.jsxs("em",{children:[d," 个",u]})]}),n&&e.path!==void 0&&d>0&&o!=="parallel"&&l.jsxs("div",{className:"abc-group-boundary-actions",children:[l.jsx("button",{type:"button",className:"abc-group-boundary-add is-start nodrag nopan","aria-label":"添加到最前",title:"添加到最前",onClick:h=>{h.stopPropagation(),n.onInsert(e.path,0)},children:l.jsx(rr,{})}),l.jsx("button",{type:"button",className:"abc-group-boundary-add is-end nodrag nopan","aria-label":"添加到最后",title:"添加到最后",onClick:h=>{h.stopPropagation(),n.onAdd(e.path)},children:l.jsx(rr,{})})]}),n&&e.path!==void 0&&d>0&&o==="parallel"&&l.jsxs("button",{type:"button",className:"abc-group-add abc-group-add-bottom nodrag nopan",onClick:h=>{h.stopPropagation(),n.onAdd(e.path)},children:[l.jsx(rr,{}),l.jsx("span",{children:f})]}),n&&e.path!==void 0&&d===0&&l.jsxs("button",{type:"button",className:"abc-group-add abc-group-add-empty nodrag nopan",onClick:h=>{h.stopPropagation(),n.onAdd(e.path)},children:[l.jsx(rr,{}),l.jsx("span",{children:f})]}),n&&e.path!==void 0&&e.path.length>0&&l.jsx("button",{type:"button",className:"abc-node-delete nodrag nopan","aria-label":`删除 ${e.title}`,title:"删除节点",onClick:h=>{h.stopPropagation(),n==null||n.onDelete(e.path)},children:l.jsx(ea,{})}),l.jsx(mr,{type:"source",position:i,className:"abc-handle"}),e.containedIn==="loop"&&l.jsxs(l.Fragment,{children:[l.jsx(mr,{id:"loop-target",type:"target",position:a,className:"abc-handle abc-loop-handle"}),l.jsx(mr,{id:"loop-source",type:"source",position:a,className:"abc-handle abc-loop-handle"})]})]})}function uhe({data:e}){const t=w.useContext(l0);return l.jsxs("div",{className:"abc-terminal",children:[l.jsx(mr,{type:"target",position:t==="vertical"?Pe.Top:Pe.Left,className:"abc-handle"}),l.jsx("span",{children:e.title}),l.jsx(mr,{type:"source",position:t==="vertical"?Pe.Bottom:Pe.Right,className:"abc-handle"})]})}const dhe={agent:lhe,group:che,terminal:uhe},fhe={insertStep:ohe};function hhe({draft:e,selectedPath:t,onSelect:n,onAdd:r,onInsert:s,onDelete:i,readOnly:a=!1,interactivePreview:o=!1,direction:c="horizontal"}){const u=w.useMemo(()=>LA(e,c),[]),[d,f,h]=e4(u.nodes),[p,m,y]=t4(u.edges),E=sue(),g=w.useRef(`${c}:${RA(e)}`),x=w.useRef(null),{fitView:b}=r0(),_=w.useMemo(()=>LA(e,c),[c,e]),[k,N]=w.useState(()=>window.matchMedia("(max-width: 860px)").matches),C=w.useMemo(()=>a?{padding:.16,minZoom:.05,maxZoom:.9}:k?{padding:.08,minZoom:.35,maxZoom:.9}:{padding:.14,minZoom:.42,maxZoom:1.1},[k,a]),S=w.useCallback(()=>{window.requestAnimationFrame(()=>{window.requestAnimationFrame(()=>void b(C))})},[C,b]);w.useEffect(()=>{const O=window.matchMedia("(max-width: 860px)"),D=U=>N(U.matches);return O.addEventListener("change",D),()=>O.removeEventListener("change",D)},[]),w.useEffect(()=>{const O=`${c}:${RA(e)}`,D=O!==g.current;g.current=O,m(_.edges),f(U=>{const X=new Map(U.map(M=>[M.id,M.position]));return _.nodes.map(M=>({...M,position:!D&&X.get(M.id)?X.get(M.id):M.position,selected:M.data.kind==="agent"&&!!M.data.path&&ihe(M.data.path,t)}))}),D&&S()},[_,e,S,t,m,f]),w.useEffect(()=>{S()},[k,S]),w.useEffect(()=>{E&&S()},[_,S,E]),w.useEffect(()=>{if(!a||!x.current)return;const O=new ResizeObserver(()=>S());return O.observe(x.current),S(),()=>O.disconnect()},[S,a]);const A=w.useMemo(()=>a?null:{onAdd:r,onInsert:s,onDelete:i},[r,i,s,a]);return l.jsx(l0.Provider,{value:c,children:l.jsx(o0.Provider,{value:A,children:l.jsx("section",{className:`abc-root is-${c}${a?" is-readonly":""}`,"aria-label":a?"只读 Agent 执行画布":"Agent 执行画布",children:l.jsx("div",{ref:x,className:"abc-canvas",children:l.jsxs(JP,{nodes:d,edges:p,nodeTypes:dhe,edgeTypes:fhe,onNodesChange:h,onEdgesChange:y,onNodeClick:(O,D)=>{!a&&D.data.kind==="agent"&&D.data.path&&n(D.data.path)},nodesDraggable:!a,nodesConnectable:!1,nodesFocusable:!a,elementsSelectable:!a,edgesFocusable:!1,edgesReconnectable:!1,panOnDrag:!a||o,zoomOnDoubleClick:o,zoomOnPinch:!a||o,zoomOnScroll:!a||o,fitView:!0,fitViewOptions:C,minZoom:a?.05:.35,maxZoom:1.6,proOptions:{hideAttribution:!0},children:[l.jsx(r4,{gap:20,size:1.2,color:"hsl(34 20% 82%)"}),(!a||o)&&l.jsx(i4,{showInteractive:!1}),rhe]})})})})})}function Xm(e){return l.jsx(Dv,{children:l.jsx(hhe,{...e})})}const phe="doubao-seed-2-1-pro-260628",mhe="一个基于 VeADK 构建的智能助手,理解用户意图并调用合适的工具完成任务。",ghe=`你是一个专业、可靠的智能助手。 - -你的目标是准确理解用户的需求,并给出条理清晰、简洁有用的回答。 - -约束: -- 信息不足时主动提问澄清,不要臆造事实。 -- 需要时合理调用可用的工具,并说明关键结论。 -- 保持礼貌、专业的语气。`;function Sr(){return{name:"",description:mhe,instruction:ghe,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:phe,modelProvider:"",modelApiBase:"",shortTermBackend:"local",longTermBackend:"local",autoSaveSession:!1,knowledgebaseBackend:Gd,knowledgebaseIndex:"",tracingExporters:[],selectedSkills:[],deployment:{feishuEnabled:!1}}}const yhe=[{id:"case-1",kind:"good",input:"总结本周客户反馈,并按优先级归类。",expectation:"覆盖主要问题,给出清晰的优先级与下一步动作。",tag:"总结"},{id:"case-2",kind:"good",input:"查询最新公开资料并附上来源。",expectation:"调用搜索工具,结论与引用一一对应。",tag:"工具调用"},{id:"case-3",kind:"bad",input:"在信息不足时直接给出确定结论。",expectation:"应明确说明未知,并主动询问缺失信息。",tag:"幻觉"},{id:"case-4",kind:"bad",input:"连续重复调用相同工具获取同一结果。",expectation:"复用已有结果,避免无意义的重复调用。",tag:"效率"}],bhe=[{id:"eval-regression",name:"核心能力回归",agentIds:[],caseSet:"核心回归集",evaluator:"综合质量评估器",metrics:["回答质量","工具调用"],concurrency:"4",history:[{id:"run-1",createdAt:"今天 10:32",score:88,status:"completed"},{id:"run-2",createdAt:"昨天 16:08",score:84,status:"completed"}]},{id:"eval-safety",name:"安全与幻觉检查",agentIds:[],caseSet:"安全边界集",evaluator:"事实一致性评估器",metrics:["事实准确性","拒答合理性"],concurrency:"2",history:[{id:"run-3",createdAt:"7 月 25 日 14:20",score:91,status:"completed"}]}],Ehe=[{id:"basic",label:"基本信息"},{id:"evaluations",label:"评测集"}];function M4(e){const t=e.tools??[],n=vc.filter(s=>s.toolNames.some(i=>t.includes(i))),r=new Set(n.flatMap(s=>s.toolNames));return{...Sr(),name:e.name,description:e.description,instruction:e.instruction||Sr().instruction,agentType:e.type,modelName:e.model,tools:t.filter(s=>!r.has(s)),builtinTools:n.map(s=>s.id),skills:(e.skills??[]).map(s=>s.name),subAgents:(e.children??[]).map(M4)}}function xhe(e,t){var n;return e!=null&&e.draft?e.draft:e!=null&&e.graph?M4(e.graph):{...Sr(),name:(e==null?void 0:e.name)||t,description:(e==null?void 0:e.description)||"暂无描述",agentType:(e==null?void 0:e.type)??"llm",modelName:e==null?void 0:e.model,tools:(e==null?void 0:e.tools)??[],skills:((n=e==null?void 0:e.skills)==null?void 0:n.map(r=>r.name))??[]}}function j4(e){return e?1+e.children.reduce((t,n)=>t+j4(n),0):1}function D4(e){return 1+e.subAgents.reduce((t,n)=>t+D4(n),0)}const UE=[{phase:"prepare",label:"准备部署",description:"校验配置并创建部署任务"},{phase:"build",label:"构建镜像",description:"生成运行环境与智能体代码"},{phase:"deploy",label:"部署服务",description:"创建并启动 AgentKit Runtime"},{phase:"publish",label:"发布服务",description:"等待服务就绪并生成访问地址"},{phase:"complete",label:"部署完成",description:"智能体已可以正常使用"}];function whe(e){if(e.status==="success")return UE.length-1;const t=e.phase??{准备部署:"prepare",构建镜像:"build",部署:"deploy",发布:"publish",部署完成:"complete"}[e.label],n=UE.findIndex(r=>r.phase===t);return n<0?0:n}function MA({task:e}){const t=whe(e),n=e.status==="success"?100:Math.max(6,Math.min(100,e.pct??6)),r=e.status==="running"?"正在部署":e.status==="success"?"部署完成":e.status==="error"?"部署失败":"部署已取消";return l.jsxs("section",{className:`aw-deploy-progress-card is-${e.status}`,"aria-live":"polite",children:[l.jsxs("div",{className:"aw-deploy-progress-head",children:[l.jsxs("div",{children:[l.jsx("span",{className:"aw-deploy-progress-icon","aria-hidden":!0,children:e.status==="running"?l.jsx(Rt,{className:"spin"}):e.status==="success"?l.jsx(vL,{}):e.status==="error"?l.jsx(Ag,{}):l.jsx($1,{})}),l.jsxs("div",{children:[l.jsx("h3",{children:r}),l.jsx("p",{children:e.runtimeName})]})]}),l.jsx("strong",{children:e.status==="running"?`${Math.round(n)}%`:e.label})]}),l.jsx("div",{className:"aw-deploy-progress-track",role:"progressbar","aria-label":"部署进度","aria-valuemin":0,"aria-valuemax":100,"aria-valuenow":Math.round(n),children:l.jsx("span",{style:{width:`${n}%`}})}),l.jsx("ol",{className:"aw-deploy-steps",children:UE.map((s,i)=>{const a=e.status==="success"||i{e.length!==0&&Te(J=>J.map((he,Le)=>Le===0&&he.agentIds.length===0?{...he,agentIds:e.slice(0,2).map(Be=>Be.id)}:he))},[e]);const it=w.useMemo(()=>{const J=new Map;for(const he of e)he.runtimeId&&J.set(he.runtimeId,he);return J},[e]),He=w.useMemo(()=>{var he;const J=new Map;for(const Le of t){const Be=(he=Le.deploymentTarget)==null?void 0:he.runtimeId;if(!Be||!it.has(Be))continue;const ot=J.get(Be);(!ot||Le.updatedAt>ot.updatedAt)&&J.set(Be,Le)}return J},[it,t]),Ue=w.useMemo(()=>{const J=new Map;for(const he of d){if(!he.runtimeId)continue;const Le=J.get(he.runtimeId);(!Le||he.startedAt>Le.startedAt)&&J.set(he.runtimeId,he)}return J},[d]),Et=w.useMemo(()=>{const J=L.trim().toLowerCase();return J?e.filter(he=>{const Le=he.runtimeId?He.get(he.runtimeId):void 0,Be=he.runtimeId?Ue.get(he.runtimeId):void 0;return[he.label,he.app,he.host??"",(Le==null?void 0:Le.draft.name)??"",(Le==null?void 0:Le.draft.description)??"",(Be==null?void 0:Be.runtimeName)??""].join(" ").toLowerCase().includes(J)}):e},[e,Ue,L,He]),rt=w.useMemo(()=>{const J=L.trim().toLowerCase();return t.filter(he=>{var Be;const Le=(Be=he.deploymentTarget)==null?void 0:Be.runtimeId;return Le&&it.has(Le)?!1:J?`${he.draft.name} ${he.draft.description}`.toLowerCase().includes(J):!0})},[it,t,L]),St=w.useMemo(()=>t.filter(J=>{var Le;const he=(Le=J.deploymentTarget)==null?void 0:Le.runtimeId;return!he||!it.has(he)}).length,[it,t]),ct=w.useMemo(()=>{const J=L.trim().toLowerCase();return J?Ee.filter(he=>he.name.toLowerCase().includes(J)):Ee},[Ee,L]),B=e.find(J=>J.id===A),Q=t.find(J=>J.id===D),oe=d.find(J=>J.id===X),be=B!=null&&B.runtimeId?He.get(B.runtimeId):void 0,Oe=A&&s===A?r:null,Ye=w.useMemo(()=>{const J=new Map(e.map((Le,Be)=>[Le.id,Be])),he=new Map(n.map((Le,Be)=>[Le,Be]));return[...Et].sort((Le,Be)=>{const ot=Le.runtimeId?Ue.get(Le.runtimeId):void 0,It=Be.runtimeId?Ue.get(Be.runtimeId):void 0,st=(ot==null?void 0:ot.status)==="running"?ot.startedAt:0,Z=(It==null?void 0:It.status)==="running"?It.startedAt:0;if(st!==Z)return Z-st;const we=he.get(Le.id),_e=he.get(Be.id);return we!=null&&_e!=null?we-_e:we!=null?-1:_e!=null?1:(J.get(Le.id)??0)-(J.get(Be.id)??0)})},[n,e,Et,Ue]),tt=(B==null?void 0:B.label)||(Oe==null?void 0:Oe.name)||(Q==null?void 0:Q.draft.name)||(oe==null?void 0:oe.runtimeName)||"未选择智能体",ze=Ee.find(J=>J.id===Ke),Tt=w.useMemo(()=>(oe==null?void 0:oe.agentDraft)??(Q==null?void 0:Q.draft)??(be==null?void 0:be.draft)??xhe(Oe,(B==null?void 0:B.label)??"agent"),[Oe,B==null?void 0:B.label,be==null?void 0:be.draft,Q==null?void 0:Q.draft,oe==null?void 0:oe.agentDraft]),Re=w.useMemo(()=>{if(oe)return oe;if(Q)return d.filter(J=>{var he,Le;return((he=J.agentDraft)==null?void 0:he.name)===Q.draft.name||J.runtimeName===Q.draft.name||!!((Le=Q.deploymentTarget)!=null&&Le.runtimeId)&&J.runtimeId===Q.deploymentTarget.runtimeId}).sort((J,he)=>he.startedAt-J.startedAt)[0];if(B)return d.filter(J=>!!B.runtimeId&&J.runtimeId===B.runtimeId||J.runtimeName===B.label).sort((J,he)=>he.startedAt-J.startedAt)[0]},[d,B,Q,oe]);w.useEffect(()=>{if(!f)return;const J=d.find(Le=>Le.id===f),he=J!=null&&J.runtimeId?it.get(J.runtimeId):void 0;if(he){M(""),U(""),O(he.id),S("basic");return}O(""),U(""),M(f),S("basic")},[it,d,f]),w.useEffect(()=>{!h||!e.some(J=>J.id===h)||(M(""),U(""),O(h),S("basic"))},[e,h]),w.useEffect(()=>{let J=!1;if(T(null),!!(B!=null&&B.runtimeId))return Uw(B.runtimeId,B.region??"cn-beijing").then(he=>{J||T(he)}).catch(()=>{J||T(null)}),()=>{J=!0}},[B==null?void 0:B.region,B==null?void 0:B.runtimeId]);const kt=de.filter(J=>{if(J.kind!==F)return!1;const he=V.trim().toLowerCase();return he?`${J.input} ${J.expectation} ${J.tag}`.toLowerCase().includes(he):!0}),Pt=J=>{Te(he=>he.map(Le=>Le.id===J.id?J:Le))},Bt=()=>{const J=new Set(e.map(Be=>Be.id)),he=n.filter(Be=>J.has(Be)),Le=new Set(he);return[...he,...e.filter(Be=>!Le.has(Be.id)).map(Be=>Be.id)]},bn=(J,he,Le)=>{if(!m||J===he)return;const Be=Bt().filter(st=>st!==J),ot=Be.indexOf(he),It=ot<0?Be.length:Le==="after"?ot+1:ot;Be.splice(It,0,J),m(Be)},Xe=(J,he)=>{if(!P||P===he)return;const Le=J.currentTarget.getBoundingClientRect();re(he),ee(J.clientY>Le.top+Le.height/2?"after":"before")},ft=(J,he)=>{if(!m)return;const Le=Bt(),Be=Le.indexOf(J),ot=Math.max(0,Math.min(Le.length-1,Be+he));Be<0||Be===ot||(Le.splice(Be,1),Le.splice(ot,0,J),m(Le))},xt=async J=>{if(!(!y||J.canDelete!==!0||le)&&window.confirm(`确定删除 Agent "${J.label}"?该 Runtime 将被永久删除。`)){ne(!0),ye("");try{await y([J]),A===J.id&&O("")}catch(he){ye(he instanceof Error?he.message:String(he))}finally{ne(!1)}}},vt=J=>{if(!E||le)return;const he=J.draft.name||"未命名 Agent";window.confirm(`确定删除草稿 "${he}"?`)&&(ye(""),E([J]),D===J.id&&U(""))},fe=()=>{const J=`eval-${Date.now()}`,he={id:J,name:`新评测组 ${Ee.length+1}`,agentIds:[],caseSet:"核心回归集",evaluator:"综合质量评估器",metrics:["回答质量"],concurrency:"4",history:[]};Te(Le=>[he,...Le]),Ne(J)},$e=J=>{Pt({...J,history:[{id:`run-${Date.now()}`,createdAt:"刚刚",score:86+J.history.length%7,status:"completed"},...J.history]})};return l.jsxs("div",{className:"aw-root",children:[l.jsxs("nav",{className:"aw-view-tabs","aria-label":"智能体工作台",children:[l.jsx("button",{type:"button",className:k==="library"?"is-active":"","aria-pressed":k==="library",onClick:()=>{N("library"),R("")},children:"智能体库"}),l.jsx("button",{type:"button",className:k==="evaluation"?"is-active":"","aria-pressed":k==="evaluation",onClick:()=>{N("evaluation"),R("")},children:"评测"})]}),l.jsxs("div",{className:"aw-workspace-frame",children:[l.jsxs("div",{className:"aw-workspace","aria-hidden":k==="evaluation"||void 0,ref:J=>J==null?void 0:J.toggleAttribute("inert",k==="evaluation"),children:[l.jsxs("aside",{className:"aw-sidebar","aria-label":k==="library"?"智能体列表":"评测组列表",children:[l.jsxs("label",{className:"aw-search",children:[l.jsx(Vd,{"aria-hidden":!0}),l.jsx("input",{value:L,onChange:J=>R(J.currentTarget.value),placeholder:k==="library"?"搜索智能体":"搜索评测组","aria-label":k==="library"?"搜索智能体":"搜索评测组"})]}),l.jsxs("button",{type:"button",className:"aw-create-card",onClick:k==="library"?x:fe,disabled:k==="library"&&!a,children:[l.jsx(rr,{"aria-hidden":!0}),l.jsx("span",{children:k==="library"?"新建 Agent":"新建评测组"})]}),k==="library"&&me&&l.jsx("div",{className:"aw-delete-error",role:"alert",children:me}),l.jsx("div",{className:"aw-agent-list",children:k==="evaluation"?ct.length===0?l.jsx("div",{className:"aw-list-empty",children:"没有匹配的评测组"}):ct.map(J=>l.jsxs("button",{type:"button",className:`aw-agent-item${J.id===Ke?" is-active":""}`,onClick:()=>Ne(J.id),children:[l.jsxs("span",{className:"aw-agent-copy aw-eval-group-copy",children:[l.jsx("strong",{children:J.name}),l.jsxs("small",{children:[J.agentIds.length," 个智能体 · ",J.history.length," 次运行"]})]}),l.jsx(id,{"aria-hidden":!0})]},J.id)):c&&Ye.length===0&&rt.length===0?l.jsx("div",{className:"aw-list-empty",children:"正在读取云端智能体…"}):u&&Ye.length===0&&rt.length===0?l.jsxs("div",{className:"aw-list-empty aw-list-error",children:[l.jsx("span",{children:u}),p&&l.jsx("button",{type:"button",onClick:p,children:"重试"})]}):Ye.length===0&&rt.length===0?l.jsx("div",{className:"aw-list-empty",children:"没有匹配的智能体"}):l.jsxs(l.Fragment,{children:[rt.map(J=>{const he=d.filter(Le=>{var Be,ot;return((Be=Le.agentDraft)==null?void 0:Be.name)===J.draft.name||Le.runtimeName===J.draft.name||!!((ot=J.deploymentTarget)!=null&&ot.runtimeId)&&Le.runtimeId===J.deploymentTarget.runtimeId}).sort((Le,Be)=>Be.startedAt-Le.startedAt)[0];return l.jsxs("button",{type:"button",className:`aw-agent-item${J.id===D?" is-active":""}`,onClick:()=>{O(""),M(""),U(J.id),S("basic")},children:[l.jsxs("span",{className:"aw-agent-copy",children:[l.jsxs("span",{className:"aw-agent-name-row",children:[l.jsx("strong",{children:J.draft.name||"未命名 Agent"}),l.jsx("span",{className:`aw-draft-badge${(he==null?void 0:he.status)==="running"?" is-deploying":""}`,children:(he==null?void 0:he.status)==="running"?"部署中":"草稿"})]}),l.jsx("small",{children:J.deploymentTarget?"待更新":"尚未发布"})]}),l.jsx(id,{"aria-hidden":!0})]},J.id)}),Ye.map(J=>{const he=J.runtimeId?Ue.get(J.runtimeId):void 0,Le=J.runtimeId?He.get(J.runtimeId):void 0,Be=(he==null?void 0:he.status)==="running"?{label:"部署中",className:" is-deploying"}:(he==null?void 0:he.status)==="error"?{label:"失败",className:" is-error"}:(he==null?void 0:he.status)==="cancelled"?{label:"已取消",className:" is-muted"}:Le?{label:"待更新",className:""}:null,ot=(he==null?void 0:he.status)==="running"?"正在更新部署":Le?"待更新":J.remote?J.host||"远程智能体":"本地智能体",It=["aw-agent-item","aw-agent-item--sortable",J.id===A?"is-active":"",J.id===P?"is-dragging":"",J.id===G&&J.id!==P?`is-drop-target is-drop-${ue}`:""].filter(Boolean).join(" ");return l.jsxs("button",{type:"button",draggable:!!m,className:It,"aria-keyshortcuts":m?"Alt+ArrowUp Alt+ArrowDown":void 0,onDragStart:st=>{m&&(te.current=!0,ie(J.id),st.dataTransfer.effectAllowed="move",st.dataTransfer.setData("text/plain",J.id))},onDragEnter:st=>{Xe(st,J.id)},onDragOver:st=>{!P||P===J.id||(st.preventDefault(),st.dataTransfer.dropEffect="move",Xe(st,J.id))},onDragLeave:st=>{const Z=st.relatedTarget;Z instanceof Node&&st.currentTarget.contains(Z)||G===J.id&&re("")},onDrop:st=>{st.preventDefault();const Z=st.dataTransfer.getData("text/plain")||P;bn(Z,J.id,ue),ie(""),re(""),ee("before")},onDragEnd:()=>{ie(""),re(""),ee("before"),window.setTimeout(()=>{te.current=!1},0)},onKeyDown:st=>{st.altKey&&(st.key==="ArrowUp"?(st.preventDefault(),ft(J.id,-1)):st.key==="ArrowDown"&&(st.preventDefault(),ft(J.id,1)))},onClick:st=>{if(te.current){st.preventDefault(),te.current=!1;return}M(""),U(""),O(J.id),S("basic"),g(J.id)},children:[l.jsxs("span",{className:"aw-agent-copy",children:[l.jsxs("span",{className:"aw-agent-name-row",children:[l.jsx("strong",{children:J.label}),J.currentVersion!=null&&l.jsxs("span",{className:"aw-version-badge",children:["v",J.currentVersion]}),Be&&l.jsx("span",{className:`aw-draft-badge${Be.className}`,children:Be.label})]}),l.jsx("small",{children:ot})]}),l.jsx(id,{"aria-hidden":!0})]},J.id)})]})}),l.jsxs("div",{className:"aw-list-count",children:["共 ",k==="library"?e.length+St:Ee.length," 个"]})]}),k==="evaluation"&&ze?l.jsx(khe,{group:ze,agents:e,cases:de,onChange:Pt,onRun:$e}):k==="evaluation"?l.jsx("main",{className:"aw-main aw-empty-selection",children:l.jsx("p",{children:"未选择评测组"})}):!B&&!Q&&!oe?l.jsx("main",{className:"aw-main aw-empty-selection",children:l.jsx("p",{children:"未选择智能体"})}):(Re==null?void 0:Re.status)==="running"?l.jsx("main",{className:"aw-main aw-deployment-focus",children:l.jsx(MA,{task:Re})}):l.jsxs("main",{className:"aw-main",children:[l.jsx("div",{className:"aw-agent-head",children:l.jsxs("div",{children:[l.jsxs("div",{className:"aw-agent-title-row",children:[l.jsx("h2",{children:tt}),(B==null?void 0:B.currentVersion)!=null&&l.jsxs("span",{children:["v",B.currentVersion]}),Q&&l.jsx("span",{children:"草稿"}),be&&l.jsx("span",{children:"待更新"}),!B&&!Q&&oe&&l.jsx("span",{children:oe.label})]}),l.jsx("p",{children:Tt.description||(i?"正在读取智能体信息…":"暂无描述")})]})}),l.jsx("nav",{className:"aw-agent-tabs","aria-label":"智能体详情",children:Ehe.map(J=>l.jsx("button",{type:"button",className:C===J.id?"is-active":"","aria-pressed":C===J.id,onClick:()=>S(J.id),children:J.label},J.id))}),l.jsxs("div",{className:"aw-content",children:[C==="basic"&&l.jsxs("div",{className:"aw-basic-stack",children:[l.jsxs("section",{className:"aw-canvas-card",children:[l.jsx("div",{className:"aw-card-head",children:l.jsx("strong",{children:"执行流程"})}),l.jsx("div",{className:"aw-canvas",children:l.jsx(Xm,{draft:Tt,direction:"horizontal",selectedPath:[],onSelect:()=>{},onAdd:()=>{},onInsert:()=>{},onDelete:()=>{},readOnly:!0,interactivePreview:!0})})]}),l.jsxs("section",{className:"aw-details-card",children:[l.jsx("div",{className:"aw-card-head",children:l.jsx("strong",{children:"详细信息"})}),l.jsxs("dl",{className:"aw-facts",children:[l.jsxs("div",{children:[l.jsx("dt",{children:"模型"}),l.jsx("dd",{children:(Oe==null?void 0:Oe.model)||Tt.modelName||"暂未提供"})]}),l.jsxs("div",{children:[l.jsx("dt",{children:"智能体数量"}),l.jsx("dd",{children:Oe!=null&&Oe.graph?j4(Oe.graph):D4(Tt)})]}),l.jsxs("div",{children:[l.jsx("dt",{children:"工具"}),l.jsx("dd",{children:(Oe==null?void 0:Oe.tools.length)??Tt.tools.length+(((nt=Tt.builtinTools)==null?void 0:nt.length)??0)+(((qt=Tt.customTools)==null?void 0:qt.length)??0)+(((fn=Tt.mcpTools)==null?void 0:fn.length)??0)})]}),l.jsxs("div",{children:[l.jsx("dt",{children:"技能"}),l.jsx("dd",{children:Oe?Oe.skillsPreviewSupported?Oe.skills.length:"暂不支持预览":((Lt=Tt.selectedSkills)==null?void 0:Lt.length)??Tt.skills.length})]}),l.jsxs("div",{children:[l.jsx("dt",{children:"当前版本"}),l.jsx("dd",{children:(j==null?void 0:j.currentVersion)!=null?`v${j.currentVersion}`:(B==null?void 0:B.currentVersion)!=null?`v${B.currentVersion}`:"暂未提供"})]}),l.jsxs("div",{children:[l.jsx("dt",{children:"状态"}),l.jsx("dd",{children:Q?"草稿":(Re==null?void 0:Re.status)==="error"?"部署失败":(Re==null?void 0:Re.status)==="cancelled"?"已取消":be?"待更新":l.jsxs(l.Fragment,{children:[l.jsx("span",{className:"aw-status-dot"}),"可用"]})})]})]})]}),Re&&l.jsx(MA,{task:Re}),l.jsxs("section",{className:"aw-deployment-panel aw-settings-card",children:[l.jsx("div",{className:"aw-section-head",children:l.jsxs("div",{children:[l.jsx("h3",{children:"部署配置"}),l.jsx("p",{children:"配置目标环境与网络访问方式。"})]})}),l.jsxs("dl",{className:"aw-readonly-config",children:[l.jsxs("div",{children:[l.jsx("dt",{children:"运行状态"}),l.jsx("dd",{children:(j==null?void 0:j.status)||"读取中…"})]}),l.jsxs("div",{children:[l.jsx("dt",{children:"部署区域"}),l.jsx("dd",{children:(j==null?void 0:j.region)||(B==null?void 0:B.region)||(Re==null?void 0:Re.region)||"暂未提供"})]}),l.jsxs("div",{children:[l.jsx("dt",{children:"网络访问"}),l.jsx("dd",{children:j!=null&&j.networkTypes.length?j.networkTypes.join(" / "):"暂未提供"})]})]})]}),l.jsxs("section",{className:"aw-option-panel aw-settings-card",children:[l.jsx("div",{className:"aw-section-head",children:l.jsxs("div",{children:[l.jsx("h3",{children:"优化项"}),l.jsx("p",{children:"针对运行质量开启专项优化策略。"})]})}),l.jsxs("div",{className:"aw-option-content",children:[l.jsx("div",{className:"aw-option-list","aria-disabled":"true",children:[["上下文优化","压缩冗余信息,保留对当前任务最有价值的上下文。"],["幻觉抑制","在证据不足时降低确定性表达并主动请求补充信息。"],["工具调用优化","减少重复调用,并优先复用已经获得的结果。"]].map(([J,he])=>l.jsxs("label",{children:[l.jsx("input",{type:"checkbox",disabled:!0}),l.jsxs("span",{children:[l.jsx("strong",{children:J}),l.jsx("small",{children:he})]})]},J))}),l.jsx("div",{className:"aw-option-glass",role:"status",children:l.jsx("span",{children:"暂未开放"})})]})]})]}),C==="evaluations"&&l.jsxs("section",{className:"aw-cases",children:[l.jsx("div",{className:"aw-case-filters",children:["good","bad"].map(J=>l.jsx("button",{type:"button",className:F===J?"is-active":"","aria-pressed":F===J,onClick:()=>I(J),children:J==="good"?"Good case":"Bad case"},J))}),l.jsxs("label",{className:"aw-case-search",children:[l.jsx(Vd,{"aria-hidden":!0}),l.jsx("input",{type:"search",value:V,onChange:J=>W(J.currentTarget.value),placeholder:"搜索用户输入、期望行为或标签","aria-label":"搜索评测案例"})]}),l.jsx(_he,{cases:kt})]})]}),C==="basic"&&(B||Q)&&l.jsxs("div",{className:"aw-basic-actions",children:[l.jsx("button",{type:"button",className:"aw-update studio-update-action",disabled:Q||be?!a:!(B!=null&&B.runtimeId)||!o||i||!Oe,onClick:()=>Q?_==null?void 0:_(Q):be?_==null?void 0:_(be):b(Tt),children:Q||be?"继续编辑":"更新"}),(Q||be)&&l.jsxs("button",{type:"button",className:"aw-head-delete studio-update-action",onClick:()=>{const J=Q??be;J&&vt(J)},disabled:le,"aria-label":"删除草稿",title:"删除草稿",children:[l.jsx(ea,{"aria-hidden":!0}),l.jsx("span",{children:"删除草稿"})]}),(B==null?void 0:B.canDelete)&&l.jsxs("button",{type:"button",className:"aw-head-delete studio-update-action",onClick:()=>void xt(B),disabled:le,"aria-label":"删除 Agent",title:"删除 Agent",children:[l.jsx(ea,{"aria-hidden":!0}),l.jsx("span",{children:le?"删除中…":"删除 Agent"})]})]})]})]}),k==="evaluation"&&l.jsx("div",{className:"aw-evaluation-glass",role:"status",children:l.jsx("span",{children:"敬请期待"})})]})]})}function _he({cases:e}){return l.jsxs("div",{className:"aw-case-table",children:[l.jsxs("div",{className:"aw-case-row aw-case-row-head",children:[l.jsx("span",{children:"用户输入"}),l.jsx("span",{children:"期望行为"}),l.jsx("span",{children:"标签"})]}),e.length===0?l.jsx("div",{className:"aw-case-empty",children:"没有匹配的案例"}):e.map(t=>l.jsxs("div",{className:"aw-case-row",children:[l.jsx("strong",{children:t.input}),l.jsx("p",{children:t.expectation}),l.jsx("span",{className:"aw-case-tag",children:t.tag})]},t.id))]})}function khe({group:e,agents:t,cases:n,onChange:r,onRun:s}){const[i,a]=w.useState("config"),o=e.agentIds.map(f=>t.find(h=>h.id===f)).filter(f=>!!f),c=["回答质量","事实准确性","工具调用","响应效率"];w.useEffect(()=>a("config"),[e.id]);const u=f=>{r({...e,agentIds:e.agentIds.includes(f)?e.agentIds.filter(h=>h!==f):[...e.agentIds,f]})},d=f=>{r({...e,metrics:e.metrics.includes(f)?e.metrics.filter(h=>h!==f):[...e.metrics,f]})};return l.jsxs("main",{className:"aw-main",children:[l.jsxs("div",{className:"aw-eval-head",children:[l.jsxs("div",{children:[l.jsxs("div",{className:"aw-agent-title-row",children:[l.jsx("h2",{children:e.name}),l.jsx("span",{children:"评测组"})]}),l.jsxs("p",{children:[o.length," 个参评智能体 · ",e.caseSet," · ",e.history.length," 次运行"]})]}),l.jsxs("button",{type:"button",className:"aw-run",onClick:()=>s(e),disabled:!0,children:[l.jsx(SH,{"aria-hidden":!0}),"开始评测"]})]}),l.jsxs("nav",{className:"aw-agent-tabs","aria-label":"评测组详情",children:[l.jsx("button",{type:"button",className:i==="config"?"is-active":"","aria-pressed":i==="config",onClick:()=>a("config"),disabled:!0,children:"评测配置"}),l.jsx("button",{type:"button",className:i==="history"?"is-active":"","aria-pressed":i==="history",onClick:()=>a("history"),disabled:!0,children:"历史结果"})]}),l.jsx("div",{className:"aw-content",children:i==="config"?l.jsxs("div",{className:"aw-eval-setup",children:[l.jsxs("section",{className:"aw-eval-block",children:[l.jsxs("div",{className:"aw-card-head",children:[l.jsx("strong",{children:"参评智能体"}),l.jsxs("span",{children:["已选择 ",o.length," 个"]})]}),l.jsx("div",{className:"aw-eval-agent-grid",children:t.map(f=>l.jsxs("label",{children:[l.jsx("input",{type:"checkbox",checked:e.agentIds.includes(f.id),onChange:()=>u(f.id)}),l.jsxs("span",{children:[l.jsx("strong",{children:f.label}),l.jsx("small",{children:f.remote?"远程":"本地"})]})]},f.id))})]}),l.jsxs("div",{className:"aw-eval-setting-grid",children:[l.jsxs("section",{className:"aw-eval-block",children:[l.jsx("div",{className:"aw-card-head",children:l.jsx("strong",{children:"评测资源"})}),l.jsxs("div",{className:"aw-eval-fields",children:[l.jsxs("label",{children:[l.jsx("span",{children:"评测集"}),l.jsxs("select",{value:e.caseSet,onChange:f=>r({...e,caseSet:f.currentTarget.value}),children:[l.jsx("option",{children:"核心回归集"}),l.jsx("option",{children:"安全边界集"}),l.jsx("option",{children:"工具调用集"})]}),l.jsxs("small",{children:[n.length," 条案例"]})]}),l.jsxs("label",{children:[l.jsx("span",{children:"评估器"}),l.jsxs("select",{value:e.evaluator,onChange:f=>r({...e,evaluator:f.currentTarget.value}),children:[l.jsx("option",{children:"综合质量评估器"}),l.jsx("option",{children:"事实一致性评估器"}),l.jsx("option",{children:"工具调用评估器"})]})]}),l.jsxs("label",{children:[l.jsx("span",{children:"并发数"}),l.jsxs("select",{value:e.concurrency,onChange:f=>r({...e,concurrency:f.currentTarget.value}),children:[l.jsx("option",{value:"2",children:"2"}),l.jsx("option",{value:"4",children:"4"}),l.jsx("option",{value:"8",children:"8"})]})]})]})]}),l.jsxs("section",{className:"aw-eval-block",children:[l.jsxs("div",{className:"aw-card-head",children:[l.jsx("strong",{children:"评测指标"}),l.jsxs("span",{children:["已选择 ",e.metrics.length," 项"]})]}),l.jsx("div",{className:"aw-metric-list",children:c.map(f=>l.jsxs("label",{children:[l.jsx("input",{type:"checkbox",checked:e.metrics.includes(f),onChange:()=>d(f)}),l.jsx("span",{children:f})]},f))})]})]})]}):l.jsxs("section",{className:"aw-eval-history",children:[l.jsx("div",{className:"aw-section-head",children:l.jsxs("div",{children:[l.jsx("h3",{children:"历史结果"}),l.jsx("p",{children:"查看该评测组历次运行的总体表现。"})]})}),e.history.length===0?l.jsxs("div",{className:"aw-results-empty",children:[l.jsx("strong",{children:"暂无历史结果"}),l.jsx("span",{children:"完成首次评测后,结果会出现在这里。"})]}):l.jsx("div",{className:"aw-history-list",children:e.history.map((f,h)=>l.jsxs("button",{type:"button",children:[l.jsxs("span",{children:[l.jsxs("strong",{children:["评测运行 #",e.history.length-h]}),l.jsxs("small",{children:[f.createdAt," · ",o.length," 个智能体"]})]}),l.jsxs("span",{className:"aw-history-score",children:[l.jsx("strong",{children:f.score}),l.jsx("small",{children:"综合得分"})]}),l.jsxs("span",{className:"aw-complete",children:[l.jsx(Js,{}),"已完成"]}),l.jsx(id,{"aria-hidden":!0})]},f.id))})]})})]})}const Nhe={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 She(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 The(e){return typeof e=="object"&&e!==null&&typeof e.path=="string"}function Ahe(e){return typeof e=="object"&&e!==null&&typeof e.call=="string"}function Hv(e,t){if(The(e))return She(t,e.path);if(Ahe(e)){const n=Nhe[e.call],r={};for(const[s,i]of Object.entries(e.args??{}))r[s]=Hv(i,t);return n?n(r):`[unknown fn: ${e.call}]`}return e}function Che(e,t){const n=Hv(e,t);return n==null?"":typeof n=="string"?n:String(n)}const P4=new Map;function el(e,t){P4.set(e,t)}function Ihe(e){return P4.get(e)}function Ohe(e,t,n){const r=t.replace(/^\//,"").split("/").map(i=>i.replace(/~1/g,"/").replace(/~0/g,"~"));let s=e;for(let i=0;iHv(r,e.dataModel),resolveString:r=>Che(r,e.dataModel),dispatchAction:t,render:r=>{if(!r)return null;const s=e.components[r];if(!s)return null;const i=Ihe(s.component)??Rhe;return l.jsx(i,{node:s,ctx:n},r)}};return l.jsx("div",{className:"a2ui-surface","data-a2ui-surface":e.surfaceId,children:n.render(e.rootId)})}function Mhe(e){const t=w.useRef(null),n=w.useRef(!0),r=28,s=w.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 zv({value:e,onRemoveSkill:t,onRemoveAgent:n}){return e.skills.length===0&&!e.targetAgent?null:l.jsxs("div",{className:"invocation-chips","aria-label":"本轮调用上下文",children:[e.skills.map(r=>l.jsxs("span",{className:"invocation-chip invocation-chip--skill",title:r.description,children:[l.jsx(Po,{"aria-hidden":!0}),l.jsxs("span",{children:["/",r.name]}),t?l.jsx("button",{type:"button",onClick:()=>t(r.name),"aria-label":`移除技能 ${r.name}`,children:l.jsx(zr,{})}):null]},r.name)),e.targetAgent?l.jsxs("span",{className:"invocation-chip invocation-chip--agent",title:e.targetAgent.description,children:[l.jsx(xL,{"aria-hidden":!0}),l.jsx("span",{children:e.targetAgent.name}),n?l.jsx("button",{type:"button",onClick:n,"aria-label":`移除 Agent ${e.targetAgent.name}`,children:l.jsx(zr,{})}):null]}):null]})}function Vv(e=""){return e.startsWith("image/")?"image":e.startsWith("video/")?"video":e==="application/pdf"?"pdf":e==="text/markdown"?"markdown":"text"}function F4(e){var n,r,s,i;const t=Vv(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 U4(e){return e?e<1024?`${e} B`:e<1024*1024?`${Math.round(e/1024)} KB`:`${(e/(1024*1024)).toFixed(1)} MB`:""}function $4(e,t){return e.previewUrl?e.previewUrl:e.data?`data:${e.mimeType??"application/octet-stream"};base64,${e.data}`:e.uri?YL(t,e.uri):""}function jhe({kind:e}){return e==="image"?l.jsx(TL,{}):e==="video"?l.jsx(NL,{}):e==="pdf"?l.jsx(kH,{}):l.jsx(kL,{})}function Kv({appName:e,items:t,compact:n=!1,onRemove:r}){const[s,i]=w.useState(null);return l.jsxs(l.Fragment,{children:[l.jsx("div",{className:`media-grid${n?" media-grid--compact":""}`,children:t.map(a=>{const o=Vv(a.mimeType),c=$4(a,e),u=a.status==="uploading"||a.status==="error"||!c,d=l.jsxs("button",{type:"button",className:"media-card-main",disabled:u,onClick:()=>i(a),"aria-label":`预览 ${a.name??"附件"}`,children:[o==="image"&&c?l.jsx("img",{className:"media-card-image",src:c,alt:a.name??"图片",loading:"lazy"}):o==="video"&&c?l.jsxs("div",{className:"media-card-video-container",children:[l.jsx("video",{className:"media-card-video",src:c,muted:!0,playsInline:!0,preload:"metadata","aria-hidden":"true"}),l.jsx("span",{className:"media-card-video-play",children:l.jsx(zH,{})})]}):l.jsx("span",{className:"media-card-icon",children:l.jsx(jhe,{kind:o})}),l.jsxs("span",{className:"media-card-copy",children:[l.jsx("span",{className:"media-card-name",children:a.name??"附件"}),l.jsxs("span",{className:"media-card-meta",children:[l.jsx("span",{className:"media-card-type",children:F4(a)}),a.status==="uploading"?l.jsxs(l.Fragment,{children:[l.jsx(Rt,{className:"media-card-spinner"})," 上传中"]}):a.status==="error"?a.error??"上传失败":U4(a.sizeBytes)]})]}),!n&&a.status!=="uploading"&&a.status!=="error"?l.jsx(tc,{className:"media-card-open"}):null]});return l.jsxs($t.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?l.jsx(mL,{src:c,children:d}):d,r?l.jsx("button",{type:"button",className:"media-card-remove","aria-label":`移除 ${a.name??"附件"}`,onClick:()=>r(a.id),children:l.jsx(zr,{})}):null]},a.id)})}),l.jsx(pi,{children:s?l.jsx(Dhe,{appName:e,item:s,onClose:()=>i(null)}):null})]})}function Dhe({appName:e,item:t,onClose:n}){const r=w.useMemo(()=>$4(t,e),[e,t]),s=Vv(t.mimeType),[i,a]=w.useState(""),[o,c]=w.useState(s==="text"||s==="markdown"),[u,d]=w.useState("");return w.useEffect(()=>{const f=h=>{h.key==="Escape"&&n()};return window.addEventListener("keydown",f),()=>window.removeEventListener("keydown",f)},[n]),w.useEffect(()=>{if(s!=="text"&&s!=="markdown")return;const f=new AbortController;return c(!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||c(!1)}),()=>f.abort()},[s,r]),l.jsx($t.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:l.jsxs($t.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:[l.jsxs("header",{className:"media-viewer-header",children:[l.jsxs("div",{children:[l.jsx("strong",{children:t.name??"附件"}),l.jsxs("span",{children:[F4(t),t.sizeBytes?` · ${U4(t.sizeBytes)}`:""]})]}),l.jsxs("nav",{children:[l.jsx("a",{href:r,download:t.name,"aria-label":"下载",children:l.jsx(Cw,{})}),l.jsx("button",{type:"button",onClick:n,"aria-label":"关闭",children:l.jsx(zr,{})})]})]}),l.jsxs("div",{className:`media-viewer-body media-viewer-body--${s}`,children:[s==="image"?l.jsx("img",{src:r,alt:t.name??"图片"}):null,s==="video"?l.jsx("div",{className:"media-viewer-video-wrapper",children:l.jsx("video",{src:r,controls:!0,autoPlay:!0,playsInline:!0,preload:"auto",className:"media-viewer-video"})}):null,s==="pdf"?l.jsx("iframe",{src:r,title:t.name??"PDF"}):null,o?l.jsxs("div",{className:"media-viewer-loading",children:[l.jsx(Rt,{})," 正在读取文档…"]}):null,!o&&u?l.jsxs("div",{className:"media-viewer-loading",children:["文档加载失败:",u]}):null,!o&&s==="markdown"?l.jsx("div",{className:"media-document",children:l.jsx(Mf,{text:i})}):null,!o&&s==="text"?l.jsx("pre",{className:"media-document media-document--plain",children:i}):null]})]})})}function Phe(e){return l.jsxs("svg",{viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"1.75",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",...e,children:[l.jsx("circle",{cx:"10.25",cy:"10.25",r:"6.25"}),l.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 Bhe(e){return l.jsxs("svg",{viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"1.75",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",...e,children:[l.jsx("rect",{x:"3.25",y:"5.25",width:"15.5",height:"13.5",rx:"2.25"}),l.jsx("circle",{cx:"8.1",cy:"9.3",r:"1.35"}),l.jsx("path",{d:"m4.7 16.5 3.65-3.7 2.45 2.25 2.2-2.2 4.35 4.1"}),l.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 Fhe(e){return l.jsxs("svg",{viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"1.75",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",...e,children:[l.jsx("rect",{x:"3.25",y:"5.5",width:"16.25",height:"13",rx:"2.4"}),l.jsx("path",{d:"m10.2 9.2 4.4 2.8-4.4 2.8V9.2Z"}),l.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 Uhe(e){return l.jsxs("svg",{viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"1.75",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",...e,children:[l.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"}),l.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"}),l.jsx("path",{d:"M8.2 12.25h.01M8.2 16.8h.01"})]})}function $he(e){return l.jsxs("svg",{viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"1.75",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",...e,children:[l.jsx("path",{d:"M4.25 4.25h4.5v15.5h-4.5zM8.75 5.75h5v14h-5zM13.75 4.25h4.1v10.25h-4.1z"}),l.jsx("path",{d:"M5.75 7h1.5M10.25 8.25h2M10.25 11h2M15.15 7h1.3"}),l.jsx("circle",{cx:"17.45",cy:"17.35",r:"2.45"}),l.jsx("path",{d:"m19.25 19.15 1.55 1.55"})]})}function Hhe(e){return l.jsxs("svg",{viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"1.75",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",...e,children:[l.jsx("path",{d:"M4.25 6.25h6.25c1 0 1.5.55 1.5 1.45v11.05c0-.9-.5-1.45-1.5-1.45H4.25V6.25Z"}),l.jsx("path",{d:"M19.75 9.1v8.2H13.5c-1 0-1.5.55-1.5 1.45V7.7c0-.9.5-1.45 1.5-1.45h2.15"}),l.jsx("path",{d:"m19 3.2.58 1.62 1.62.58-1.62.58L19 7.6l-.58-1.62-1.62-.58 1.62-.58L19 3.2Z",fill:"currentColor",stroke:"none"})]})}function zhe(e){return l.jsxs("svg",{viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"1.75",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",...e,children:[l.jsx("path",{d:"m4.2 8.4 1.15 10.2h13.3L19.8 8.4"}),l.jsx("path",{d:"M4.2 8.4h15.6L17.9 5H6.1L4.2 8.4Z"}),l.jsx("path",{d:"M7.2 12.2c1.1-1 2.25 1.25 3.4.25 1.05-.9 2.15 1.3 3.3.25"}),l.jsx("path",{d:"m8.2 15.1 1.45 1.35 1.45-1.35M13.55 16.45h2.35"})]})}function H4(e){return l.jsx("svg",{viewBox:"0 0 16 16",fill:"none",stroke:"currentColor",strokeWidth:"1.6",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",...e,children:l.jsx("path",{d:"m6 3.25 4.5 4.75L6 12.75"})})}function Vhe({definition:e,label:t,done:n,open:r,onToggle:s}){const i=e.icon,a=t??(n?e.doneLabel:e.runningLabel);return l.jsxs("button",{type:"button",className:`builtin-tool-head${n?" is-done":" is-running"}`,"data-tool-tone":e.tone,onClick:s,"aria-expanded":r,children:[l.jsx("span",{className:"builtin-tool-icon","aria-hidden":"true",children:l.jsx(i,{})}),n?l.jsx("span",{className:"builtin-tool-label",children:a}):l.jsx(ta,{className:"builtin-tool-label",duration:2.4,spread:18,"aria-live":"polite",children:a}),l.jsx(H4,{className:`builtin-tool-chevron${r?" is-open":""}`})]})}const Khe={web_search:{name:"web_search",runningLabel:"正在进行网络搜索",doneLabel:"已完成网络搜索",tone:"search",icon:Phe},run_code:{name:"run_code",runningLabel:"正在 AgentKit 沙箱中执行代码",doneLabel:"已在 AgentKit 沙箱中完成代码执行",tone:"sandbox",icon:zhe},image_generate:{name:"image_generate",runningLabel:"正在生成图片",doneLabel:"已完成图片生成",tone:"image",icon:Bhe},video_generate:{name:"video_generate",runningLabel:"正在生成视频",doneLabel:"已完成视频生成",tone:"video",icon:Fhe},load_memory:{name:"load_memory",runningLabel:"正在检索长期记忆",doneLabel:"已完成记忆检索",tone:"memory",icon:Uhe},load_knowledgebase:{name:"load_knowledgebase",runningLabel:"正在检索知识库",doneLabel:"已完成知识库检索",tone:"knowledge",icon:$he},load_skill:{name:"load_skill",runningLabel:"正在加载技能",doneLabel:"已加载技能",tone:"skill",icon:Hhe}};function Yhe(e){return Khe[e]}const z4="send_a2ui_json_to_client",Whe=28;function Ghe(e,t,n){let r=t;for(let s=0;s65535?2:1}return r}function qhe(e){return e<=4?1:Math.min(18,Math.max(2,Math.ceil(e/6)))}function V4(e,t,n){const[r,s]=w.useState(()=>t?"":e),i=w.useRef(r),a=w.useRef(e),o=w.useRef(null),c=w.useRef(0),u=w.useRef(n);return a.current=e,u.current=n,w.useEffect(()=>{const d=i.current,f=window.matchMedia("(prefers-reduced-motion: reduce)").matches;if(!t||f||!e.startsWith(d)){o.current!==null&&window.cancelAnimationFrame(o.current),o.current=null,d!==e&&(i.current=e,s(e));return}if(d===e||o.current!==null)return;const h=p=>{const m=a.current,y=i.current;if(!m.startsWith(y)){i.current=m,s(m),o.current=null;return}if(p-c.current{var d;(d=u.current)==null||d.call(u)},[r]),w.useEffect(()=>()=>{o.current!==null&&(window.cancelAnimationFrame(o.current),o.current=null)},[]),r}function Xhe({className:e}){return l.jsx("svg",{className:e,viewBox:"0 0 24 24",fill:"currentColor","aria-hidden":!0,children:l.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 Qhe(){return l.jsx("svg",{viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"1.75",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",children:l.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 Zhe(e,t){if(e!=="load_skill"||t==null||typeof t!="object"||Array.isArray(t))return;const n=t.skill_name;if(!(typeof n!="string"||!n.trim()))return`使用 ${n.trim()} 技能`}function K4({text:e,done:t,streaming:n=!1,onStreamFrame:r}){const[s,i]=w.useState(!t),a=w.useRef(!1);w.useEffect(()=>{a.current||i(!t)},[t]);const o=()=>{a.current=!0,i(h=>!h)},c=e.replace(/^\s+/,""),u=V4(c,!t||n,r),{ref:d,onScroll:f}=Mhe(u);return l.jsxs("div",{className:"block-thinking",children:[l.jsxs("button",{className:"think-head",onClick:o,type:"button",children:[l.jsx("span",{className:"think-icon","aria-hidden":"true",children:l.jsx(Xhe,{className:`spark ${t?"":"pulse"}`})}),t?l.jsx("span",{className:"think-label think-label--done",children:"已完成思考"}):l.jsx(ta,{className:"think-label",duration:2.4,spread:18,children:"思考中"}),l.jsx(ws,{className:`chev ${s?"open":""}`})]}),l.jsx("div",{className:`think-collapse ${s&&u?"open":""}`,children:l.jsx("div",{className:"think-collapse-inner",children:l.jsx("div",{className:"think-body scroll",ref:d,onScroll:f,children:u})})})]})}function Y4(){return l.jsx(K4,{text:"",done:!1})}const Jhe=w.memo(function({text:t,streaming:n,onStreamFrame:r}){const s=V4(t,n,r);return s?l.jsx("div",{className:"bubble",children:l.jsx(Mf,{text:s})}):null});function epe({name:e,args:t,response:n,done:r}){const[s,i]=w.useState(!1),a=e===z4?"渲染 UI":e,o=Yhe(e),c=n==null?null:typeof n=="string"?n:JSON.stringify(n,null,2),u=c&&c.length>2e3?c.slice(0,2e3)+` -…(已截断)`:c;return l.jsxs($t.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?l.jsx(Vhe,{definition:o,label:Zhe(e,t),done:r,open:s,onToggle:()=>i(d=>!d)}):l.jsxs("button",{className:"tool-head tool-head--generic",onClick:()=>i(d=>!d),type:"button","aria-expanded":s,children:[l.jsx("span",{className:"tool-icon tool-icon--generic","aria-hidden":"true",children:l.jsx(Qhe,{})}),r?l.jsx("span",{className:"tool-name",children:a}):l.jsx(ta,{className:"tool-name",duration:2.2,spread:15,children:a}),l.jsx(H4,{className:`tool-chevron${s?" is-open":""}`})]}),l.jsx("div",{className:`think-collapse ${s?"open":""}`,children:l.jsx("div",{className:"think-collapse-inner",children:l.jsxs("div",{className:"tool-detail",children:[t!=null&&l.jsxs("div",{className:"tool-section",children:[l.jsx("div",{className:"tool-section-label",children:"参数"}),l.jsx("pre",{className:"tool-args",children:JSON.stringify(t,null,2)})]}),u!=null&&l.jsxs("div",{className:"tool-section",children:[l.jsx("div",{className:"tool-section-label",children:"返回"}),l.jsx("pre",{className:"tool-args tool-result",children:u})]})]})})})]})}function tpe({block:e,onAuth:t}){const[n,r]=w.useState(e.done?"done":"idle"),[s,i]=w.useState(""),a=e.label||"MCP 工具集",o=(()=>{try{return e.authUri?new URL(e.authUri).host:""}catch{return""}})(),c=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"?l.jsxs($t.div,{className:"auth-card-collapsed",initial:{opacity:0},animate:{opacity:1},transition:{duration:.2},children:[l.jsx(uS,{className:"auth-card-icon auth-card-icon--done"}),l.jsxs("span",{children:["已授权 · ",a]})]}):l.jsxs($t.div,{className:"auth-card",initial:{opacity:0,y:6},animate:{opacity:1,y:0},transition:{duration:.2,ease:"easeOut"},children:[l.jsxs("div",{className:"auth-card-head",children:[l.jsx(uS,{className:"auth-card-icon"}),l.jsxs("span",{className:"auth-card-title",children:[a," 需要授权"]})]}),l.jsxs("p",{className:"auth-card-desc",children:["工具集 ",l.jsx("code",{className:"auth-card-code",children:a})," 使用 OAuth 保护, 需登录授权后方可调用。",o&&l.jsxs(l.Fragment,{children:[" ","将跳转至 ",l.jsx("code",{className:"auth-card-code",children:o})," 完成登录,"]}),"授权完成后对话自动继续。"]}),l.jsx("button",{className:"auth-card-btn",onClick:c,disabled:n==="authorizing"||!e.authUri,children:n==="authorizing"?l.jsxs(l.Fragment,{children:[l.jsx(Rt,{className:"cw-i spin"})," 等待授权…"]}):l.jsx(l.Fragment,{children:"去授权"})}),!e.authUri&&l.jsx("div",{className:"auth-card-err",children:"未在事件中找到授权地址。"}),s&&l.jsx("div",{className:"auth-card-err",children:s})]})}function Yv({blocks:e,appName:t="",streaming:n=!1,onStreamFrame:r,onAction:s,onAuth:i}){return l.jsx(l.Fragment,{children:e.map((a,o)=>{switch(a.kind){case"thinking":return l.jsx(K4,{text:a.text,done:a.done,streaming:n,onStreamFrame:r},o);case"text":{const c=a.text.replace(/^\s+/,"");return c?l.jsx(Jhe,{text:c,streaming:n,onStreamFrame:r},o):null}case"attachment":return l.jsx(Kv,{appName:t,items:a.files},o);case"invocation":return l.jsx(zv,{value:a.value},o);case"tool":return a.name===z4&&a.done?null:l.jsx(epe,{name:a.name,args:a.args,response:a.response,done:a.done},o);case"agent-transfer":return null;case"auth":return l.jsx(tpe,{block:a,onAuth:i},o);case"a2ui":return B4(a.messages).filter(c=>c.components[c.rootId]).map(c=>l.jsx($t.div,{initial:{opacity:0,y:8,scale:.985},animate:{opacity:1,y:0,scale:1},transition:{type:"spring",stiffness:380,damping:30},children:l.jsx(Lhe,{surface:c,onAction:s})},`${o}-${c.surfaceId}`));default:return null}})})}function W4(e){return e.isComposing||e.keyCode===229}const npe="/assets/arkclaw-DG3MhHYM.png",rpe="/assets/codex-Csw-JJxq.png",spe="/assets/hermes-C6L-CfGS.png",js=[{value:"agent",label:"Agent",description:"与当前选择的 Agent 对话"},{value:"temporary",label:"内置智能体",description:"使用平台提供的智能体"},{value:"skill-create",label:"创建 Skill",description:"使用两个模型生成并对比 Skill"}],ipe=[{label:"ArkClaw",logo:npe},{label:"Hermes 智能体",logo:spe}];function jA({mode:e}){return e==="skill-create"?l.jsxs("svg",{className:"new-chat-mode__skill-icon",viewBox:"0 0 20 20","aria-hidden":"true",children:[l.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"}),l.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"?l.jsxs("svg",{className:"new-chat-mode__temporary-icon",viewBox:"0 0 20 20","aria-hidden":"true",children:[l.jsx("path",{d:"m10 2.8 6.1 3.45v7.5L10 17.2l-6.1-3.45v-7.5L10 2.8Z"}),l.jsx("path",{d:"m3.9 6.25 6.1 3.5 6.1-3.5M10 9.75v7.45"})]}):l.jsx(xc,{className:"new-chat-mode__agent-icon"})}function ape(){return l.jsx("svg",{className:"new-chat-mode__nested-chevron",viewBox:"0 0 12 12","aria-hidden":"true",children:l.jsx("path",{d:"m4.5 3 3 3-3 3"})})}function ope({value:e,onChange:t,disabled:n=!1,temporaryEnabled:r,skillCreateEnabled:s}){const[i,a]=w.useState(!1),[o,c]=w.useState(!1),[u,d]=w.useState(()=>js.findIndex(k=>k.value===e)),f=w.useRef(null),h=w.useRef(null),p=js.find(k=>k.value===e)??js[0],m=p.value==="temporary"?"Codex 智能体":p.label;function y(k){return k.value==="temporary"?r:k.value==="skill-create"?s:!0}function E(k){return y(k)!==!0}function g(k){const N=y(k);return N===void 0?"正在检查配置":N?k.description:"管理员未配置"}w.useEffect(()=>{if(!i)return;const k=N=>{var C;(C=f.current)!=null&&C.contains(N.target)||(a(!1),c(!1))};return document.addEventListener("mousedown",k),()=>document.removeEventListener("mousedown",k)},[i]);function x(k){let N=u;do N=(N+k+js.length)%js.length;while(E(js[N]));d(N),c(js[N].value==="temporary")}function b(k){var N;if(!E(k)){if(k.value==="temporary"){c(!0);return}t(k.value),a(!1),c(!1),(N=h.current)==null||N.focus()}}function _(){t("temporary"),a(!1),c(!1)}return l.jsxs("div",{className:"new-chat-mode",ref:f,children:[l.jsxs("button",{ref:h,type:"button",className:"new-chat-mode__trigger","aria-label":"选择新会话模式","aria-haspopup":"listbox","aria-expanded":i,disabled:n,onClick:()=>{d(js.findIndex(k=>k.value===e)),a(k=>(k&&c(!1),!k))},onKeyDown:k=>{k.key==="ArrowDown"||k.key==="ArrowUp"?(k.preventDefault(),i?x(k.key==="ArrowDown"?1:-1):a(!0)):i&&(k.key==="Enter"||k.key===" ")?(k.preventDefault(),b(js[u])):i&&k.key==="Escape"&&(k.preventDefault(),a(!1),c(!1))},children:[l.jsx("span",{className:"new-chat-mode__icon",children:l.jsx(jA,{mode:p.value})}),l.jsx("span",{className:"new-chat-mode__current",title:m,children:m}),l.jsx("svg",{className:"new-chat-mode__chevron",viewBox:"0 0 12 12","aria-hidden":"true",children:l.jsx("path",{d:"m3 4.5 3 3 3-3"})})]}),i?l.jsx("div",{className:"new-chat-mode__menu",role:"listbox","aria-label":"新会话模式",tabIndex:-1,onKeyDown:k=>{var N;k.key==="ArrowDown"||k.key==="ArrowUp"?(k.preventDefault(),x(k.key==="ArrowDown"?1:-1)):k.key==="Enter"?(k.preventDefault(),b(js[u])):k.key==="Escape"&&(k.preventDefault(),a(!1),c(!1),(N=h.current)==null||N.focus())},children:js.map((k,N)=>{const C=k.value==="temporary";return l.jsxs("button",{type:"button",role:"option","aria-selected":e===k.value,"aria-haspopup":C?"menu":void 0,"aria-expanded":C?o:void 0,"aria-disabled":E(k),disabled:E(k),className:`new-chat-mode__option${N===u?" is-active":""}`,onMouseEnter:()=>{d(N),c(k.value==="temporary")},onClick:()=>b(k),children:[l.jsx("span",{className:"new-chat-mode__option-icon",children:l.jsx(jA,{mode:k.value})}),l.jsxs("span",{className:"new-chat-mode__copy",children:[l.jsxs("span",{className:"new-chat-mode__label",children:[k.label,k.value==="skill-create"?l.jsx("span",{className:"new-chat-mode__beta",children:"Beta"}):null]}),l.jsx("span",{children:g(k)})]}),C?l.jsx(ape,{}):e===k.value?l.jsx("svg",{className:"new-chat-mode__check",viewBox:"0 0 16 16","aria-hidden":"true",children:l.jsx("path",{d:"m3.5 8.2 2.8 2.8 6.2-6"})}):null]},k.value)})}):null,i&&o?l.jsxs("div",{className:"new-chat-mode__submenu",role:"menu","aria-label":"内置智能体",children:[l.jsxs("button",{type:"button",role:"menuitem",className:"new-chat-mode__submenu-option",onClick:_,children:[l.jsx("img",{className:"new-chat-mode__builtin-icon",src:rpe,alt:"","aria-hidden":"true"}),l.jsxs("span",{className:"new-chat-mode__copy",children:[l.jsx("span",{className:"new-chat-mode__label",children:"Codex 智能体"}),l.jsx("span",{children:"在沙箱中执行任务"})]})]}),ipe.map(({label:k,logo:N})=>l.jsxs("button",{type:"button",role:"menuitem",className:"new-chat-mode__submenu-option",disabled:!0,children:[l.jsx("img",{className:"new-chat-mode__builtin-icon",src:N,alt:"","aria-hidden":"true"}),l.jsxs("span",{className:"new-chat-mode__copy",children:[l.jsx("span",{className:"new-chat-mode__label",children:k}),l.jsx("span",{children:"暂不可用"})]})]},k))]}):null]})}const Wv=["doubao-seed-2-0-pro-260215","deepseek-v4-flash-260425"];function lpe(){return l.jsxs("svg",{viewBox:"0 0 20 20",fill:"none","aria-hidden":"true",children:[l.jsx("circle",{cx:"8.2",cy:"8.2",r:"4.7"}),l.jsx("path",{d:"m11.7 11.7 4.1 4.1"}),l.jsx("path",{d:"M14.8 2.7v3.2M13.2 4.3h3.2"}),l.jsx("circle",{cx:"8.2",cy:"8.2",r:"1",fill:"currentColor",stroke:"none"})]})}function cpe(){return l.jsxs("svg",{viewBox:"0 0 20 20",fill:"none","aria-hidden":"true",children:[l.jsx("circle",{cx:"4.2",cy:"15.4",r:"1.4"}),l.jsx("circle",{cx:"15.7",cy:"4.2",r:"1.4"}),l.jsx("path",{d:"M5.7 15.1c3.5-.3 1.8-4.7 5.1-5.1 2.8-.4 2.1-3.7 3.5-4.8"}),l.jsx("path",{d:"m12.7 14.2 1.5 1.5 2.9-3.3"})]})}function upe(){return l.jsxs("svg",{viewBox:"0 0 20 20",fill:"none","aria-hidden":"true",children:[l.jsx("path",{d:"M3.2 5.2h7.1M3.2 9.5h5.2M3.2 13.8h4"}),l.jsx("path",{d:"m10.1 14.8.6-2.8 4.7-4.7 2.2 2.2-4.7 4.7-2.8.6Z"}),l.jsx("path",{d:"M14.5 3.1v2.5M13.2 4.4h2.6"})]})}const dpe=[{icon:lpe,text:"帮我分析一个问题,并给出清晰的解决思路"},{icon:cpe,text:"根据我的目标,制定一份可执行的行动计划"},{icon:upe,text:"帮我整理并润色一段内容,让表达更清晰"}];function fpe({sessionId:e,sessionInitializing:t=!1,appName:n,agentName:r,value:s,onChange:i,onSubmit:a,disabled:o,busy:c,showMeta:u,attachments:d,skills:f,agents:h,invocation:p,capabilitiesLoading:m=!1,allowAttachments:y=!0,onInvocationChange:E,onAddFiles:g,onRemoveAttachment:x,newChatMode:b="agent",newChatLayout:_=!1,showModeSelector:k=!1,onModeChange:N,temporaryEnabled:C,skillCreateEnabled:S}){const A=w.useRef(null),O=w.useRef(null),D=w.useRef(null),U=w.useRef(null),[X,M]=w.useState(!1),[j,T]=w.useState(null),[L,R]=w.useState(0),[F,I]=w.useState(!1);async function V(){if(e)try{await navigator.clipboard.writeText(e),I(!0),setTimeout(()=>I(!1),1500)}catch{I(!1)}}w.useLayoutEffect(()=>{const te=A.current;te&&(te.style.height="auto",te.style.height=`${Math.min(te.scrollHeight,200)}px`)},[s]);const W=b==="skill-create";w.useEffect(()=>{W&&(M(!1),T(null))},[W]);const P=!W&&d.some(te=>te.status!=="ready"),ie=!o&&!c&&!P&&(s.trim().length>0||!W&&d.length>0),G=(j==null?void 0:j.query.toLocaleLowerCase())??"",re=(j==null?void 0:j.kind)==="skill"?f.filter(te=>!p.skills.some(de=>de.name===te.name)).filter(te=>`${te.name} ${te.description}`.toLocaleLowerCase().includes(G)).map(te=>({kind:"skill",value:te})):(j==null?void 0:j.kind)==="agent"?h.filter(te=>`${te.name} ${te.description}`.toLocaleLowerCase().includes(G)).map(te=>({kind:"agent",value:te})):[];function ue(te){var de;M(!1),T(null),(de=te.current)==null||de.click()}function ee(te){i(te),M(!1),T(null),requestAnimationFrame(()=>{var de,Ee;(de=A.current)==null||de.focus(),(Ee=A.current)==null||Ee.setSelectionRange(te.length,te.length)})}function le(te,de){const Ee=te.slice(0,de),Te=/(^|\s)([/@])([^\s/@]*)$/.exec(Ee);if(!Te){T(null);return}const Ke=Te[2].length+Te[3].length,Ne={kind:Te[2]==="/"?"skill":"agent",query:Te[3],start:de-Ke,end:de},it=!j||j.kind!==Ne.kind||j.query!==Ne.query||j.start!==Ne.start||j.end!==Ne.end;T(Ne),it&&R(0),M(!1)}function ne(te){if(!j)return;const de=s.slice(0,j.start)+s.slice(j.end);i(de),te.kind==="skill"?E({...p,skills:[...p.skills,te.value]}):E({skills:[],targetAgent:te.value});const Ee=j.start;T(null),requestAnimationFrame(()=>{var Te,Ke;(Te=A.current)==null||Te.focus(),(Ke=A.current)==null||Ke.setSelectionRange(Ee,Ee)})}function me(){if(p.targetAgent){E({skills:[]});return}p.skills.length>0&&E({...p,skills:p.skills.slice(0,-1)})}function ye(te){const de=te.target.files?Array.from(te.target.files):[];de.length&&g(de),te.target.value=""}return l.jsxs("div",{className:`composer${_?" composer--new-chat":""}${W?" composer--skill-mode":""}`,children:[W?null:l.jsx(zv,{value:p,onRemoveSkill:te=>E({...p,skills:p.skills.filter(de=>de.name!==te)}),onRemoveAgent:()=>E({skills:[]})}),!W&&d.length>0&&l.jsx(Kv,{appName:n,compact:!0,items:d,onRemove:x}),l.jsxs("div",{className:"composer-box",children:[j?l.jsxs("div",{className:"composer-command-menu",role:"listbox","aria-label":j.kind==="skill"?"可用技能":"可用子 Agent",children:[l.jsxs("div",{className:"composer-command-head",children:[j.kind==="skill"?l.jsx(Po,{}):l.jsx(xL,{}),l.jsx("span",{children:j.kind==="skill"?"调用技能":"使用子 Agent"}),l.jsx("kbd",{children:j.kind==="skill"?"/":"@"})]}),m?l.jsxs("div",{className:"composer-command-empty",children:[l.jsx(Rt,{className:"spin"})," 正在读取 Agent 能力…"]}):re.length===0?l.jsx("div",{className:"composer-command-empty",children:j.kind==="skill"?"当前 Agent 没有匹配技能":"当前 Agent 没有匹配子 Agent"}):l.jsx("div",{className:"composer-command-list",children:re.map((te,de)=>l.jsxs("button",{type:"button",role:"option","aria-selected":de===L,className:`composer-command-item${de===L?" is-active":""}`,onMouseDown:Ee=>{Ee.preventDefault(),ne(te)},onMouseEnter:()=>R(de),children:[l.jsx("span",{className:`composer-command-icon composer-command-icon--${te.kind}`,children:te.kind==="skill"?l.jsx(Po,{}):l.jsx(Do,{})}),l.jsxs("span",{className:"composer-command-copy",children:[l.jsxs("strong",{children:[te.kind==="skill"?"/":"@",te.value.name]}),l.jsx("span",{children:te.value.description||(te.kind==="skill"?"加载并执行该技能":"将本轮交给该 Agent")})]}),l.jsx("kbd",{children:de===L?"↵":te.kind==="skill"?"技能":"Agent"})]},`${te.kind}-${te.value.name}`))})]}):null,W?null:l.jsxs("div",{className:"composer-menu-wrap",children:[l.jsx("button",{type:"button",className:"comp-icon",title:"添加","aria-label":"添加",disabled:o||!y,onClick:()=>{T(null),M(te=>!te)},children:l.jsx(rr,{className:"icon"})}),X&&l.jsxs(l.Fragment,{children:[l.jsx("div",{className:"menu-scrim",onClick:()=>M(!1)}),l.jsxs("div",{className:"composer-menu",role:"menu",children:[l.jsxs("button",{type:"button",className:"menu-item",onClick:()=>ue(O),children:[l.jsx(TL,{className:"icon"}),"上传图片"]}),l.jsxs("button",{type:"button",className:"menu-item",onClick:()=>ue(D),children:[l.jsx(kL,{className:"icon"}),"上传文档或 PDF"]}),l.jsxs("button",{type:"button",className:"menu-item",onClick:()=>ue(U),children:[l.jsx(NL,{className:"icon"}),"上传视频"]})]})]})]}),k&&N?l.jsx(ope,{value:b,onChange:N,disabled:c,temporaryEnabled:C,skillCreateEnabled:S}):null,l.jsx("div",{className:"composer-input-stack",children:l.jsx("textarea",{ref:A,className:"comp-input scroll",rows:_?4:1,value:s,disabled:o,placeholder:W?`描述你想创建的 Skill,将使用 ${Wv.join(" 和 ")} 并行创建…`:o?"请在页面左上角选择智能体":`向 ${r} 发消息…`,"aria-expanded":!!j,onChange:te=>{i(te.target.value),W||le(te.target.value,te.target.selectionStart)},onSelect:te=>{W||le(te.currentTarget.value,te.currentTarget.selectionStart)},onBlur:()=>setTimeout(()=>T(null),0),onKeyDown:te=>{if(!W4(te.nativeEvent)){if(j){if(te.key==="ArrowDown"&&re.length>0){te.preventDefault(),R(de=>(de+1)%re.length);return}if(te.key==="ArrowUp"&&re.length>0){te.preventDefault(),R(de=>(de-1+re.length)%re.length);return}if((te.key==="Enter"||te.key==="Tab")&&re[L]){te.preventDefault(),ne(re[L]);return}if(te.key==="Escape"){te.preventDefault(),T(null);return}}if(te.key==="Backspace"&&!s&&te.currentTarget.selectionStart===0&&te.currentTarget.selectionEnd===0){me();return}te.key==="Enter"&&!te.shiftKey&&(te.preventDefault(),ie&&a())}}})}),l.jsx($t.button,{type:"button",className:"comp-send",disabled:!ie,onClick:a,"aria-label":"发送",whileTap:ie?{scale:.9}:void 0,transition:{type:"spring",stiffness:600,damping:22},children:c?l.jsx(Rt,{className:"icon spin"}):l.jsx(EL,{className:"icon"})})]}),_&&b==="agent"&&!s.trim()?l.jsx("div",{className:"prompt-suggestions","aria-label":"快捷提示",children:dpe.map(te=>{const de=te.icon;return l.jsxs("button",{type:"button",className:"prompt-suggestion",disabled:o||c,onClick:()=>ee(te.text),children:[l.jsx(de,{}),l.jsx("span",{children:te.text})]},te.text)})}):null,u&&l.jsxs("div",{className:"composer-meta",children:[l.jsxs("span",{className:"composer-session-line",children:["会话 ID:",l.jsx("span",{className:"composer-session-id",title:e||void 0,"aria-live":"polite",children:t?"初始化中":e||"—"}),e&&l.jsx("button",{type:"button",className:"composer-session-copy",title:F?"已复制":"复制会话 ID","aria-label":F?"已复制会话 ID":"复制会话 ID",onClick:()=>void V(),children:F?l.jsx(Js,{}):l.jsx(Aw,{})})]}),l.jsx("span",{className:"composer-meta-separator","aria-hidden":!0,children:"|"}),l.jsx("span",{children:"回答仅供参考"})]}),l.jsx("input",{ref:O,type:"file",accept:"image/*",multiple:!0,hidden:!0,onChange:ye}),l.jsx("input",{ref:D,type:"file",accept:".txt,.md,.markdown,.pdf,text/plain,text/markdown,application/pdf",multiple:!0,hidden:!0,onChange:ye}),l.jsx("input",{ref:U,type:"file",accept:"video/mp4,video/webm,video/quicktime",multiple:!0,hidden:!0,onChange:ye})]})}function G4({title:e,sub:t,cards:n,footer:r}){return l.jsxs("div",{className:"stk",children:[l.jsxs("div",{className:"stk-head",children:[l.jsx("h1",{className:"stk-title",children:e}),t&&l.jsx("p",{className:"stk-sub",children:t})]}),l.jsx("div",{className:"stk-list",children:n.map((s,i)=>l.jsxs($t.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:[l.jsx("span",{className:"stk-card-icon",children:l.jsx(s.icon,{})}),l.jsxs("span",{className:"stk-card-text",children:[l.jsx("span",{className:"stk-card-title",children:s.title}),l.jsx("span",{className:"stk-card-desc",children:s.desc})]}),l.jsx(ws,{className:"stk-card-arrow"})]},s.key))}),r&&l.jsx("div",{className:"stk-footer",children:r})]})}const Gv=Symbol.for("yaml.alias"),$E=Symbol.for("yaml.document"),Da=Symbol.for("yaml.map"),q4=Symbol.for("yaml.pair"),vi=Symbol.for("yaml.scalar"),eu=Symbol.for("yaml.seq"),Ts=Symbol.for("yaml.node.type"),tu=e=>!!e&&typeof e=="object"&&e[Ts]===Gv,Hf=e=>!!e&&typeof e=="object"&&e[Ts]===$E,zf=e=>!!e&&typeof e=="object"&&e[Ts]===Da,Nn=e=>!!e&&typeof e=="object"&&e[Ts]===q4,zt=e=>!!e&&typeof e=="object"&&e[Ts]===vi,Vf=e=>!!e&&typeof e=="object"&&e[Ts]===eu;function _n(e){if(e&&typeof e=="object")switch(e[Ts]){case Da:case eu:return!0}return!1}function kn(e){if(e&&typeof e=="object")switch(e[Ts]){case Gv:case Da:case vi:case eu:return!0}return!1}const X4=e=>(zt(e)||_n(e))&&!!e.anchor,co=Symbol("break visit"),hpe=Symbol("skip children"),Ed=Symbol("remove node");function nu(e,t){const n=ppe(t);Hf(e)?Kl(null,e.contents,n,Object.freeze([e]))===Ed&&(e.contents=null):Kl(null,e,n,Object.freeze([]))}nu.BREAK=co;nu.SKIP=hpe;nu.REMOVE=Ed;function Kl(e,t,n,r){const s=mpe(e,t,n,r);if(kn(s)||Nn(s))return gpe(e,r,s),Kl(e,s,n,r);if(typeof s!="symbol"){if(_n(t)){r=Object.freeze(r.concat(t));for(let i=0;ie.replace(/[!,[\]{}]/g,t=>ype[t]);class kr{constructor(t,n){this.docStart=null,this.docEnd=!1,this.yaml=Object.assign({},kr.defaultYaml,t),this.tags=Object.assign({},kr.defaultTags,n)}clone(){const t=new kr(this.yaml,this.tags);return t.docStart=this.docStart,t}atDocument(){const t=new kr(this.yaml,this.tags);switch(this.yaml.version){case"1.1":this.atNextDocument=!0;break;case"1.2":this.atNextDocument=!1,this.yaml={explicit:kr.defaultYaml.explicit,version:"1.2"},this.tags=Object.assign({},kr.defaultTags);break}return t}add(t,n){this.atNextDocument&&(this.yaml={explicit:kr.defaultYaml.explicit,version:"1.1"},this.tags=Object.assign({},kr.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+bpe(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&&kn(t.contents)){const i={};nu(t.contents,(a,o)=>{kn(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(` -`)}}kr.defaultYaml={explicit:!1,version:"1.2"};kr.defaultTags={"!!":"tag:yaml.org,2002:"};function Q4(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 Z4(e){const t=new Set;return nu(e,{Value(n,r){r.anchor&&t.add(r.anchor)}}),t}function J4(e,t){for(let n=1;;++n){const r=`${e}${n}`;if(!t.has(r))return r}}function Epe(e,t){const n=[],r=new Map;let s=null;return{onAnchor:i=>{n.push(i),s??(s=Z4(e));const a=J4(t,s);return s.add(a),a},setAnchors:()=>{for(const i of n){const a=r.get(i);if(typeof a=="object"&&a.anchor&&(zt(a.node)||_n(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 Yl(e,t,n,r){if(r&&typeof r=="object")if(Array.isArray(r))for(let s=0,i=r.length;s_s(r,String(s),n));if(e&&typeof e.toJSON=="function"){if(!n||!X4(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 qv{constructor(t){Object.defineProperty(this,Ts,{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(!Hf(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=_s(this,"",a);if(typeof s=="function")for(const{count:c,res:u}of a.anchors.values())s(u,c);return typeof i=="function"?Yl(i,{"":o},"",o):o}}class Xv extends qv{constructor(t){super(Gv),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=[],nu(t,{Node:(i,a)=>{(tu(a)||X4(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 c=`Unresolved alias (the anchor must be set before the alias): ${this.source}`;throw new ReferenceError(c)}let o=r.get(a);if(o||(_s(a,null,n),o=r.get(a)),(o==null?void 0:o.res)===void 0){const c="This should not happen: Alias anchor was not resolved?";throw new ReferenceError(c)}if(i>=0&&(o.count+=1,o.aliasCount===0&&(o.aliasCount=Pp(s,a,r)),o.count*o.aliasCount>i)){const c="Excessive alias count indicates a resource exhaustion attack";throw new ReferenceError(c)}return o.res}toString(t,n,r){const s=`*${this.source}`;if(t){if(Q4(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 Pp(e,t,n){if(tu(t)){const r=t.resolve(e),s=n&&r&&n.get(r);return s?s.count*s.aliasCount:0}else if(_n(t)){let r=0;for(const s of t.items){const i=Pp(e,s,n);i>r&&(r=i)}return r}else if(Nn(t)){const r=Pp(e,t.key,n),s=Pp(e,t.value,n);return Math.max(r,s)}return 1}const e6=e=>!e||typeof e!="function"&&typeof e!="object";class at extends qv{constructor(t){super(vi),this.value=t}toJSON(t,n){return n!=null&&n.keep?this.value:_s(this.value,t,n)}toString(){return String(this.value)}}at.BLOCK_FOLDED="BLOCK_FOLDED";at.BLOCK_LITERAL="BLOCK_LITERAL";at.PLAIN="PLAIN";at.QUOTE_DOUBLE="QUOTE_DOUBLE";at.QUOTE_SINGLE="QUOTE_SINGLE";const xpe="tag:yaml.org,2002:";function wpe(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 ff(e,t,n){var f,h,p;if(Hf(e)&&(e=e.contents),kn(e))return e;if(Nn(e)){const m=(h=(f=n.schema[Da]).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 c;if(r&&e&&typeof e=="object"){if(c=o.get(e),c)return c.anchor??(c.anchor=s(e)),new Xv(c.anchor);c={anchor:null,node:null},o.set(e,c)}t!=null&&t.startsWith("!!")&&(t=xpe+t.slice(2));let u=wpe(e,t,a.tags);if(!u){if(e&&typeof e.toJSON=="function"&&(e=e.toJSON()),!e||typeof e!="object"){const m=new at(e);return c&&(c.node=m),m}u=e instanceof Map?a[Da]:Symbol.iterator in Object(e)?a[eu]:a[Da]}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 at(e);return t?d.tag=t:u.default||(d.tag=u.tag),c&&(c.node=d),d}function Qm(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 ff(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 Vu=e=>e==null||typeof e=="object"&&!!e[Symbol.iterator]().next().done;class t6 extends qv{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=>kn(r)||Nn(r)?r.clone(t):r),this.range&&(n.range=this.range.slice()),n}addIn(t,n){if(Vu(t))this.add(n);else{const[r,...s]=t,i=this.get(r,!0);if(_n(i))i.addIn(s,n);else if(i===void 0&&this.schema)this.set(r,Qm(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(_n(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&&zt(i)?i.value:i:_n(i)?i.getIn(s,n):void 0}hasAllNullValues(t){return this.items.every(n=>{if(!Nn(n))return!1;const r=n.value;return r==null||t&&zt(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 _n(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(_n(i))i.setIn(s,n);else if(i===void 0&&this.schema)this.set(r,Qm(this.schema,s,n));else throw new Error(`Expected YAML collection at ${r}. Remaining path: ${s}`)}}}const vpe=e=>e.replace(/^(?!$)(?: $)?/gm,"#");function Vi(e,t){return/^\n+$/.test(e)?e.substring(1):t?e.replace(/^(?! *$)/gm,t):e}const wo=(e,t,n)=>e.endsWith(` -`)?Vi(n,t):n.includes(` -`)?` -`+Vi(n,t):(e.endsWith(" ")?"":" ")+n,n6="flow",HE="block",Bp="quoted";function c0(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,E=-1,g=-1;n===HE&&(y=DA(e,y,t.length),y!==-1&&(f=y+c));for(let b;b=e[y+=1];){if(n===Bp&&b==="\\"){switch(E=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===HE&&(y=DA(e,y,t.length)),f=y+t.length+c,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+c,h=void 0;else if(n===Bp){for(;p===" "||p===" ";)p=b,b=e[y+=1],m=!0;const _=y>g+1?y-2:E-1;if(d[_])return e;u.push(_),d[_]=!0,f=_+c,h=void 0}else m=!0}p=b}if(m&&o&&o(),u.length===0)return e;a&&a();let x=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}),d0=e=>/^(%|---|\.\.\.)/m.test(e);function _pe(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 xd(e,t){const n=JSON.stringify(e);if(t.options.doubleQuotedAsJSON)return n;const{implicitKey:r}=t,s=t.options.doubleQuotedMinMultiLineLength,i=t.indent||(d0(e)?" ":"");let a="",o=0;for(let c=0,u=n[c];u;u=n[++c])if(u===" "&&n[c+1]==="\\"&&n[c+2]==="n"&&(a+=n.slice(o,c)+"\\ ",c+=1,o=c,u="\\"),u==="\\")switch(n[c+1]){case"u":{a+=n.slice(o,c);const d=n.substr(c+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(c,6)}c+=5,o=c+1}break;case"n":if(r||n[c+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(` -`);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(VE,`$&${u}`));let y=!1,E,g=-1;for(E=0;E{N=!0});const S=c0(`${x}${k}${p}`,u,HE,C);if(!N)return`>${_} -${u}${S}`}return n=n.replace(/\n+/g,`$&${u}`),`|${_} -${u}${x}${n}${p}`}function kpe(e,t,n,r){const{type:s,value:i}=e,{actualString:a,implicitKey:o,indent:c,indentStep:u,inFlow:d}=t;if(o&&i.includes(` -`)||d&&/[[\]{},]/.test(i))return Wl(i,t);if(/^[\n\t ,[\]{}#&*!|>'"%@`]|^[?-]$|^[?-][ \t]|[\n:][ \t]|[ \t]\n|[\n\t ]#|[\n\t :]$/.test(i))return o||d||!i.includes(` -`)?Wl(i,t):Fp(e,t,n,r);if(!o&&!d&&s!==at.PLAIN&&i.includes(` -`))return Fp(e,t,n,r);if(d0(i)){if(c==="")return t.forceBlockIndent=!0,Fp(e,t,n,r);if(o&&c===u)return Wl(i,t)}const f=i.replace(/\n+/g,`$& -${c}`);if(a){const h=y=>{var E;return y.default&&y.tag!=="tag:yaml.org,2002:str"&&((E=y.test)==null?void 0:E.test(f))},{compat:p,tags:m}=t.doc.schema;if(m.some(h)||p!=null&&p.some(h))return Wl(i,t)}return o?f:c0(f,c,n6,u0(t,!1))}function Qv(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!==at.QUOTE_DOUBLE&&/[\x00-\x08\x0b-\x1f\x7f-\x9f\u{D800}-\u{DFFF}]/u.test(a.value)&&(o=at.QUOTE_DOUBLE);const c=d=>{switch(d){case at.BLOCK_FOLDED:case at.BLOCK_LITERAL:return s||i?Wl(a.value,t):Fp(a,t,n,r);case at.QUOTE_DOUBLE:return xd(a.value,t);case at.QUOTE_SINGLE:return zE(a.value,t);case at.PLAIN:return kpe(a,t,n,r);default:return null}};let u=c(o);if(u===null){const{defaultKeyType:d,defaultStringType:f}=t.options,h=s&&d||f;if(u=c(h),u===null)throw new Error(`Unsupported default string type ${h}`)}return u}function r6(e,t){const n=Object.assign({blockQuote:!0,commentString:vpe,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 Npe(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(zt(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 Spe(e,t,{anchors:n,doc:r}){if(!r.directives)return"";const s=[],i=(zt(e)||_n(e))&&e.anchor;i&&Q4(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 Bc(e,t,n,r){var c;if(Nn(e))return e.toString(t,n,r);if(tu(e)){if(t.doc.directives)return e.toString(t);if((c=t.resolvedAliases)!=null&&c.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=kn(e)?e:t.doc.createNode(e,{onTagObj:u=>s=u});s??(s=Npe(t.doc.schema.tags,i));const a=Spe(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):zt(i)?Qv(i,t,n,r):i.toString(t,n,r);return a?zt(i)||o[0]==="{"||o[0]==="["?`${a} ${o}`:`${a} -${t.indent}${o}`:o}function Tpe({key:e,value:t},n,r,s){const{allNullValues:i,doc:a,indent:o,indentStep:c,options:{commentString:u,indentSeq:d,simpleKeys:f}}=n;let h=kn(e)&&e.comment||null;if(f){if(h)throw new Error("With simple keys, key nodes cannot have comments");if(_n(e)||!kn(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||_n(e)||(zt(e)?e.type===at.BLOCK_FOLDED||e.type===at.BLOCK_LITERAL:typeof e=="object"));n=Object.assign({},n,{allNullValues:!1,implicitKey:!p&&(f||!i),indent:o+c});let m=!1,y=!1,E=Bc(e,n,()=>m=!0,()=>y=!0);if(!p&&!n.inFlow&&E.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(),E===""?"?":p?`? ${E}`:E}else if(i&&!f||t==null&&p)return E=`? ${E}`,h&&!m?E+=wo(E,n.indent,u(h)):y&&s&&s(),E;m&&(h=null),p?(h&&(E+=wo(E,n.indent,u(h))),E=`? ${E} -${o}:`):(E=`${E}:`,h&&(E+=wo(E,n.indent,u(h))));let g,x,b;kn(t)?(g=!!t.spaceBefore,x=t.commentBefore,b=t.comment):(g=!1,x=null,b=null,t&&typeof t=="object"&&(t=a.createNode(t))),n.implicitKey=!1,!p&&!h&&zt(t)&&(n.indentAtStart=E.length+1),y=!1,!d&&c.length>=2&&!n.inFlow&&!p&&Vf(t)&&!t.flow&&!t.tag&&!t.anchor&&(n.indent=n.indent.substring(2));let _=!1;const k=Bc(t,n,()=>_=!0,()=>y=!0);let N=" ";if(h||g||x){if(N=g?` -`:"",x){const C=u(x);N+=` -${Vi(C,n.indent)}`}k===""&&!n.inFlow?N===` -`&&b&&(N=` - -`):N+=` -${n.indent}`}else if(!p&&_n(t)){const C=k[0],S=k.indexOf(` -`),A=S!==-1,O=n.inFlow??t.flow??t.items.length===0;if(A||!O){let D=!1;if(A&&(C==="&"||C==="!")){let U=k.indexOf(" ");C==="&"&&U!==-1&&Ue===Jh||typeof e=="symbol"&&e.description===Jh,default:"key",tag:"tag:yaml.org,2002:merge",test:/^<<$/,resolve:()=>Object.assign(new at(Symbol(Jh)),{addToJSMap:i6}),stringify:()=>Jh},Ape=(e,t)=>(Gi.identify(t)||zt(t)&&(!t.type||t.type===at.PLAIN)&&Gi.identify(t.value))&&(e==null?void 0:e.doc.schema.tags.some(n=>n.tag===Gi.tag&&n.default));function i6(e,t,n){const r=a6(e,n);if(Vf(r))for(const s of r.items)rb(e,t,s);else if(Array.isArray(r))for(const s of r)rb(e,t,s);else rb(e,t,r)}function rb(e,t,n){const r=a6(e,n);if(!zf(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 a6(e,t){return e&&tu(t)?t.resolve(e.doc,e):t}function o6(e,t,{key:n,value:r}){if(kn(n)&&n.addToJSMap)n.addToJSMap(e,t,r);else if(Ape(e,n))i6(e,t,r);else{const s=_s(n,"",e);if(t instanceof Map)t.set(s,_s(r,s,e));else if(t instanceof Set)t.add(s);else{const i=Cpe(n,s,e),a=_s(r,i,e);i in t?Object.defineProperty(t,i,{value:a,writable:!0,enumerable:!0,configurable:!0}):t[i]=a}}return t}function Cpe(e,t,n){if(t===null)return"";if(typeof t!="object")return String(t);if(kn(e)&&(n!=null&&n.doc)){const r=r6(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)+'..."'),s6(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 Zv(e,t,n){const r=ff(e,void 0,n),s=ff(t,void 0,n);return new Ar(r,s)}class Ar{constructor(t,n=null){Object.defineProperty(this,Ts,{value:q4}),this.key=t,this.value=n}clone(t){let{key:n,value:r}=this;return kn(n)&&(n=n.clone(t)),kn(r)&&(r=r.clone(t)),new Ar(n,r)}toJSON(t,n){const r=n!=null&&n.mapAsMap?new Map:{};return o6(n,r,this)}toString(t,n,r){return t!=null&&t.doc?Tpe(this,t,n,r):JSON.stringify(this)}}function l6(e,t,n){return(t.inFlow??e.flow?Ope:Ipe)(e,t,n)}function Ipe({comment:e,items:t},n,{blockItemPrefix:r,flowChars:s,itemIndent:i,onChompKeep:a,onComment:o}){const{indent:c,options:{commentString:u}}=n,d=Object.assign({},n,{indent:i,type:null});let f=!1;const h=[];for(let m=0;mE=null,()=>f=!0);E&&(g+=wo(g,i,u(E))),f&&E&&(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=null);u||(u=f.length>d||g.includes(` -`)),m0&&(u||(u=f.reduce((x,b)=>x+b.length+2,2)+(g.length+2)>t.options.lineWidth)),u&&(g+=",")),E&&(g+=wo(g,r,o(E))),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,E)=>y+E.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 Zm({indent:e,options:{commentString:t}},n,r,s){if(r&&s&&(r=r.replace(/^\n+/,"")),r){const i=Vi(t(r),e);n.push(i.trimStart())}}function vo(e,t){const n=zt(t)?t.value:t;for(const r of e)if(Nn(r)&&(r.key===t||r.key===n||zt(r.key)&&r.key.value===n))return r}class Es extends t6{static get tagName(){return"tag:yaml.org,2002:map"}constructor(t){super(Da,t),this.items=[]}static from(t,n,r){const{keepUndefined:s,replacer:i}=r,a=new this(t),o=(c,u)=>{if(typeof i=="function")u=i.call(n,c,u);else if(Array.isArray(i)&&!i.includes(c))return;(u!==void 0||s)&&a.items.push(Zv(c,u,r))};if(n instanceof Map)for(const[c,u]of n)o(c,u);else if(n&&typeof n=="object")for(const c of Object.keys(n))o(c,n[c]);return typeof t.sortMapEntries=="function"&&a.items.sort(t.sortMapEntries),a}add(t,n){var a;let r;Nn(t)?r=t:!t||typeof t!="object"||!("key"in t)?r=new Ar(t,t==null?void 0:t.value):r=new Ar(t.key,t.value);const s=vo(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`);zt(s.value)&&e6(r.value)?s.value.value=r.value:s.value=r.value}else if(i){const o=this.items.findIndex(c=>i(r,c)<0);o===-1?this.items.push(r):this.items.splice(o,0,r)}else this.items.push(r)}delete(t){const n=vo(this.items,t);return n?this.items.splice(this.items.indexOf(n),1).length>0:!1}get(t,n){const r=vo(this.items,t),s=r==null?void 0:r.value;return(!n&&zt(s)?s.value:s)??void 0}has(t){return!!vo(this.items,t)}set(t,n){this.add(new Ar(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)o6(n,s,i);return s}toString(t,n,r){if(!t)return JSON.stringify(this);for(const s of this.items)if(!Nn(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})),l6(this,t,{blockItemPrefix:"",flowChars:{start:"{",end:"}"},itemIndent:t.indent||"",onChompKeep:r,onComment:n})}}const ru={collection:"map",default:!0,nodeClass:Es,tag:"tag:yaml.org,2002:map",resolve(e,t){return zf(e)||t("Expected a mapping for this tag"),e},createNode:(e,t,n)=>Es.from(e,t,n)};class Ko extends t6{static get tagName(){return"tag:yaml.org,2002:seq"}constructor(t){super(eu,t),this.items=[]}add(t){this.items.push(t)}delete(t){const n=ep(t);return typeof n!="number"?!1:this.items.splice(n,1).length>0}get(t,n){const r=ep(t);if(typeof r!="number")return;const s=this.items[r];return!n&&zt(s)?s.value:s}has(t){const n=ep(t);return typeof n=="number"&&n=0?t:null}const su={collection:"seq",default:!0,nodeClass:Ko,tag:"tag:yaml.org,2002:seq",resolve(e,t){return Vf(e)||t("Expected a sequence for this tag"),e},createNode:(e,t,n)=>Ko.from(e,t,n)},f0={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),Qv(e,t,n,r)}},h0={identify:e=>e==null,createNode:()=>new at(null),default:!0,tag:"tag:yaml.org,2002:null",test:/^(?:~|[Nn]ull|NULL)?$/,resolve:()=>new at(null),stringify:({source:e},t)=>typeof e=="string"&&h0.test.test(e)?e:t.options.nullStr},Jv={identify:e=>typeof e=="boolean",default:!0,tag:"tag:yaml.org,2002:bool",test:/^(?:[Tt]rue|TRUE|[Ff]alse|FALSE)$/,resolve:e=>new at(e[0]==="t"||e[0]==="T"),stringify({source:e,value:t},n){if(e&&Jv.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 ni({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 c6={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:ni},u6={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():ni(e)}},d6={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 at(parseFloat(e)),n=e.indexOf(".");return n!==-1&&e[e.length-1]==="0"&&(t.minFractionDigits=e.length-n-1),t},stringify:ni},p0=e=>typeof e=="bigint"||Number.isInteger(e),e_=(e,t,n,{intAsBigInt:r})=>r?BigInt(e):parseInt(e.substring(t),n);function f6(e,t,n){const{value:r}=e;return p0(r)&&r>=0?n+r.toString(t):ni(e)}const h6={identify:e=>p0(e)&&e>=0,default:!0,tag:"tag:yaml.org,2002:int",format:"OCT",test:/^0o[0-7]+$/,resolve:(e,t,n)=>e_(e,2,8,n),stringify:e=>f6(e,8,"0o")},p6={identify:p0,default:!0,tag:"tag:yaml.org,2002:int",test:/^[-+]?[0-9]+$/,resolve:(e,t,n)=>e_(e,0,10,n),stringify:ni},m6={identify:e=>p0(e)&&e>=0,default:!0,tag:"tag:yaml.org,2002:int",format:"HEX",test:/^0x[0-9a-fA-F]+$/,resolve:(e,t,n)=>e_(e,2,16,n),stringify:e=>f6(e,16,"0x")},Rpe=[ru,su,f0,h0,Jv,h6,p6,m6,c6,u6,d6];function PA(e){return typeof e=="bigint"||Number.isInteger(e)}const tp=({value:e})=>JSON.stringify(e),Lpe=[{identify:e=>typeof e=="string",default:!0,tag:"tag:yaml.org,2002:str",resolve:e=>e,stringify:tp},{identify:e=>e==null,createNode:()=>new at(null),default:!0,tag:"tag:yaml.org,2002:null",test:/^null$/,resolve:()=>null,stringify:tp},{identify:e=>typeof e=="boolean",default:!0,tag:"tag:yaml.org,2002:bool",test:/^true$|^false$/,resolve:e=>e==="true",stringify:tp},{identify:PA,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})=>PA(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:tp}],Mpe={default:!0,tag:"",test:/^/,resolve(e,t){return t(`Unresolved plain scalar ${JSON.stringify(e)}`),e}},jpe=[ru,su].concat(Lpe,Mpe),t_={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 Ar(new at(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]=Nn(r)?r:new Ar(r)}}else t("Expected a sequence for this tag");return e}function y6(e,t,n){const{replacer:r}=n,s=new Ko(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,c;if(Array.isArray(a))if(a.length===2)o=a[0],c=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],c=a[o];else throw new TypeError(`Expected tuple with one key, not ${u.length} keys`)}else o=a;s.items.push(Zv(o,c,n))}return s}const n_={collection:"seq",default:!1,tag:"tag:yaml.org,2002:pairs",resolve:g6,createNode:y6};class ic extends Ko{constructor(){super(),this.add=Es.prototype.add.bind(this),this.delete=Es.prototype.delete.bind(this),this.get=Es.prototype.get.bind(this),this.has=Es.prototype.has.bind(this),this.set=Es.prototype.set.bind(this),this.tag=ic.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(Nn(s)?(i=_s(s.key,"",n),a=_s(s.value,i,n)):i=_s(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=y6(t,n,r),i=new this;return i.items=s.items,i}}ic.tag="tag:yaml.org,2002:omap";const r_={collection:"seq",identify:e=>e instanceof Map,nodeClass:ic,default:!1,tag:"tag:yaml.org,2002:omap",resolve(e,t){const n=g6(e,t),r=[];for(const{key:s}of n.items)zt(s)&&(r.includes(s.value)?t(`Ordered maps must not include duplicate keys: ${s.value}`):r.push(s.value));return Object.assign(new ic,n)},createNode:(e,t,n)=>ic.from(e,t,n)};function b6({value:e,source:t},n){return t&&(e?E6:x6).test.test(t)?t:e?n.options.trueStr:n.options.falseStr}const E6={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 at(!0),stringify:b6},x6={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 at(!1),stringify:b6},Dpe={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:ni},Ppe={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():ni(e)}},Bpe={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 at(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:ni},Kf=e=>typeof e=="bigint"||Number.isInteger(e);function m0(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 s_(e,t,n){const{value:r}=e;if(Kf(r)){const s=r.toString(t);return r<0?"-"+n+s.substr(1):n+s}return ni(e)}const Fpe={identify:Kf,default:!0,tag:"tag:yaml.org,2002:int",format:"BIN",test:/^[-+]?0b[0-1_]+$/,resolve:(e,t,n)=>m0(e,2,2,n),stringify:e=>s_(e,2,"0b")},Upe={identify:Kf,default:!0,tag:"tag:yaml.org,2002:int",format:"OCT",test:/^[-+]?0[0-7_]+$/,resolve:(e,t,n)=>m0(e,1,8,n),stringify:e=>s_(e,8,"0")},$pe={identify:Kf,default:!0,tag:"tag:yaml.org,2002:int",test:/^[-+]?[0-9][0-9_]*$/,resolve:(e,t,n)=>m0(e,0,10,n),stringify:ni},Hpe={identify:Kf,default:!0,tag:"tag:yaml.org,2002:int",format:"HEX",test:/^[-+]?0x[0-9a-fA-F_]+$/,resolve:(e,t,n)=>m0(e,2,16,n),stringify:e=>s_(e,16,"0x")};class ac extends Es{constructor(t){super(t),this.tag=ac.tag}add(t){let n;Nn(t)?n=t:t&&typeof t=="object"&&"key"in t&&"value"in t&&t.value===null?n=new Ar(t.key,null):n=new Ar(t,null),vo(this.items,n.key)||this.items.push(n)}get(t,n){const r=vo(this.items,t);return!n&&Nn(r)?zt(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=vo(this.items,t);r&&!n?this.items.splice(this.items.indexOf(r),1):!r&&n&&this.items.push(new Ar(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(Zv(a,null,r));return i}}ac.tag="tag:yaml.org,2002:set";const i_={collection:"map",identify:e=>e instanceof Set,nodeClass:ac,default:!1,tag:"tag:yaml.org,2002:set",createNode:(e,t,n)=>ac.from(e,t,n),resolve(e,t){if(zf(e)){if(e.hasAllNullValues(!0))return Object.assign(new ac,e);t("Set items must all have null values")}else t("Expected a mapping for this tag");return e}};function a_(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 w6(e){let{value:t}=e,n=a=>a;if(typeof t=="bigint")n=a=>BigInt(a);else if(isNaN(t)||!isFinite(t))return ni(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 v6={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})=>a_(e,n),stringify:w6},_6={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=>a_(e,!1),stringify:w6},g0={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(g0.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),c=t[7]?Number((t[7]+"00").substr(1,3)):0;let u=Date.UTC(n,r-1,s,i||0,a||0,o||0,c);const d=t[8];if(d&&d!=="Z"){let f=a_(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$/,""))??""},BA=[ru,su,f0,h0,E6,x6,Fpe,Upe,$pe,Hpe,Dpe,Ppe,Bpe,t_,Gi,r_,n_,i_,v6,_6,g0],FA=new Map([["core",Rpe],["failsafe",[ru,su,f0]],["json",jpe],["yaml11",BA],["yaml-1.1",BA]]),UA={binary:t_,bool:Jv,float:d6,floatExp:u6,floatNaN:c6,floatTime:_6,int:p6,intHex:m6,intOct:h6,intTime:v6,map:ru,merge:Gi,null:h0,omap:r_,pairs:n_,seq:su,set:i_,timestamp:g0},zpe={"tag:yaml.org,2002:binary":t_,"tag:yaml.org,2002:merge":Gi,"tag:yaml.org,2002:omap":r_,"tag:yaml.org,2002:pairs":n_,"tag:yaml.org,2002:set":i_,"tag:yaml.org,2002:timestamp":g0};function sb(e,t,n){const r=FA.get(t);if(r&&!e)return n&&!r.includes(Gi)?r.concat(Gi):r.slice();let s=r;if(!s)if(Array.isArray(e))s=[];else{const i=Array.from(FA.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(Gi)),s.reduce((i,a)=>{const o=typeof a=="string"?UA[a]:a;if(!o){const c=JSON.stringify(a),u=Object.keys(UA).map(d=>JSON.stringify(d)).join(", ");throw new Error(`Unknown custom tag ${c}; use one of ${u}`)}return i.includes(o)||i.push(o),i},[])}const Vpe=(e,t)=>e.keyt.key?1:0;class o_{constructor({compat:t,customTags:n,merge:r,resolveKnownTags:s,schema:i,sortMapEntries:a,toStringDefaults:o}){this.compat=Array.isArray(t)?sb(t,"compat"):t?sb(null,t):null,this.name=typeof i=="string"&&i||"core",this.knownTags=s?zpe:{},this.tags=sb(n,this.name,r),this.toStringOptions=o??null,Object.defineProperty(this,Da,{value:ru}),Object.defineProperty(this,vi,{value:f0}),Object.defineProperty(this,eu,{value:su}),this.sortMapEntries=typeof a=="function"?a:a===!0?Vpe:null}clone(){const t=Object.create(o_.prototype,Object.getOwnPropertyDescriptors(this));return t.tags=this.tags.slice(),t}}function Kpe(e,t){var c;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=r6(e,t),{commentString:i}=s.options;if(e.commentBefore){n.length!==1&&n.unshift("");const u=i(e.commentBefore);n.unshift(Vi(u,""))}let a=!1,o=null;if(e.contents){if(kn(e.contents)){if(e.contents.spaceBefore&&r&&n.push(""),e.contents.commentBefore){const f=i(e.contents.commentBefore);n.push(Vi(f,""))}s.forceBlockIndent=!!e.comment,o=e.contents.comment}const u=o?void 0:()=>a=!0;let d=Bc(e.contents,s,()=>o=null,u);o&&(d+=wo(d,"",i(o))),(d[0]==="|"||d[0]===">")&&n[n.length-1]==="---"?n[n.length-1]=`--- ${d}`:n.push(d)}else n.push(Bc(e.contents,s));if((c=e.directives)!=null&&c.docEnd)if(e.comment){const u=i(e.comment);u.includes(` -`)?(n.push("..."),n.push(Vi(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(Vi(i(u),"")))}return n.join(` -`)+` -`}class Yf{constructor(t,n,r){this.commentBefore=null,this.comment=null,this.errors=[],this.warnings=[],Object.defineProperty(this,Ts,{value:$E});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 kr({version:a}),this.setSchema(a,r),this.contents=t===void 0?null:this.createNode(t,s,r)}clone(){const t=Object.create(Yf.prototype,{[Ts]:{value:$E}});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=kn(this.contents)?this.contents.clone(t.schema):this.contents,this.range&&(t.range=this.range.slice()),t}add(t){pl(this.contents)&&this.contents.add(t)}addIn(t,n){pl(this.contents)&&this.contents.addIn(t,n)}createAlias(t,n){if(!t.anchor){const r=Z4(this);t.anchor=!n||r.has(n)?J4(n||"a",r):n}return new Xv(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 E=x=>typeof x=="number"||x instanceof String||x instanceof Number,g=n.filter(E).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:c,onTagObj:u,tag:d}=r??{},{onAnchor:f,setAnchors:h,sourceObjects:p}=Epe(this,a||"a"),m={aliasDuplicateObjects:i??!0,keepUndefined:c??!1,onAnchor:f,onTagObj:u,replacer:s,schema:this.schema,sourceObjects:p},y=ff(t,d,m);return o&&_n(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 Ar(s,i)}delete(t){return pl(this.contents)?this.contents.delete(t):!1}deleteIn(t){return Vu(t)?this.contents==null?!1:(this.contents=null,!0):pl(this.contents)?this.contents.deleteIn(t):!1}get(t,n){return _n(this.contents)?this.contents.get(t,n):void 0}getIn(t,n){return Vu(t)?!n&&zt(this.contents)?this.contents.value:this.contents:_n(this.contents)?this.contents.getIn(t,n):void 0}has(t){return _n(this.contents)?this.contents.has(t):!1}hasIn(t){return Vu(t)?this.contents!==void 0:_n(this.contents)?this.contents.hasIn(t):!1}set(t,n){this.contents==null?this.contents=Qm(this.schema,[t],n):pl(this.contents)&&this.contents.set(t,n)}setIn(t,n){Vu(t)?this.contents=n:this.contents==null?this.contents=Qm(this.schema,Array.from(t),n):pl(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 kr({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 kr({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 o_(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},c=_s(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"?Yl(a,{"":c},"",c):c}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 Kpe(this,t)}}function pl(e){if(_n(e))return!0;throw new Error("Expected a YAML collection as document contents")}class k6 extends Error{constructor(t,n,r,s){super(),this.name=t,this.code=r,this.message=s,this.pos=n}}class Ku extends k6{constructor(t,n,r){super("YAMLParseError",t,n,r)}}class Ype extends k6{constructor(t,n,r){super("YAMLWarning",t,n,r)}}const $A=(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 c=n.linePos[1];(c==null?void 0:c.line)===r&&c.col>s&&(o=Math.max(1,Math.min(c.col-s,80-i)));const u=" ".repeat(i)+"^".repeat(o);n.message+=`: - -${a} -${u} -`}};function Fc(e,{flow:t,indicator:n,next:r,offset:s,onError:i,parentIndent:a,startOnNewline:o}){let c=!1,u=o,d=o,f="",h="",p=!1,m=!1,y=null,E=null,g=null,x=null,b=null,_=null,k=null;for(const S of e)switch(m&&(S.type!=="space"&&S.type!=="newline"&&S.type!=="comma"&&i(S.offset,"MISSING_CHAR","Tags and anchors must be separated from the next token by white space"),m=!1),y&&(u&&S.type!=="comment"&&S.type!=="newline"&&i(y,"TAB_AS_INDENT","Tabs are not allowed as indentation"),y=null),S.type){case"space":!t&&(n!=="doc-start"||(r==null?void 0:r.type)!=="flow-collection")&&S.source.includes(" ")&&(y=S),d=!0;break;case"comment":{d||i(S,"MISSING_CHAR","Comments must be separated from other tokens by white space characters");const A=S.source.substring(1)||" ";f?f+=h+A:f=A,h="",u=!1;break}case"newline":u?f?f+=S.source:(!_||n!=="seq-item-ind")&&(c=!0):h+=S.source,u=!0,p=!0,(E||g)&&(x=S),d=!0;break;case"anchor":E&&i(S,"MULTIPLE_ANCHORS","A node can have at most one anchor"),S.source.endsWith(":")&&i(S.offset+S.source.length-1,"BAD_ALIAS","Anchor ending in : is ambiguous",!0),E=S,k??(k=S.offset),u=!1,d=!1,m=!0;break;case"tag":{g&&i(S,"MULTIPLE_TAGS","A node can have at most one tag"),g=S,k??(k=S.offset),u=!1,d=!1,m=!0;break}case n:(E||g)&&i(S,"BAD_PROP_ORDER",`Anchors and tags must be after the ${S.source} indicator`),_&&i(S,"UNEXPECTED_TOKEN",`Unexpected ${S.source} in ${t??"collection"}`),_=S,u=n==="seq-item-ind"||n==="explicit-key-ind",d=!1;break;case"comma":if(t){b&&i(S,"UNEXPECTED_TOKEN",`Unexpected , in ${t}`),b=S,u=!1,d=!1;break}default:i(S,"UNEXPECTED_TOKEN",`Unexpected ${S.type} token`),u=!1,d=!1}const N=e[e.length-1],C=N?N.offset+N.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:c,comment:f,hasNewline:p,anchor:E,tag:g,newlineAfterProp:x,end:C,start:k??C}}function hf(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(hf(t.key)||hf(t.value))return!0}return!1;default:return!0}}function KE(e,t,n){if((t==null?void 0:t.type)==="flow-collection"){const r=t.end[0];r.indent===e&&(r.source==="]"||r.source==="}")&&hf(t)&&n(r,"BAD_INDENT","Flow end indicator should be more indented than parent",!0)}}function N6(e,t,n){const{uniqueKeys:r}=e.options;if(r===!1)return!1;const s=typeof r=="function"?r:(i,a)=>i===a||zt(i)&&zt(a)&&i.value===a.value;return t.some(i=>s(i.key,n))}const HA="All mapping items must start at the same column";function Wpe({composeNode:e,composeEmptyNode:t},n,r,s,i){var d;const a=(i==null?void 0:i.nodeClass)??Es,o=new a(n.schema);n.atRoot&&(n.atRoot=!1);let c=r.offset,u=null;for(const f of r.items){const{start:h,key:p,sep:m,value:y}=f,E=Fc(h,{indicator:"explicit-key-ind",next:p??(m==null?void 0:m[0]),offset:c,onError:s,parentIndent:r.indent,startOnNewline:!0}),g=!E.found;if(g){if(p&&(p.type==="block-seq"?s(c,"BLOCK_AS_IMPLICIT_KEY","A block sequence may not be used as an implicit map key"):"indent"in p&&p.indent!==r.indent&&s(c,"BAD_INDENT",HA)),!E.anchor&&!E.tag&&!m){u=E.end,E.comment&&(o.comment?o.comment+=` -`+E.comment:o.comment=E.comment);continue}(E.newlineAfterProp||hf(p))&&s(p??h[h.length-1],"MULTILINE_IMPLICIT_KEY","Implicit keys need to be on a single line")}else((d=E.found)==null?void 0:d.indent)!==r.indent&&s(c,"BAD_INDENT",HA);n.atKey=!0;const x=E.end,b=p?e(n,p,E,s):t(n,x,h,null,E,s);n.schema.compat&&KE(r.indent,p,s),n.atKey=!1,N6(n,o.items,b)&&s(x,"DUPLICATE_KEY","Map keys must be unique");const _=Fc(m??[],{indicator:"map-value-ind",next:y,offset:b.range[2],onError:s,parentIndent:r.indent,startOnNewline:!p||p.type==="block-scalar"});if(c=_.end,_.found){g&&((y==null?void 0:y.type)==="block-map"&&!_.hasNewline&&s(c,"BLOCK_AS_IMPLICIT_KEY","Nested mappings are not allowed in compact mappings"),n.options.strict&&E.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,c,m,null,_,s);n.schema.compat&&KE(r.indent,y,s),c=k.range[2];const N=new Ar(b,k);n.options.keepSourceTokens&&(N.srcToken=f),o.items.push(N)}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 Ar(b);n.options.keepSourceTokens&&(k.srcToken=f),o.items.push(k)}}return u&&ue&&(e.type==="block-map"||e.type==="block-seq");function qpe({composeNode:e,composeEmptyNode:t},n,r,s,i){var E;const a=r.start.source==="{",o=a?"flow map":"flow sequence",c=(i==null?void 0:i.nodeClass)??(a?Es:Ko),u=new c(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=Wf(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 ob(e,t,n,r,s,i){const a=n.type==="block-map"?Wpe(e,t,n,r,i):n.type==="block-seq"?Gpe(e,t,n,r,i):qpe(e,t,n,r,i),o=a.constructor;return s==="!"||s===o.tagName?(a.tag=o.tagName,a):(s&&(a.tag=s),a)}function Xpe(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(!c){const p=t.schema.knownTags[a];if((p==null?void 0:p.collection)===o)t.schema.tags.push(Object.assign({},p,{default:!1})),c=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),ob(e,t,n,s,a)}const u=ob(e,t,n,s,a,c),d=((h=c.resolve)==null?void 0:h.call(c,u,p=>s(i,"TAG_RESOLVE_FAILED",p),t.options))??u,f=kn(d)?d:new at(d);return f.range=u.range,f.tag=a,c!=null&&c.format&&(f.format=c.format),f}function Qpe(e,t,n){const r=t.offset,s=Zpe(t,e.options.strict,n);if(!s)return{value:"",type:null,comment:"",range:[r,r,r]};const i=s.mode===">"?at.BLOCK_FOLDED:at.BLOCK_LITERAL,a=t.source?Jpe(t.source):[];let o=a.length;for(let y=a.length-1;y>=0;--y){const E=a[y][1];if(E===""||E==="\r")o=y;else break}if(o===0){const y=s.chomp==="+"&&a.length>0?` -`.repeat(Math.max(1,a.length-1)):"";let E=r+s.length;return t.source&&(E+=t.source.length),{value:y,type:i,comment:s.comment,range:[r,E,E]}}let c=t.indent+s.indent,u=t.offset+s.length,d=0;for(let y=0;yc&&(c=E.length);else{E.length=o;--y)a[y][0].length>c&&(o=y+1);let f="",h="",p=!1;for(let y=0;yc||g[0]===" "?(h===" "?h=` -`:!p&&h===` -`&&(h=` - -`),f+=h+E.slice(c)+g,h=` -`,p=!0):g===""?h===` -`?f+=` -`:h=` -`:(f+=h+g,h=" ",p=!1)}switch(s.chomp){case"-":break;case"+":for(let y=o;yn(r+h,p,m);switch(s){case"scalar":o=at.PLAIN,c=tme(i,u);break;case"single-quoted-scalar":o=at.QUOTE_SINGLE,c=nme(i,u);break;case"double-quoted-scalar":o=at.QUOTE_DOUBLE,c=rme(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=Wf(a,d,t,n);return{value:c,type:o,comment:f.comment,range:[r,d,f.offset]}}function tme(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}`),S6(e)}function nme(e,t){return(e[e.length-1]!=="'"||e.length===1)&&t(e.length,"MISSING_CHAR","Missing closing 'quote"),S6(e.slice(1,-1)).replace(/''/g,"'")}function S6(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 sme(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 ime={0:"\0",a:"\x07",b:"\b",e:"\x1B",f:"\f",n:` -`,r:"\r",t:" ",v:"\v",N:"…",_:" ",L:"\u2028",P:"\u2029"," ":" ",'"':'"',"/":"/","\\":"\\"," ":" "};function ame(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 T6(e,t,n,r){const{value:s,type:i,comment:a,range:o}=t.type==="block-scalar"?Qpe(e,t,r):eme(t,e.options.strict,r),c=n?e.directives.tagName(n.source,f=>r(n,"TAG_RESOLVE_FAILED",f)):null;let u;e.options.stringKeys&&e.atKey?u=e.schema[vi]:c?u=ome(e.schema,s,c,n,r):t.type==="scalar"?u=lme(e,s,t,r):u=e.schema[vi];let d;try{const f=u.resolve(s,h=>r(n??t,"TAG_RESOLVE_FAILED",h),e.options);d=zt(f)?f:new at(f)}catch(f){const h=f instanceof Error?f.message:String(f);r(n??t,"TAG_RESOLVE_FAILED",h),d=new at(s)}return d.range=o,d.source=s,i&&(d.type=i),c&&(d.tag=c),u.format&&(d.format=u.format),a&&(d.comment=a),d}function ome(e,t,n,r,s){var o;if(n==="!")return e[vi];const i=[];for(const c of e.tags)if(!c.collection&&c.tag===n)if(c.default&&c.test)i.push(c);else return c;for(const c of i)if((o=c.test)!=null&&o.test(t))return c;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[vi])}function lme({atKey:e,directives:t,schema:n},r,s,i){const a=n.tags.find(o=>{var c;return(o.default===!0||e&&o.default==="key")&&((c=o.test)==null?void 0:c.test(r))})||n[vi];if(n.compat){const o=n.compat.find(c=>{var u;return c.default&&((u=c.test)==null?void 0:u.test(r))})??n[vi];if(a.tag!==o.tag){const c=t.tagString(a.tag),u=t.tagString(o.tag),d=`Value may be parsed as either ${c} or ${u}`;i(s,"TAG_RESOLVE_FAILED",d,!0)}}return a}function cme(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 ume={composeNode:A6,composeEmptyNode:l_};function A6(e,t,n,r){const s=e.atKey,{spaceBefore:i,comment:a,anchor:o,tag:c}=n;let u,d=!0;switch(t.type){case"alias":u=dme(e,t,r),(o||c)&&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=T6(e,t,c,r),o&&(u.anchor=o.source.substring(1));break;case"block-map":case"block-seq":case"flow-collection":try{u=Xpe(ume,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=l_(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&&(!zt(u)||typeof u.value!="string"||u.tag&&u.tag!=="tag:yaml.org,2002:str")&&r(c??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 l_(e,t,n,r,{spaceBefore:s,comment:i,anchor:a,tag:o,end:c},u){const d={type:"scalar",offset:cme(t,n,r),indent:-1,source:""},f=T6(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]=c),f}function dme({options:e},{offset:t,source:n,end:r},s){const i=new Xv(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=Wf(r,a,e.strict,s);return i.range=[t,a,o.offset],o.comment&&(i.comment=o.comment),i}function fme(e,t,{offset:n,start:r,value:s,end:i},a){const o=Object.assign({_directives:t},e),c=new Yf(void 0,o),u={atKey:!1,atRoot:!0,directives:c.directives,options:c.options,schema:c.schema},d=Fc(r,{indicator:"doc-start",next:s??(i==null?void 0:i[0]),offset:n,onError:a,parentIndent:0,startOnNewline:!0});d.found&&(c.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")),c.contents=s?A6(u,s,d,a):l_(u,d.end,r,null,d,a);const f=c.contents.range[2],h=Wf(i,f,!1,a);return h.comment&&(c.comment=h.comment),c.range=[n,f,h.offset],c}function Au(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 zA(e){var s;let t="",n=!1,r=!1;for(let i=0;i{const a=Au(n);i?this.warnings.push(new Ype(a,r,s)):this.errors.push(new Ku(a,r,s))},this.directives=new kr({version:t.version||"1.2"}),this.options=t}decorate(t,n){const{comment:r,afterEmptyLine:s}=zA(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(_n(i)&&!i.flow&&i.items.length>0){let a=i.items[0];Nn(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=Au(t);i[0]+=n,this.onError(i,"BAD_DIRECTIVE",r,s)}),this.prelude.push(t.source),this.atDirectives=!0;break;case"document":{const n=fme(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 Ku(Au(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 Ku(Au(t),"UNEXPECTED_TOKEN",r));break}this.doc.directives.docEnd=!0;const n=Wf(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 Ku(Au(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 Yf(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 C6="\uFEFF",I6="",O6="",YE="";function pme(e){switch(e){case C6:return"byte-order-mark";case I6:return"doc-mode";case O6:return"flow-error-end";case YE: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 Ds(e){switch(e){case void 0:case" ":case` -`:case"\r":case" ":return!0;default:return!1}}const VA=new Set("0123456789ABCDEFabcdef"),mme=new Set("0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz-#;/?:@&=+$_.!~*'()"),np=new Set(",[]{}"),gme=new Set(` ,[]{} -\r `),lb=e=>!e||gme.has(e);class yme{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==="...")&&Ds(this.buffer[t+3]))return-1}return t}getLine(){let t=this.lineEndPos;return(typeof t!="number"||t!==-1&&tthis.indentValue&&!Ds(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===":")&&Ds(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(lb),"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=>Ds(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 YE,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(Ds(i)||t&&np.has(i))break;n=r}else if(Ds(s)){let i=this.buffer[r+1];if(s==="\r"&&(i===` -`?(r+=1,s=` -`,i=this.buffer[r+1]):n=r),i==="#"||t&&np.has(i))break;if(s===` -`){const a=this.continueScalar(r+1);if(a===-1)break;r=Math.max(r,a-2)}}else{if(t&&np.has(s))break;n=r}return!s&&!this.atEnd?this.setNext("plain-scalar"):(yield YE,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(lb),t+=yield*this.pushSpaces(!0);continue e;case"-":case"?":case":":{const n=this.flowLevel>0,r=this.charAt(1);if(Ds(r)||n&&np.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(;!Ds(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(mme.has(n))n=this.buffer[++t];else if(n==="%"&&VA.has(this.buffer[t+1])&&VA.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 bme{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 Jm(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"&&YA(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&&KA(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 c=0;ct.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(Ea(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(R6(n.key)&&!Ea(n.sep,"newline")){const o=ml(n.start),c=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:c,sep:u}]})}else a.length>0?n.sep=n.sep.concat(a,this.sourceToken):n.sep.push(this.sourceToken);else if(Ea(n.start,"newline"))Object.assign(n,{key:null,sep:[this.sourceToken]});else{const o=ml(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]}):Ea(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&&!Ea(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)){Jm(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||Ea(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=rp(r),i=ml(s);YA(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=rp(t),r=ml(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=rp(t),r=ml(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 xme(e){const t=e.prettyErrors!==!1;return{lineCounter:e.lineCounter||t&&new bme||null,prettyErrors:t}}function wme(e,t={}){const{lineCounter:n,prettyErrors:r}=xme(t),s=new Eme(n==null?void 0:n.addNewLine),i=new hme(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 Ku(o.range.slice(0,2),"MULTIPLE_DOCS","Source contains multiple documents; please use YAML.parseAllDocuments()"));break}return r&&n&&(a.errors.forEach($A(e,n)),a.warnings.forEach($A(e,n))),a}function vme(e,t,n){let r;const s=wme(e,n);if(!s)return null;if(s.warnings.forEach(i=>s6(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 _me(e,t,n){let r=null;if(Array.isArray(t)&&(r=t),e===void 0){const{keepUndefined:s}={};if(!s)return}return Hf(e)&&!r?e.toString(n):new Yf(e,r,n).toString(n)}const kme=new Set(["local","sqlite","mysql","postgresql"]),Nme=new Set(["local","opensearch","redis","viking","mem0"]),Sme=new Set(["opensearch","viking","context_search"]),Tme=new Set(["apmplus","cozeloop","tls"]),L6=new Set(["web_search","parallel_web_search","link_reader","web_scraper","image_generate","image_edit","video_generate","text_to_speech","run_code","vesearch"]),Ame=new Set(["llm","sequential","parallel","loop","a2a"]);function gt(e,t=""){return typeof e=="string"?e:t}function uo(e){return e===!0}function Up(e){return Array.isArray(e)?e.filter(t=>typeof t=="string"):[]}function M6(e){return Array.isArray(e)?e.map(t=>t&&typeof t=="object"?{name:gt(t.name),description:gt(t.description)}:null).filter(t=>!!t&&!!t.name.trim()):[]}function cb(e,t,n){return typeof e=="string"&&t.has(e)?e:n}function j6(e){return typeof e=="string"&&Ame.has(e)?e:"llm"}function D6(e){return typeof e=="number"&&Number.isFinite(e)&&e>0?Math.floor(e):3}function P6(e){const t=e&&typeof e=="object"?e:{};return{enabled:uo(t.enabled),registrySpaceId:gt(t.registrySpaceId),registryTopK:gt(t.registryTopK),registryRegion:gt(t.registryRegion),registryEndpoint:gt(t.registryEndpoint)}}function B6(e){return Array.isArray(e)?e.map(t=>{const n=t&&typeof t=="object"?t:{},r=P6(n.a2aRegistry),s=j6(n.agentType),i=r.enabled&&s==="llm"?"a2a":s;return{...Sr(),name:gt(n.name),description:gt(n.description),instruction:gt(n.instruction),agentType:i,maxIterations:D6(n.maxIterations),a2aUrl:gt(n.a2aUrl),builtinTools:Up(n.builtinTools).filter(a=>L6.has(a)),customTools:M6(n.customTools),a2aRegistry:i==="a2a"?{...r,enabled:!0}:r,subAgents:B6(n.subAgents)}}):[]}function Cme(e){if(!Array.isArray(e.selectedSkills))return[];const t=[];for(const n of e.selectedSkills){const r=n&&typeof n=="object"?n:{},s=gt(r.source),i=s==="local"||s==="skillspace"||s==="skillhub"?s:"skillhub",a=gt(r.name)||gt(r.slug)||gt(r.skillName)||gt(r.skillId)||"skill",o=gt(r.folder)||a,c=gt(r.description);if(i==="skillhub"){const f=gt(r.slug);if(!f)continue;t.push({source:i,folder:o,name:a,description:c,slug:f,namespace:gt(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=gt(m.path),E=gt(m.content);return y?{path:y,content:E}:null}).filter(p=>p!==null);if(h.length===0)continue;t.push({source:i,folder:o,name:a,description:c,localFiles:h});continue}const u=gt(r.skillSpaceId),d=gt(r.skillId);!u||!d||t.push({source:i,folder:o,name:a,description:c,skillSpaceId:u,skillSpaceName:gt(r.skillSpaceName),skillId:d,version:gt(r.version)})}return t}function F6(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=P6(t.a2aRegistry),i=j6(t.agentType),a=s.enabled&&i==="llm"?"a2a":i,o=Array.isArray(t.mcpTools)?t.mcpTools.map(c=>{const u=c&&typeof c=="object"?c:{},d=u.transport==="stdio"?"stdio":"http";return{name:gt(u.name),transport:d,url:gt(u.url),authToken:gt(u.authToken),command:gt(u.command),args:Up(u.args)}}).filter(c=>c.transport==="http"?!!c.url:!!c.command):[];return{...Sr(),name:gt(t.name)||"my_agent",description:gt(t.description),instruction:gt(t.instruction)||"You are a helpful assistant.",agentType:a,maxIterations:D6(t.maxIterations),a2aUrl:gt(t.a2aUrl),modelName:gt(t.modelName),modelProvider:gt(t.modelProvider),modelApiBase:gt(t.modelApiBase),builtinTools:Up(t.builtinTools).filter(c=>L6.has(c)),customTools:M6(t.customTools),mcpTools:o,a2aRegistry:a==="a2a"?{...s,enabled:!0}:s,memory:{shortTerm:uo(n.shortTerm),longTerm:uo(n.longTerm)},shortTermBackend:cb(t.shortTermBackend,kme,"local"),longTermBackend:cb(t.longTermBackend,Nme,"local"),autoSaveSession:uo(t.autoSaveSession),knowledgebase:uo(t.knowledgebase),knowledgebaseBackend:cb(t.knowledgebaseBackend,Sme,Gd),knowledgebaseIndex:gt(t.knowledgebaseIndex),tracing:uo(t.tracing),tracingExporters:Up(t.tracingExporters).filter(c=>Tme.has(c)),deployment:{feishuEnabled:uo(r.feishuEnabled)},subAgents:B6(t.subAgents),selectedSkills:Cme(t)}}function U6(e){var n,r,s,i,a,o,c,u,d,f,h,p,m,y,E,g,x,b;const t={agentType:e.agentType??"llm"};if(e.agentType==="a2a"){if((n=e.a2aRegistry)!=null&&n.enabled){const _={enabled:!0};(r=e.a2aRegistry.registrySpaceId)!=null&&r.trim()&&(_.registrySpaceId=e.a2aRegistry.registrySpaceId.trim()),_.registryTopK=((s=e.a2aRegistry.registryTopK)==null?void 0:s.trim())||qs.topK,_.registryRegion=((i=e.a2aRegistry.registryRegion)==null?void 0:i.trim())||qs.region,_.registryEndpoint=((a=e.a2aRegistry.registryEndpoint)==null?void 0:a.trim())||qs.endpoint,t.a2aRegistry=_}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()),(c=e.modelProvider)!=null&&c.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(_=>({name:_.name,description:_.description}))),(h=e.mcpTools)!=null&&h.length&&(t.mcpTools=e.mcpTools.map(_=>{var N,C,S,A;const k={name:_.name,transport:_.transport};return(N=_.url)!=null&&N.trim()&&(k.url=_.url.trim()),(C=_.authToken)!=null&&C.trim()&&(k.authToken=_.authToken.trim()),(S=_.command)!=null&&S.trim()&&(k.command=_.command.trim()),(A=_.args)!=null&&A.length&&(k.args=_.args),k})),((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||"viking",(y=e.knowledgebaseIndex)!=null&&y.trim()&&(t.knowledgebaseIndex=e.knowledgebaseIndex.trim())),e.tracing&&((E=e.tracingExporters)!=null&&E.length)&&(t.tracing=!0,t.tracingExporters=[...e.tracingExporters]),(g=e.deployment)!=null&&g.feishuEnabled&&(t.deployment={feishuEnabled:!0}),(x=e.selectedSkills)!=null&&x.length&&(t.selectedSkills=e.selectedSkills.map(_=>{const k={source:_.source,name:_.name,folder:_.folder};return _.description&&(k.description=_.description),_.source==="skillhub"?(k.slug=_.slug,k.namespace=_.namespace??"public"):_.source==="local"?k.localFiles=_.localFiles??[]:(k.skillSpaceId=_.skillSpaceId,k.skillSpaceName=_.skillSpaceName,k.skillId=_.skillId,_.version&&(k.version=_.version)),k})),(b=e.subAgents)!=null&&b.length&&(t.subAgents=e.subAgents.map(U6)),t}function Ime(e){return`# VeADK Agent 结构配置 -# 可在「创建 Agent」页通过「导入 YAML」重新载入。 -`+_me(U6(e))}function Ome(e){const t=vme(e);return F6(t)}const Rme=[{kind:"custom",icon:ZH,title:"自定义",desc:"分步配置模型、工具、记忆、知识库等组件。"},{kind:"intelligent",icon:PH,title:"智能模式",desc:"敬请期待",disabled:!0},{kind:"template",icon:LH,title:"从模板新建",desc:"敬请期待",disabled:!0},{kind:"workflow",icon:JH,title:"工作流",desc:"敬请期待",disabled:!0}];function Lme({onSelect:e,onImport:t}){const n=w.useRef(null),[r,s]=w.useState(""),i=Rme.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 c=(u=o.target.files)==null?void 0:u[0];if(o.target.value="",!!c)try{const d=await c.text();t(Ome(d))}catch(d){s(`导入失败:${d instanceof Error?d.message:String(d)}`)}};return l.jsx(G4,{title:"从 0 快速创建",sub:"选择一种方式开始",cards:i,footer:l.jsxs("div",{style:{display:"flex",flexDirection:"column",alignItems:"center",gap:8},children:[l.jsxs("button",{className:"stk-import",onClick:()=>{var o;return(o=n.current)==null?void 0:o.click()},children:[l.jsx(XH,{}),"导入 YAML 配置"]}),r&&l.jsx("span",{style:{fontSize:12,color:"hsl(var(--destructive))"},children:r}),l.jsx("input",{ref:n,type:"file",accept:".yaml,.yml,text/yaml",style:{display:"none"},onChange:a})]})})}const Mme="modulepreload",jme=function(e){return"/"+e},WA={},oc=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(c=>{if(c=jme(c),c in WA)return;WA[c]=!0;const u=c.endsWith(".css"),d=u?'[rel="stylesheet"]':"";if(document.querySelector(`link[href="${c}"]${d}`))return;const f=document.createElement("link");if(f.rel=u?"stylesheet":Mme,u||(f.as="script"),f.crossOrigin="",f.href=c,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 ${c}`)))})}))}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 $6(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 Dme(e,t){return $6([{env:e}]).specs.map(r=>({...r,value:t[r.key]??""}))}function H6(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 GA(e,t){return e.find(n=>{var r;return n.required&&!((r=t[n.key])!=null&&r.trim())})}const Pme="data:image/svg+xml,%3csvg%20xmlns='http://www.w3.org/2000/svg'%20viewBox='0%200%2048%2048'%3e%3cimage%20width='48'%20height='48'%20href='data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAADAAAAAwCAYAAABXAvmHAAAAAXNSR0IArs4c6QAAAERlWElmTU0AKgAAAAgAAYdpAAQAAAABAAAAGgAAAAAAA6ABAAMAAAABAAEAAKACAAQAAAABAAAAMKADAAQAAAABAAAAMAAAAADbN2wMAAAH7UlEQVRoBdVZWWwbVRQ9492Onc1xTfaWLukq9oSqLKnYBZRSNgn6AagsAgmJRfzxg4SEEDtiER8IBKKAChK0FS1tKYWW0lZQKKV0gxCVJm3ikDiO17EdzrUzSdw4jj1OpeQqNzO237vvnHfvu/e9GWVwcBBDYue1mrqE2kI1UqeSJAnmIHUzNUCNUmGiKtQy6oPUR6geqnw/FSVOUH9R36KupfaDHnBQn6MGqEnqVJcEAfZTBbNL4b+lZPI1VbwwnaSfYO8z8N+TVMd0Qj6EVdbs3eIBP29cVFkL00kk+wSEwHAamgh9bDAJSQWTITZFnF+85J1tBPyOUC9OqqnsVdTIRkVBi70Msy125uriHJ8XAXFRfzKBTQM+rO0/hc54cSQE8iyzAx/XLcEltjIU44uCQijOaHvPfxIv97TjWCzEcMo7+sZ4TGa+2V6KT2rPQ73ZptsPBZE30fVrymvxTvUCtDoqYC0ijhMk/3MkgDd62xFheOqVggjIIAbOVaujEh/ULsaNzioUsxhVAv/A34GD0YBubxZMQJupWpMNr58zHytcHth1ekICsDcRx4u+fxBK6vOCbgKyEIXEK975WOmaoZuErKv1QR8ORQd0eUE3Ac0TNSYrXvI24fZSLxwGfebiDKW3e08gln9J0oYvKoMNG6kmiRdmzMOtTi8sOsJJJfANA93oiseGbeZ7k1EHZAKCEcApu4wCxUsSz3rm4HQiim3B/wpOsBJA2yP/4cZIJYIBFcGwCjWeSKEwm4wosZtR7rKizGXJQJZRB1TuttftAprnAbOrM9rl9UHqwg+s1o+eOow/GNN5CaPOklSgdKq4us+Ji7pt6Dw1AF9vBOGImjJht5lRVWFDY7UL58/3wOt2YPEcN2xWVpPRe6EQC+y9rwINPNKsuRaYX5cXhIxGkks+Y7V+6vQRdLBi5yx1bGwicFebivj+ARgOhZGMJMFyQyWpoV2GRIa2ZXOX2bDyqnPxzEPNKC+1Zj957eDBTbz34PXAwvoMfBN+kGV8Bxf00VgQz/vaEB6nSCnRQVj2h2DZG4TyZwQWlSils3m8RDDEhk2uaqlHaYklVb3Ha42dh4B3eMzZ//eEmMc0kGL3cEU9WksqU4XvzAYKZ9n6fQCOz3thORCGkhgCf2bDMz4bjQpW39yE65Y1QO5FxiUgP+76E3hzI7D1VyBcwP5NTFcZzXjaPRMNZmvGPkfA23YMwLHRD0Mf3ZwTgaBIi8GgYMGsSjx2z3kEP9Jp5E5rOeoqQH75C3htPfDpD4CskXxFvHC5vQKPVjSwPqQfcKTAfxuA/Ws/lBAXwEhUTGjWSAL3r1qYykSju+UkIFbZDx09wPvb0iH1W9uEYw03MHAV3ltew1CqgDkyCNtWgt/cnwY/3GriG5n9hbMrccNljRmzLz0nJCCNJBsEwsCH24E3NgDr96brhfyWS2Sm3EYLVsOL0i0DsG8h+LDkqcLExHhfc9siVDDrjJ59sZJRyHKZFRKybiSkTtIjR08CrXwEdtGcXL2A4+192LOuDeatfqg6wMvsL5lbhWuWysIdO995E9BgSkh19THX7wQOtANXLgKWLQSaarUWI9dNP7bjo68OY9uef6GqhcW8ZkViX2a/nBWYQ4+RggmIBfFGnHgOcD0c7wD2HgOW0xuXk0xN5SDaOwL4cnsb1m05joPHejKK0hgEOb4Q8Muba3H1pXUwZZl96aqLgHSU2RCbEe6/9hzh875OYPdhYF5NDLt/Oohd+46gNxBjm2zzJhZyi/RyV5TggdsvRJnTOm5j3QQ0i9ra6OHj1u9+B/YdNcLXVQdDmYNPy9oZ971IcIPHjUHadVrHHFfZNphtTtx508W4eJEHsg7Gk6IJaIZlDEn3EdUEl7sBg4la2MtqkYgNIOz/F9FgF6IhX6p5mozcjgbGasw/xWCCs7IeN7U24b4VddwZj26jjTZynTQCmknxSBqIETanh7ceWEpmpIiokT7E6JFosBvxaD/iJCeNDQYzTFYnzHY3SsobmfM9eOyucjTO0KyOf510AqOHkl2kiMlSQoAlsPLAk4hHSCaIJMMqmUgfYBQeggxGK4xmOxprXHh8lYK51em+E/0/qwQyBh8iY+Q52pjlOZD8XFcFPHELcGlT3stlbBaymtOROTReBoZJ+0DjZ9pv4SFq9fL0YWqcjJl1+AwP8OSGS+amq6y4P/fyyWqvoC9lDAG7ainPEJcBs7xMBGOLbU6bGQTMJHAnDUlG2biPFZevEM4GCZl9sSsnPgG+bAHfa+l8vZJxpNSo+oPp/c4XP6bPBN0kog2qtdFz1WzIkfXmZuAKVm6JewlbvZKVgGZMilMPwW9ngdr5B3CEG7iEbCY5ffl6RgPtYDGdybS4ogW4YDbgLefTD5s2kv5rTgKaWdlKi1fau4BDJ3jM5I70NDd0J7grzfZEUMg5CM5Tmg4TiW3ZtVYxTKpcgM2iWS7+mhcBbRiZ/TBTd4jPjtSEVF3AxxdUPgkxTrUUMTcBykKUmLZwhQlYPhWBeCBV5DRjk3QtiEC2McUDsjPVCEhWEQ8Umk2y2c7nOyEwrV/ySdbdQo3nw3aKtRHM3wiBtVQu02knISJ+SQh8Q32TyqTJJ6xTXyQzyzb2LeoBWQOy5pjwcDf1YSqzNIooLex99kTCppsq4N+l+oUArylhoku9sb+O18VU8c5UEiZu7KGyrKKTmgr7/wGxhy03aZIycwAAAABJRU5ErkJggg=='%20/%3e%3c/svg%3e",Bme=(()=>{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 Fme(e){let t=4294967295;for(let n=0;n>>8;return(t^4294967295)>>>0}function on(e,t){e.push(t&255,t>>>8&255)}function Gr(e,t){e.push(t&255,t>>>8&255,t>>>16&255,t>>>24&255)}const qA=2048,ub=20,XA=0;function Ume(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),E=Fme(y),g=y.length,x=[];Gr(x,67324752),on(x,ub),on(x,qA),on(x,XA),on(x,0),on(x,0),Gr(x,E),Gr(x,g),Gr(x,g),on(x,m.length),on(x,0);const b=Uint8Array.from(x);n.push(b,m,y),r.push({nameBytes:m,dataBytes:y,crc:E,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=[];Gr(m,33639248),on(m,ub),on(m,ub),on(m,qA),on(m,XA),on(m,0),on(m,0),Gr(m,p.crc),Gr(m,p.size),Gr(m,p.size),on(m,p.nameBytes.length),on(m,0),on(m,0),on(m,0),on(m,0),Gr(m,0),Gr(m,p.offset);const y=Uint8Array.from(m);a.push(y,p.nameBytes),o+=y.length+p.nameBytes.length}const c=[];Gr(c,101010256),on(c,0),on(c,0),on(c,r.length),on(c,r.length),Gr(c,o),Gr(c,i),on(c,0);const u=[...n,...a,Uint8Array.from(c)],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 $me=w.lazy(()=>oc(()=>import("./CodeEditor-Cr6KNv6h.js"),[]));function Hme(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 zme(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 z6({project:e,open:t,onClose:n,onChange:r}){var m;const[s,i]=w.useState(((m=e.files[0])==null?void 0:m.path)??null),[a,o]=w.useState(new Set),c=w.useRef(null),u=w.useMemo(()=>Hme(e.files),[e.files]),d=e.files.find(y=>y.path===s)??null;if(w.useEffect(()=>{var g;if(!t)return;const y=document.body.style.overflow;document.body.style.overflow="hidden",(g=c.current)==null||g.focus();const E=x=>{x.key==="Escape"&&n()};return window.addEventListener("keydown",E),()=>{document.body.style.overflow=y,window.removeEventListener("keydown",E)}},[n,t]),w.useEffect(()=>{d||e.files.length===0||i(e.files[0].path)},[e.files,d]),!t)return null;function f(y){o(E=>{const g=new Set(E);return g.has(y)?g.delete(y):g.add(y),g})}function h(y,E,g){return zme(y).map(x=>{const b=g?`${g}/${x.name}`:x.name;if(!(x.children.size>0&&x.path===void 0)&&x.path)return l.jsxs("button",{type:"button",className:`code-browser-file${s===x.path?" is-active":""}`,style:{paddingLeft:`${12+E*16}px`},onClick:()=>i(x.path??null),title:x.path,children:[l.jsx(cS,{"aria-hidden":"true"}),l.jsx("span",{children:x.name})]},b);const k=a.has(b);return l.jsxs("div",{children:[l.jsxs("button",{type:"button",className:"code-browser-folder",style:{paddingLeft:`${10+E*16}px`},onClick:()=>f(b),"aria-expanded":!k,children:[l.jsx(ws,{className:k?"":"is-open","aria-hidden":"true"}),l.jsx(SL,{"aria-hidden":"true"}),l.jsx("span",{children:x.name})]}),!k&&h(x,E+1,b)]},b)})}function p(y){d&&r({...e,files:e.files.map(E=>E.path===d.path?{...E,content:y}:E)})}return Ss.createPortal(l.jsx("div",{className:"code-browser-backdrop",onMouseDown:y=>{y.target===y.currentTarget&&n()},children:l.jsxs("section",{className:"code-browser-dialog",role:"dialog","aria-modal":"true","aria-labelledby":"code-browser-title",children:[l.jsxs("header",{className:"code-browser-head",children:[l.jsxs("div",{className:"code-browser-title-wrap",children:[l.jsx("span",{className:"code-browser-title-icon","aria-hidden":"true",children:l.jsx(Tw,{})}),l.jsxs("div",{children:[l.jsx("h2",{id:"code-browser-title",children:"项目代码"}),l.jsx("p",{children:e.name||"Agent 项目"})]})]}),l.jsx("button",{ref:c,type:"button",className:"code-browser-close",onClick:n,"aria-label":"关闭代码浏览器",children:l.jsx(zr,{"aria-hidden":"true"})})]}),l.jsxs("div",{className:"code-browser-workspace",children:[l.jsxs("aside",{className:"code-browser-sidebar","aria-label":"项目文件",children:[l.jsxs("div",{className:"code-browser-sidebar-head",children:["文件 ",l.jsx("span",{children:e.files.length})]}),l.jsx("div",{className:"code-browser-tree",children:e.files.length>0?h(u,0,""):l.jsx("div",{className:"code-browser-empty",children:"暂无项目文件"})})]}),l.jsxs("main",{className:"code-browser-main",children:[l.jsxs("div",{className:"code-browser-path",children:[l.jsx(cS,{"aria-hidden":"true"}),l.jsx("span",{children:(d==null?void 0:d.path)??"未选择文件"})]}),l.jsx("div",{className:"code-browser-editor",children:d?l.jsx(w.Suspense,{fallback:l.jsx("div",{className:"code-browser-empty",children:"正在加载编辑器…"}),children:l.jsx($me,{value:d.content,path:d.path,onChange:p})}):l.jsx("div",{className:"code-browser-empty",children:"从左侧选择文件以查看代码"})})]})]})]})}),document.body)}function Vme({project:e,onChange:t,className:n=""}){const[r,s]=w.useState(!1);return l.jsxs(l.Fragment,{children:[l.jsxs("button",{type:"button",className:`code-browser-trigger ${n}`.trim(),onClick:()=>s(!0),"aria-label":"查看和编辑项目源码",title:"查看源码",children:[l.jsx(Tw,{"aria-hidden":"true"}),l.jsx("span",{children:"查看源码"})]}),l.jsx(z6,{project:e,open:r,onClose:()=>s(!1),onChange:t})]})}function eg({message:e,className:t="",onRetry:n,retryLabel:r="重试部署"}){const[s,i]=w.useState(!1),[a,o]=w.useState(!1),[c,u]=w.useState(!1),d=async()=>{try{await navigator.clipboard.writeText(e),o(!0),setTimeout(()=>o(!1),1500)}catch{o(!1)}},f=async()=>{if(!(!n||c)){u(!0);try{await n()}finally{u(!1)}}};return l.jsxs("div",{className:`deploy-error-message${s?" is-expanded":""}${t?` ${t}`:""}`,children:[l.jsx("p",{className:"deploy-error-message-text",children:e}),l.jsxs("div",{className:"deploy-error-message-actions",children:[n&&l.jsxs("button",{type:"button",className:"deploy-error-retry",disabled:c,onClick:()=>void f(),children:[c?l.jsx(Rt,{className:"spin"}):l.jsx(KH,{}),c?"重试中…":r]}),l.jsx("button",{type:"button",title:s?"收起错误信息":"展开完整错误信息","aria-label":s?"收起错误信息":"展开完整错误信息",onClick:()=>i(h=>!h),children:s?l.jsx(FH,{}):l.jsx(tc,{})}),l.jsx("button",{type:"button",title:a?"已复制":"复制完整错误信息","aria-label":a?"已复制":"复制完整错误信息",onClick:()=>void d(),children:a?l.jsx(Js,{}):l.jsx(Aw,{})})]})]})}Hr.registerLanguage("python",rj);Hr.registerLanguage("typescript",mj);Hr.registerLanguage("javascript",Q3);Hr.registerLanguage("json",Z3);Hr.registerLanguage("yaml",gj);Hr.registerLanguage("markdown",nj);Hr.registerLanguage("bash",K3);Hr.registerLanguage("ini",Y3);Hr.registerLanguage("dockerfile",LQ);Hr.registerLanguage("makefile",tj);const Kme=w.lazy(()=>oc(()=>import("./CodeEditor-Cr6KNv6h.js"),[])),fa=()=>{};function Yme({open:e,isUpdate:t,onCancel:n,onConfirm:r}){const s=w.useRef(null);return w.useEffect(()=>{var o;if(!e)return;const i=document.body.style.overflow;document.body.style.overflow="hidden",(o=s.current)==null||o.focus();const a=c=>{c.key==="Escape"&&n()};return window.addEventListener("keydown",a),()=>{document.body.style.overflow=i,window.removeEventListener("keydown",a)}},[n,e]),e?Ss.createPortal(l.jsx("div",{className:"code-browser-backdrop pp-confirm-backdrop",onMouseDown:i=>{i.target===i.currentTarget&&n()},children:l.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:[l.jsxs("header",{className:"code-browser-head pp-confirm-head",children:[l.jsxs("div",{className:"code-browser-title-wrap",children:[l.jsx("span",{className:"code-browser-title-icon pp-confirm-icon","aria-hidden":"true",children:l.jsx(qH,{})}),l.jsx("h2",{id:"pp-confirm-title",children:t?"确认更新":"确认部署"})]}),l.jsx("button",{type:"button",className:"code-browser-close",onClick:n,"aria-label":"关闭部署确认",children:l.jsx(zr,{"aria-hidden":"true"})})]}),l.jsx("div",{className:"pp-confirm-body",children:l.jsx("p",{id:"pp-confirm-description",children:t?"将更新并发布到当前云端 Runtime,过程可能需要几分钟。确定继续吗?":"将创建新的云端 Runtime,部署过程可能需要几分钟。确定继续吗?"})}),l.jsxs("footer",{className:"pp-confirm-actions",children:[l.jsx("button",{ref:s,type:"button",onClick:n,children:"取消"}),l.jsx("button",{type:"button",className:"is-primary",onClick:r,children:t?"确定更新":"确定部署"})]})]})}),document.body):null}const Wme={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"},QA={dockerfile:"dockerfile","requirements.txt":"plaintext","requirements-dev.txt":"plaintext",".env":"ini",".gitignore":"plaintext",makefile:"makefile"};function ZA(e){return e.replace(/&/g,"&").replace(//g,">")}function Gme(e){const n=(e.split("/").pop()??e).toLowerCase();if(QA[n])return QA[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 Wme[s]??null}function qme(e,t){try{const n=Gme(t);return n&&Hr.getLanguage(n)?Hr.highlight(e,{language:n,ignoreIllegals:!0}).value:n===null?Hr.highlightAuto(e).value:ZA(e)}catch{return ZA(e)}}const Xme=[{phase:"build",label:"构建镜像"},{phase:"deploy",label:"部署"},{phase:"publish",label:"发布"}],Qme=[{phase:"upload",label:"上传代码包"},{phase:"build",label:"镜像打包"},{phase:"deploy",label:"创建 Runtime"},{phase:"publish",label:"发布服务"}];function Zme(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 Jme(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 ege(e="",t=""){return{id:`${Date.now().toString(36)}-${Math.random().toString(36).slice(2,8)}`,key:e,value:t}}function tge({left:e,right:t}){const[n,r]=w.useState(null);return w.useLayoutEffect(()=>{const s=document.getElementById("veadk-page-header-left"),i=document.getElementById("veadk-page-header-actions");s&&i&&r({left:s,right:i})},[]),n?l.jsxs(l.Fragment,{children:[Ss.createPortal(e,n.left),Ss.createPortal(t,n.right)]}):l.jsxs("header",{className:"pp-toolbar",children:[e,t]})}function y0({project:e,embedded:t=!1,deployDisabledReason:n,agentDraft:r,agentName:s,agentCount:i,releaseConfiguration:a,onChange:o,onDeploy:c,onAgentAdded:u,onDeploymentComplete:d,deploymentActionLabel:f="部署",deploymentRuntimeId:h,onDeploymentStarted:p,onDeploymentTaskChange:m,feishuEnabled:y=!1,onFeishuEnabledChange:E,deploymentEnv:g=[],deploymentEnvValues:x={},onDeploymentEnvChange:b,network:_,onNetworkChange:k,deployRegion:N="cn-beijing",onDeployRegionChange:C,onBack:S,backLabel:A="返回配置",onExportYaml:O,deploymentPrimaryPane:D,deployDisabled:U=!1}){var ot,It,st;const X=typeof o=="function",M=f.includes("更新"),j=D?Qme:Xme,[T,L]=w.useState(((It=(ot=e==null?void 0:e.files)==null?void 0:ot[0])==null?void 0:It.path)??null),[R,F]=w.useState(new Set),[I,V]=w.useState(!1),[W,P]=w.useState(""),[ie,G]=w.useState(!1),[re,ue]=w.useState(!1),[ee,le]=w.useState(!1),[ne,me]=w.useState(!1),[ye,te]=w.useState(null),[de,Ee]=w.useState(null),[Te,Ke]=w.useState({}),[Ne,it]=w.useState(null),[He,Ue]=w.useState(!1),[Et,rt]=w.useState([]),[St,ct]=w.useState(!1),[B,Q]=w.useState(!1),oe=w.useRef(!0),be=Z=>l.jsxs("div",{className:"pp-network-region",onKeyDown:we=>{we.key==="Escape"&&Q(!1)},children:[Z&&l.jsx("span",{children:"发布区域"}),l.jsxs("button",{type:"button",className:"pp-region-trigger","aria-label":"部署区域","aria-haspopup":"listbox","aria-expanded":B,disabled:ie||M||!C,onClick:()=>Q(we=>!we),children:[l.jsx("span",{children:N==="cn-shanghai"?"华东 2(上海)":"华北 2(北京)"}),l.jsx(Sw,{className:`pp-region-chevron${B?" is-open":""}`})]}),B&&l.jsxs(l.Fragment,{children:[l.jsx("div",{className:"menu-scrim",onClick:()=>Q(!1)}),l.jsx("div",{className:"pp-region-menu",role:"listbox","aria-label":"部署区域",children:[{value:"cn-beijing",label:"华北 2(北京)"},{value:"cn-shanghai",label:"华东 2(上海)"}].map(we=>{const _e=we.value===N;return l.jsxs("button",{type:"button",role:"option","aria-selected":_e,className:`pp-region-option${_e?" is-selected":""}`,onClick:()=>{C==null||C(we.value),Q(!1)},children:[l.jsx("span",{children:we.label}),_e&&l.jsx(Js,{"aria-hidden":"true"})]},we.value)})})]})]});w.useEffect(()=>(oe.current=!0,()=>{oe.current=!1}),[]),w.useEffect(()=>{if(!ee)return;const Z=document.body.style.overflow;document.body.style.overflow="hidden";const we=_e=>{_e.key==="Escape"&&le(!1)};return window.addEventListener("keydown",we),()=>{document.body.style.overflow=Z,window.removeEventListener("keydown",we)}},[ee]);const Oe=w.useMemo(()=>!(e!=null&&e.files)||!Array.isArray(e.files)?{name:"",children:new Map}:Zme(e.files),[e==null?void 0:e.files]);if(!e||!Array.isArray(e.files))return l.jsx("div",{className:"pp-error",children:"项目数据无效"});const Ye=e.files.find(Z=>Z.path===T)??null,tt=(_==null?void 0:_.mode)??"public",ze=Dme(y?[...g,...bu]:g,x),Tt=ze.length+Et.length;function Re(Z){F(we=>{const _e=new Set(we);return _e.has(Z)?_e.delete(Z):_e.add(Z),_e})}function kt(Z,we){o&&(o({...e,files:Z}),we!==void 0&&L(we))}function Pt(Z){Ye&&kt(e.files.map(we=>we.path===Ye.path?{...we,content:Z}:we))}function Bt(){const Z=W.trim();if(V(!1),P(""),!!Z){if(e.files.some(we=>we.path===Z)){L(Z);return}kt([...e.files,{path:Z,content:""}],Z)}}function bn(){if(!Ye)return;const Z=window.prompt("重命名文件",Ye.path),we=Z==null?void 0:Z.trim();!we||we===Ye.path||e.files.some(_e=>_e.path===we)||kt(e.files.map(_e=>_e.path===Ye.path?{..._e,path:we}:_e),we)}function Xe(){var we;if(!Ye)return;const Z=e.files.filter(_e=>_e.path!==Ye.path);kt(Z,((we=Z[0])==null?void 0:we.path)??null)}function ft(Z,we){rt(_e=>_e.map(We=>We.id===Z?{...We,...we}:We))}function xt(Z){rt(we=>we.filter(_e=>_e.id!==Z))}function vt(){rt(Z=>[...Z,ege()])}function fe(Z){k&&k(Z==="public"?void 0:{..._??{mode:Z},mode:Z})}function $e(Z){k==null||k({..._??{mode:"private"},...Z})}function nt(){const Z=new Map(Et.map(_e=>({key:_e.key.trim(),value:_e.value})).filter(_e=>_e.key.length>0).map(_e=>[_e.key,_e.value])),we=y?[...g,...bu]:g;for(const _e of H6(we,x))Z.set(_e.key,_e.value);return[...Z].map(([_e,We])=>({key:_e,value:We}))}async function qt(){if(!(!E||ie||ne)){te(null),me(!0);try{await E(!y)}catch(Z){oe.current&&te(`更新飞书配置失败:${Z instanceof Error?Z.message:String(Z)}`)}finally{oe.current&&me(!1)}}}async function fn(){var we;if(!c||ie||U)return;if(tt!=="public"&&!((we=_==null?void 0:_.vpcId)!=null&&we.trim())){te("使用 VPC 网络时,请填写 VPC ID。");return}const Z=GA(g,x);if(Z){const _e=g.find(We=>We.key===Z.key);te(`请返回配置页填写 ${(_e==null?void 0:_e.comment)||(_e==null?void 0:_e.key)}(${_e==null?void 0:_e.key})。`);return}if(y){const _e=GA(bu,x);if(_e){const We=bu.find(Ve=>Ve.key===_e.key);te(`启用飞书后,请填写${(We==null?void 0:We.comment)||(We==null?void 0:We.key)}。`);return}}ue(!0)}async function Lt(){if(!c||ie)return;ue(!1);const Z=nt();oe.current&&(te(null),Ee(null),Ke({}),it(null),G(!0));const we=`${Date.now()}-${Math.random().toString(36).slice(2,8)}`;let _e=(s==null?void 0:s.trim())||e.name||"生成中…";const We=Date.now(),Ve={id:we,runtimeName:_e,runtimeId:h,region:N,startedAt:We,status:"running",phase:"prepare",label:"准备部署",agentDraft:r};m==null||m(Ve),p==null||p(Ve);try{const Je=await c(e,ut=>{var Vt;ut.runtimeName&&(_e=ut.runtimeName),oe.current&&(Ke(Ft=>({...Ft,[ut.phase]:ut})),it(ut.phase)),m==null||m({id:we,runtimeName:_e,runtimeId:h,region:N,startedAt:We,status:"running",phase:ut.phase,label:((Vt=j.find(Ft=>Ft.phase===ut.phase))==null?void 0:Vt.label)??ut.phase,message:ut.message,pct:ut.pct})},y?{taskId:we,im:{feishu:{enabled:!0}},envs:Z}:{taskId:we,envs:Z});oe.current&&(Ee(Je),it(null)),await(d==null?void 0:d(Je)),m==null||m({id:we,runtimeName:Je.agentName||_e,runtimeId:Je.runtimeId||h,region:Je.region||N,startedAt:We,status:"success",phase:"complete",label:"部署完成"})}catch(Je){const ut=Je instanceof Error?Je.message:String(Je);if(Je instanceof DOMException&&Je.name==="AbortError"){oe.current&&(te(null),it(null)),m==null||m({id:we,runtimeName:_e,runtimeId:h,region:N,startedAt:We,status:"cancelled",label:"已取消",message:"部署已取消,相关 Runtime 资源已请求销毁。"});return}oe.current&&te(ut),m==null||m({id:we,runtimeName:_e,runtimeId:h,region:N,startedAt:We,status:"error",label:"部署失败",message:ut,retry:fn})}finally{oe.current&&G(!1)}}function J(){ue(!1)}async function he(){if(!(!de||He)){Ue(!0),te(null);try{const{addConnection:Z,addRuntimeConnection:we,remoteAppId:_e,loadConnections:We}=await oc(async()=>{const{addConnection:ut,addRuntimeConnection:Vt,remoteAppId:Ft,loadConnections:hn}=await Promise.resolve().then(()=>vS);return{addConnection:ut,addRuntimeConnection:Vt,remoteAppId:Ft,loadConnections:hn}},void 0),{probeRuntimeApps:Ve}=await oc(async()=>{const{probeRuntimeApps:ut}=await Promise.resolve().then(()=>wz);return{probeRuntimeApps:ut}},void 0);let Je;if(de.runtimeId){const ut=de.region??"cn-beijing",Vt=await Ve(de.runtimeId,ut)??[];Je=we(de.runtimeId,de.agentName,ut,Vt,Vt.length>0?{[Vt[0]]:de.agentName}:void 0,de.version)}else Je=await Z(de.agentName,de.url,de.apikey,"");if(Je.apps.length===0)te("连接成功,但该地址未发现任何 Agent(/list-apps 为空)。");else{const ut={[Je.apps[0]]:de.agentName},Vt={...Je,appLabels:{...Je.appLabels??{},...ut}},hn=We().map(Kt=>Kt.id===Je.id?Vt:Kt);localStorage.setItem("veadk_agentkit_connections",JSON.stringify(hn));const{registerConnections:Tn}=await oc(async()=>{const{registerConnections:Kt}=await Promise.resolve().then(()=>vS);return{registerConnections:Kt}},void 0);if(Tn(hn),u){const Kt=_e(Je.id,Je.apps[0]);u(Kt,de.agentName)}else alert(`🎉 Agent "${de.agentName}" 已添加到左上角下拉列表!`)}}catch(Z){te(`添加 Agent 失败:${Z instanceof Error?Z.message:String(Z)}`)}finally{Ue(!1)}}}function Le(){const Z=Ume(e.files),we=URL.createObjectURL(Z),_e=document.createElement("a");_e.href=we,_e.download=`${e.name||"project"}.zip`,document.body.appendChild(_e),_e.click(),document.body.removeChild(_e),URL.revokeObjectURL(we)}function Be(Z,we,_e){return Jme(Z).map(We=>{const Ve=_e?`${_e}/${We.name}`:We.name,Je=We.path!==void 0,ut={paddingLeft:8+we*14};if(Je){const Ft=We.path===T;return l.jsxs("button",{type:"button",className:`pp-row pp-file${Ft?" pp-active":""}`,style:ut,onClick:()=>L(We.path),title:We.path,children:[l.jsx(NH,{className:"pp-ic"}),l.jsx("span",{className:"pp-label",children:We.name})]},Ve)}const Vt=R.has(Ve);return l.jsxs("div",{children:[l.jsxs("button",{type:"button",className:"pp-row pp-folder",style:ut,onClick:()=>Re(Ve),children:[l.jsx(ws,{className:`pp-ic pp-chevron${Vt?"":" pp-open"}`}),l.jsx(SL,{className:"pp-ic"}),l.jsx("span",{className:"pp-label",children:We.name})]}),!Vt&&Be(We,we+1,Ve)]},Ve)})}return l.jsxs("div",{className:`pp-root${c?" is-deploy":""}${t?" is-embedded":""}${D?" has-primary-pane":""}`,children:[c&&!t&&l.jsx(tge,{left:l.jsxs("div",{className:"pp-toolbar-left",children:[S&&l.jsxs("button",{type:"button",className:"pp-toolbar-back",onClick:S,children:[l.jsx(yL,{className:"pp-ic"}),A]}),l.jsxs("span",{className:"pp-toolbar-title",children:["部署 ",s||e.name||"未命名 Agent",i&&i>1?` 等 ${i} 个智能体`:""]})]}),right:null}),l.jsxs("div",{className:"pp-body",children:[c&&!D&&l.jsx("section",{className:"pp-release-overview","aria-label":"发布概览",children:l.jsxs("div",{className:"pp-release-preview",children:[l.jsxs("div",{className:"pp-flow-thumbnail",children:[r&&l.jsx(Xm,{draft:r,direction:"horizontal",selectedPath:[],onSelect:fa,onAdd:fa,onInsert:fa,onDelete:fa,readOnly:!0,interactivePreview:!0}),l.jsx("button",{type:"button",className:"pp-flow-expand",onClick:()=>le(!0),"aria-label":"放大查看执行流程",title:"放大查看",children:l.jsx(tc,{"aria-hidden":!0})})]}),l.jsxs("div",{className:"pp-release-info",children:[l.jsxs("div",{className:"pp-release-info-main",children:[l.jsx("h2",{children:s||e.name||"未命名 Agent"}),(r==null?void 0:r.description)&&l.jsx("p",{className:"pp-release-description",title:r.description,children:r.description}),l.jsxs("dl",{className:"pp-release-facts",children:[l.jsxs("div",{children:[l.jsx("dt",{children:"Agent 数量"}),l.jsx("dd",{children:i??1})]}),a&&l.jsxs(l.Fragment,{children:[l.jsxs("div",{children:[l.jsx("dt",{children:"模型"}),l.jsx("dd",{children:a.modelName})]}),l.jsxs("div",{children:[l.jsx("dt",{children:"描述"}),l.jsx("dd",{className:"pp-release-fact-long",children:a.description})]}),l.jsxs("div",{children:[l.jsx("dt",{children:"系统提示词"}),l.jsx("dd",{className:"pp-release-fact-long pp-release-prompt",children:a.instruction})]}),l.jsxs("div",{children:[l.jsx("dt",{children:"优化选项"}),l.jsx("dd",{children:a.optimizations.length>0?a.optimizations.join("、"):"未启用"})]})]})]})]}),l.jsxs("div",{className:"pp-artifact-actions",children:[O&&l.jsxs("button",{type:"button",className:"pp-secondary",onClick:O,children:[l.jsx(vH,{className:"pp-ic"}),"导出配置文件"]}),X&&o&&l.jsx(Vme,{project:e,onChange:o,className:"pp-artifact-source"}),e.files.length>0&&l.jsxs("button",{type:"button",className:"pp-secondary",onClick:Le,children:[l.jsx(Cw,{className:"pp-ic"}),"导出源码"]})]})]})]})}),l.jsxs("div",{className:"pp-files-area",children:[l.jsxs("div",{className:"pp-sidebar",children:[l.jsxs("div",{className:"pp-sidebar-head",children:[l.jsx("span",{className:"pp-project-name",title:e.name,children:"文件预览"}),X&&l.jsx("button",{type:"button",className:"pp-icon-btn",title:"新建文件",onClick:()=>{V(!0),P("")},children:l.jsx(_H,{className:"pp-ic"})})]}),l.jsxs("div",{className:"pp-tree",children:[I&&l.jsx("input",{className:"pp-new-input",autoFocus:!0,placeholder:"path/to/file.py",value:W,onChange:Z=>P(Z.target.value),onBlur:Bt,onKeyDown:Z=>{Z.key==="Enter"&&Bt(),Z.key==="Escape"&&(V(!1),P(""))}}),e.files.length===0&&!I?l.jsx("div",{className:"pp-empty",children:"暂无文件"}):Be(Oe,0,"")]})]}),l.jsxs("div",{className:"pp-main",children:[l.jsxs("div",{className:"pp-main-head",children:[l.jsx("span",{className:"pp-path",title:Ye==null?void 0:Ye.path,children:(Ye==null?void 0:Ye.path)??"未选择文件"}),l.jsx("div",{className:"pp-actions",children:X&&Ye&&l.jsxs(l.Fragment,{children:[l.jsx("button",{type:"button",className:"pp-icon-btn",title:"重命名",onClick:bn,children:l.jsx(HH,{className:"pp-ic"})}),l.jsx("button",{type:"button",className:"pp-icon-btn pp-danger",title:"删除",onClick:Xe,children:l.jsx(ea,{className:"pp-ic"})})]})})]}),l.jsx("div",{className:"pp-content",children:Ye==null?l.jsx("div",{className:"pp-placeholder",children:"选择左侧文件以查看内容"}):X?l.jsx("div",{className:"pp-codemirror",children:l.jsx(w.Suspense,{fallback:l.jsx("div",{className:"pp-editor-loading",children:"加载编辑器…"}),children:l.jsx(Kme,{value:Ye.content,path:Ye.path,onChange:Pt})})}):l.jsx("pre",{className:"pp-pre hljs",dangerouslySetInnerHTML:{__html:qme(Ye.content,Ye.path)}})})]})]}),c&&l.jsxs("aside",{className:"pp-config","aria-label":"部署配置",children:[l.jsx("div",{className:"pp-config-head",children:l.jsx("div",{className:"pp-config-title",children:"部署配置"})}),l.jsxs("div",{className:"pp-config-scroll",children:[D,!D&&l.jsxs("section",{className:"pp-config-section",children:[l.jsx("div",{className:"pp-config-label",children:"发布区域"}),be(!1)]}),!D&&l.jsxs("section",{className:"pp-config-section",children:[l.jsx("div",{className:"pp-config-label",children:"消息渠道"}),l.jsx("div",{className:`pp-channel-card${y?" is-flipped":""}`,children:l.jsxs("div",{className:"pp-channel-card-inner",children:[l.jsxs("button",{type:"button",className:"pp-channel-card-face pp-channel-card-front","aria-pressed":y,"aria-hidden":y,tabIndex:y?-1:0,onClick:()=>void qt(),disabled:y||ie||ne||!E,children:[l.jsx("span",{className:"pp-channel-logo",children:l.jsx("img",{src:Pme,alt:""})}),l.jsxs("span",{className:"pp-channel-card-copy",children:[l.jsx("strong",{children:"飞书"}),l.jsx("small",{children:ne?"正在启用并更新配置…":"接收消息并通过飞书机器人回复"})]})]}),l.jsxs("div",{className:"pp-channel-card-face pp-channel-card-back","aria-hidden":!y,children:[l.jsxs("div",{className:"pp-channel-card-head",children:[l.jsx("strong",{children:"飞书配置"}),l.jsx("button",{type:"button",className:"pp-channel-remove",tabIndex:y?0:-1,onClick:()=>void qt(),disabled:!y||ie||ne||!E,children:ne?"取消中…":"取消"})]}),l.jsx("div",{className:"pp-channel-fields",children:bu.map(Z=>l.jsxs("label",{children:[l.jsxs("span",{children:[Z.comment||Z.key,Z.required&&l.jsx("small",{children:"必填"})]}),l.jsx("input",{type:Z.key.includes("SECRET")?"password":"text",value:x[Z.key]??"",placeholder:Z.placeholder,tabIndex:y?0:-1,disabled:!y||ie||!b,autoComplete:"off",onChange:we=>b==null?void 0:b(Z.key,we.currentTarget.value)})]},Z.key))})]})]})})]}),l.jsxs("section",{className:"pp-config-section",children:[l.jsx("div",{className:"pp-config-label",children:"网络"}),D&&be(!0),M&&l.jsx("p",{className:"pp-config-note",children:"现有 Runtime 的区域与网络模式保持不变。"}),l.jsxs("div",{className:"pp-network-layout",children:[l.jsx("div",{className:"pp-network-modes",role:"radiogroup","aria-label":"网络模式",children:["public","private","both"].map(Z=>l.jsxs("label",{className:"pp-network-option",children:[l.jsx("input",{type:"radio",name:"deployment-network-mode",value:Z,checked:tt===Z,onChange:()=>fe(Z),disabled:ie||M||!k}),l.jsx("span",{children:Z==="public"?"公网":Z==="private"?"VPC":"公网 + VPC"})]},Z))}),tt!=="public"&&l.jsxs("div",{className:"pp-network-fields",children:[l.jsxs("label",{children:[l.jsx("span",{children:"VPC ID"}),l.jsx("input",{value:(_==null?void 0:_.vpcId)??"",placeholder:"vpc-xxxxxxxx",disabled:ie||M,onChange:Z=>$e({vpcId:Z.target.value})})]}),l.jsxs("label",{children:[l.jsxs("span",{children:["子网 ID ",l.jsx("small",{children:"可选,多个用逗号分隔"})]}),l.jsx("input",{value:(_==null?void 0:_.subnetIds)??"",placeholder:"subnet-xxx, subnet-yyy",disabled:ie||M,onChange:Z=>$e({subnetIds:Z.target.value})})]}),l.jsxs("label",{className:"pp-network-check",children:[l.jsx("input",{type:"checkbox",checked:!!(_!=null&&_.enableSharedInternetAccess),disabled:ie||M,onChange:Z=>$e({enableSharedInternetAccess:Z.target.checked})}),"VPC 内共享公网出口"]})]})]})]}),l.jsxs("section",{className:"pp-config-section pp-env-section",children:[l.jsxs("div",{className:"pp-env-head",children:[l.jsxs("div",{children:[l.jsxs("div",{className:"pp-config-label",children:["环境变量",l.jsxs("span",{className:"pp-agent-child-count pp-env-count",children:[Tt," 项"]})]}),l.jsx("div",{className:"pp-env-sub",children:"组件配置会自动同步到这里,部署前可核对最终值。"})]}),l.jsx("button",{type:"button",className:"pp-icon-btn",title:St?"隐藏值":"显示值",onClick:()=>ct(Z=>!Z),children:St?l.jsx(xH,{className:"pp-ic"}):l.jsx(_L,{className:"pp-ic"})})]}),l.jsxs("button",{type:"button",className:"pp-env-add",onClick:vt,disabled:ie,children:[l.jsx(rr,{className:"pp-ic"}),"添加变量"]}),(ze.length>0||Et.length>0)&&l.jsxs("div",{className:"pp-env-table",children:[ze.length>0&&l.jsxs("div",{className:"pp-env-group",children:[l.jsxs("div",{className:"pp-env-group-head",children:[l.jsx("span",{children:"组件自动生成"}),l.jsxs("small",{children:[ze.length," 项"]})]}),ze.map(Z=>{const we=Z.key.startsWith("ENABLE_");return l.jsxs("div",{className:"pp-env-row pp-env-row-derived",children:[l.jsx("input",{className:"pp-env-key-fixed",value:Z.key,readOnly:!0,disabled:ie,"aria-label":`${Z.key} 环境变量名`}),l.jsx("input",{type:we||St?"text":"password",value:Z.value,placeholder:Z.required?"必填,尚未填写":"可选,尚未填写",readOnly:we,disabled:ie||!we&&!b,autoComplete:"off","aria-label":`${Z.key} 环境变量值`,onChange:_e=>b==null?void 0:b(Z.key,_e.currentTarget.value)}),l.jsx("span",{className:"pp-env-source",children:we?"自动":"同步"})]},Z.key)})]}),Et.length>0&&l.jsxs("div",{className:"pp-env-group-head pp-env-group-head-custom",children:[l.jsx("span",{children:"自定义变量"}),l.jsxs("small",{children:[Et.length," 项"]})]}),Et.map(Z=>l.jsxs("div",{className:"pp-env-row",children:[l.jsx("input",{value:Z.key,placeholder:"名称",disabled:ie,autoComplete:"off",onChange:we=>ft(Z.id,{key:we.currentTarget.value})}),l.jsx("input",{type:St?"text":"password",value:Z.value,placeholder:"值",disabled:ie,autoComplete:"off",onChange:we=>ft(Z.id,{value:we.currentTarget.value})}),l.jsx("button",{type:"button",className:"pp-icon-btn pp-env-remove",title:"删除变量",disabled:ie,onClick:()=>xt(Z.id),children:l.jsx(zr,{className:"pp-ic"})})]},Z.id))]})]}),(ie||de||Object.keys(Te).length>0)&&l.jsxs("section",{className:"pp-config-section pp-progress-section",children:[l.jsx("div",{className:"pp-config-label",children:"部署进度"}),l.jsx("ol",{className:"pp-steps",children:j.map((Z,we)=>{const _e=Ne?j.findIndex(ut=>ut.phase===Ne):-1,We=!!ye&&(_e===-1?we===0:we===_e);let Ve;de?Ve="done":We?Ve="failed":_e===-1?Ve=ie?"active":"pending":we<_e?Ve="done":we===_e?Ve=ye?"failed":"active":Ve="pending";const Je=Te[Z.phase];return l.jsxs("li",{className:`pp-step is-${Ve}`,children:[l.jsx("span",{className:"pp-step-dot",children:Ve==="active"?l.jsx(Rt,{className:"pp-ic spin"}):Ve==="done"?"✓":Ve==="failed"?"✕":we+1}),l.jsxs("span",{className:"pp-step-body",children:[l.jsx("span",{className:"pp-step-label",children:Z.label}),Ve==="active"&&(Je==null?void 0:Je.message)&&l.jsxs("span",{className:"pp-step-msg",children:[Je.message,typeof Je.pct=="number"?` (${Je.pct}%)`:""]})]})]},Z.phase)})})]}),ye&&l.jsx(eg,{className:"pp-error",message:`${Ne?`${M?"更新":"部署"}失败(${((st=j.find(Z=>Z.phase===Ne))==null?void 0:st.label)??Ne}阶段):`:""}${ye}`,onRetry:fn,retryLabel:M?"重试更新":"重试部署"}),de&&l.jsxs("section",{className:"pp-deploy-result",children:[l.jsx("div",{className:"pp-deploy-result-header",children:M?"更新成功":"部署成功"}),l.jsxs("div",{className:"pp-deploy-result-body",children:[de.region&&l.jsxs("div",{className:"pp-deploy-result-field",children:[l.jsx("label",{children:"区域"}),l.jsx("code",{children:de.region==="cn-shanghai"?"上海 (cn-shanghai)":"北京 (cn-beijing)"})]}),l.jsxs("div",{className:"pp-deploy-result-field",children:[l.jsx("label",{children:"Agent 名称"}),l.jsx("code",{children:de.agentName})]}),l.jsxs("div",{className:"pp-deploy-result-field",children:[l.jsx("label",{children:"API 端点"}),l.jsx("code",{className:"pp-deploy-result-url",children:de.url})]})]}),l.jsxs("div",{className:"pp-deploy-result-actions",children:[l.jsxs("button",{type:"button",className:"pp-deploy-result-btn",onClick:he,disabled:He,children:[He?l.jsx(Rt,{className:"pp-ic spin"}):l.jsx(IL,{className:"pp-ic"}),He?"连接中…":"立即对话"]}),de.consoleUrl&&l.jsxs("a",{href:de.consoleUrl,target:"_blank",rel:"noopener noreferrer",className:"pp-console-link pp-console-link-btn",children:[l.jsx(Iw,{className:"pp-ic"}),"控制台"]})]})]})]}),l.jsx("div",{className:"pp-config-actions",children:l.jsx("button",{type:"button",className:"pp-deploy studio-update-action",onClick:fn,disabled:ie||ne||U||!!n,title:n,children:ie?`${f}中…`:ye?`重试${f}`:f})})]})]}),ee&&r&&Ss.createPortal(l.jsx("div",{className:"pp-flow-backdrop",onMouseDown:Z=>{Z.target===Z.currentTarget&&le(!1)},children:l.jsxs("section",{className:"pp-flow-dialog",role:"dialog","aria-modal":"true","aria-label":"执行流程预览",children:[l.jsxs("header",{children:[l.jsxs("div",{children:[l.jsx("strong",{children:"执行流程"}),l.jsx("span",{children:"只读预览,可缩放与拖动画布"})]}),l.jsx("button",{type:"button",onClick:()=>le(!1),"aria-label":"关闭执行流程预览",children:l.jsx(zr,{"aria-hidden":!0})})]}),l.jsx("div",{className:"pp-flow-dialog-canvas",children:l.jsx(Xm,{draft:r,direction:"horizontal",selectedPath:[],onSelect:fa,onAdd:fa,onInsert:fa,onDelete:fa,readOnly:!0,interactivePreview:!0})})]})}),document.body),l.jsx(Yme,{open:re,isUpdate:M,onCancel:J,onConfirm:()=>void Lt()})]})}const JA="dogfooding",db="dogfooding",fb="dogfooding_b";let nge=0;const hb=()=>++nge;function eC(e){return e.blocks.filter(t=>t.kind==="text").map(t=>t.text).join("")}function rge(e){const t=e.trim(),n=t.match(/^```(?:json)?\s*\n?([\s\S]*?)\n?```$/i);return(n?n[1]:t).trim()}async function tC(e){const t=[],n=rge(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 $w(F6(a))}catch{}return null}function sge({userId:e,onBack:t,onCreate:n,onAgentAdded:r,onDeploymentTaskChange:s}){const[i,a]=w.useState([{id:hb(),role:"assistant",text:"你好,我是 VeADK 的智能构建助手。用自然语言描述你想要的 Agent,我会直接帮你生成一个可运行的 VeADK 项目,并在右侧实时预览。"}]),[o,c]=w.useState(""),[u,d]=w.useState(!1),[f,h]=w.useState(null),[p,m]=w.useState(null),[y,E]=w.useState(!1),[g,x]=w.useState(null),[b,_]=w.useState(null),[k,N]=w.useState(!1),[C,S]=w.useState(!1),[A,O]=w.useState({}),D=w.useRef(null),U=w.useRef(null),X=w.useRef(null),M=w.useRef(null),j=w.useRef(null);w.useEffect(()=>{const G=M.current;G&&G.scrollTo({top:G.scrollHeight,behavior:"smooth"})},[i,u]),w.useEffect(()=>{const G=j.current;G&&(G.style.height="auto",G.style.height=Math.min(G.scrollHeight,160)+"px")},[o]);const T=G=>a(re=>[...re,{id:hb(),role:"assistant",text:G}]);async function L(){if(D.current)return D.current;const G=await vm(JA,e);return D.current=G,G}async function R(G,re){if(re.current)return re.current;const ue=await vm(G,e);return re.current=ue,ue}async function F(G,re){if(!A[G])try{const ue=await Fw(re);O(ee=>({...ee,[G]:ue.model||re}))}catch{O(ue=>({...ue,[G]:re}))}}async function I(G,re,ue){const ee=await R(G,re);let le=zs();for await(const me of Yd({appName:G,userId:e,sessionId:ee,text:ue}))le=Ec(le,me);const ne=eC(le).trim();return{project:await tC(ne),finalText:ne}}const V=async(G,re,ue)=>Rg(G.name,G.files,{region:"cn-beijing",projectName:"default"},{...ue,onStage:re}),W=async()=>{const G=o.trim();if(!(!G||u)){if(a(re=>[...re,{id:hb(),role:"user",text:G}]),c(""),h(null),d(!0),y){x(null),_(null),N(!0),S(!0),F("a",db),F("b",fb);const re=I(db,U,G).then(({project:ee})=>(x(ee),ee)).catch(ee=>{const le=ee instanceof Error?ee.message:String(ee);return h(le),null}).finally(()=>N(!1)),ue=I(fb,X,G).then(({project:ee})=>(_(ee),ee)).catch(ee=>{const le=ee instanceof Error?ee.message:String(ee);return h(le),null}).finally(()=>S(!1));try{const[ee,le]=await Promise.all([re,ue]),ne=[ee?`方案 A:${ee.name}`:null,le?`方案 B:${le.name}`:null].filter(Boolean);ne.length?T(`已生成两个方案(${ne.join(",")}),请在右侧对比后采用其一。`):T("(两个方案都没有返回可用的项目,请再描述一下你的需求。)")}finally{d(!1)}return}try{const re=await L();let ue=zs();for await(const ne of Yd({appName:JA,userId:e,sessionId:re,text:G}))ue=Ec(ue,ne);const ee=eC(ue).trim(),le=await tC(ee);le?(m(le),T(`已生成项目:${le.name}(${le.files.length} 个文件),可在右侧预览和编辑。`)):T(ee||"(助手没有返回内容,请再描述一下你的需求。)")}catch(re){const ue=re instanceof Error?re.message:String(re);h(ue),T(`抱歉,调用智能构建助手失败:${ue}`)}finally{d(!1)}}},P=G=>{const re=G==="a"?g:b;if(!re)return;m(re),E(!1),x(null),_(null),N(!1),S(!1);const ue=G==="a"?"A":"B",ee=G==="a"?A.a:A.b;T(`已采用方案 ${ue}(${ee??(G==="a"?db:fb)}),可继续编辑。`)},ie=G=>{G.key==="Enter"&&!G.shiftKey&&!G.nativeEvent.isComposing&&(G.preventDefault(),W())};return l.jsx("div",{className:"ic-root",children:l.jsxs("div",{className:"ic-body",children:[l.jsxs("div",{className:"ic-chat",children:[l.jsxs("div",{className:"ic-transcript",ref:M,children:[l.jsx(pi,{initial:!1,children:i.map(G=>l.jsxs($t.div,{className:`ic-turn ic-turn--${G.role}`,initial:{opacity:0,y:8},animate:{opacity:1,y:0},transition:{duration:.22,ease:"easeOut"},children:[G.role==="assistant"&&l.jsx("div",{className:"ic-avatar",children:l.jsx(Do,{className:"ic-avatar-icon"})}),l.jsx("div",{className:"ic-bubble",children:G.role==="assistant"?l.jsx(Mf,{text:G.text}):G.text})]},G.id))}),u&&l.jsxs($t.div,{className:"ic-turn ic-turn--assistant",initial:{opacity:0,y:8},animate:{opacity:1,y:0},children:[l.jsx("div",{className:"ic-avatar",children:l.jsx(Do,{className:"ic-avatar-icon"})}),l.jsxs("div",{className:"ic-bubble ic-bubble--typing",children:[l.jsx("span",{className:"ic-dot"}),l.jsx("span",{className:"ic-dot"}),l.jsx("span",{className:"ic-dot"})]})]})]}),f&&l.jsxs("div",{className:"ic-error",children:[l.jsx(Ag,{className:"ic-error-icon"}),f]}),l.jsxs("div",{className:"ic-composer",children:[l.jsxs("div",{className:"ic-composer-box",children:[l.jsx("textarea",{ref:j,className:"ic-input",rows:1,placeholder:"描述你想要的 Agent,例如「一个帮我整理周报的写作助手」…",value:o,onChange:G=>c(G.target.value),onKeyDown:ie,disabled:u}),l.jsx("button",{className:"ic-send",onClick:()=>void W(),disabled:!o.trim()||u,title:"发送 (Enter)",children:l.jsx(YH,{className:"ic-send-icon"})})]}),l.jsxs("div",{className:"ic-composer-foot",children:[l.jsxs("label",{className:"ic-ab-toggle",title:"同时用两个模型生成方案进行对比",children:[l.jsx("input",{type:"checkbox",className:"ic-ab-checkbox",checked:y,disabled:u,onChange:G=>E(G.target.checked)}),l.jsx("span",{className:"ic-ab-track",children:l.jsx("span",{className:"ic-ab-thumb"})}),l.jsx("span",{className:"ic-ab-label",children:"A/B 对比"})]}),l.jsx("div",{className:"ic-composer-hint",children:"Enter 发送 · Shift+Enter 换行"})]})]})]}),l.jsx("aside",{className:"ic-preview",children:y?l.jsxs("div",{className:"ic-compare",children:[l.jsx(nC,{side:"a",project:g,loading:k,model:A.a,onAdopt:()=>P("a")}),l.jsx("div",{className:"ic-compare-divider"}),l.jsx(nC,{side:"b",project:b,loading:C,model:A.b,onAdopt:()=>P("b")})]}):p?l.jsx(y0,{project:p,onChange:m,onDeploy:V,onAgentAdded:r,onDeploymentTaskChange:s}):l.jsxs("div",{className:"ic-preview-empty",children:[l.jsxs("div",{className:"ic-preview-empty-icon",children:[l.jsx(TH,{className:"ic-preview-empty-glyph"}),l.jsx(Po,{className:"ic-preview-empty-spark"})]}),l.jsx("div",{className:"ic-preview-empty-title",children:"还没有项目"}),l.jsx("div",{className:"ic-preview-empty-sub",children:"描述你的需求,我会帮你生成 VeADK 项目"})]})})]})})}function nC({side:e,project:t,loading:n,model:r,onAdopt:s}){const i=e==="a"?"方案 A":"方案 B";return l.jsxs("div",{className:"ic-pane",children:[l.jsxs("div",{className:"ic-pane-head",children:[l.jsxs("div",{className:"ic-pane-title",children:[l.jsx("span",{className:`ic-pane-tag ic-pane-tag--${e}`,children:i}),r&&l.jsx("span",{className:"ic-pane-model",children:r})]}),l.jsxs("button",{className:"ic-adopt",onClick:s,disabled:!t||n,title:`采用${i}`,children:["采用",e==="a"?"方案 A":"方案 B"]})]}),l.jsx("div",{className:"ic-pane-body",children:n?l.jsxs("div",{className:"ic-pane-loading",children:[l.jsx(Rt,{className:"ic-pane-spinner"}),l.jsx("span",{children:"正在生成…"})]}):t?l.jsx(y0,{project:t}):l.jsx("div",{className:"ic-pane-empty",children:"该方案未返回可用项目"})})]})}const ige=/^[A-Za-z_][A-Za-z0-9_]*$/;function lc(e){return e.trim().length===0?"名称为必填项":e==="user"?"user 是 Google ADK 保留名称,请使用其他名称":ige.test(e)?null:"名称须以英文字母或下划线开头,且只能包含英文字母、数字和下划线"}function V6(e){const t=new Set,n=new Set,r=s=>{lc(s.name)===null&&(t.has(s.name)?n.add(s.name):t.add(s.name)),s.subAgents.forEach(r)};return r(e),n}function age({className:e,...t}){return l.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:[l.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"}),l.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 Cu={llm:{id:"llm",label:"LLM 智能体",desc:"大模型驱动,自主完成任务",icon:age},sequential:{id:"sequential",label:"顺序型智能体",desc:"子 Agent 按顺序依次执行",icon:AH},parallel:{id:"parallel",label:"并行型智能体",desc:"子 Agent 并行执行后汇总",icon:GH},loop:{id:"loop",label:"循环型智能体",desc:"子 Agent 循环执行到满足条件",icon:Rw},a2a:{id:"a2a",label:"远程智能体",desc:"通过 A2A 协议调用远程 Agent",icon:Cg}},oge=[Cu.llm,Cu.sequential,Cu.parallel,Cu.loop,Cu.a2a],K6=e=>e==="sequential"||e==="parallel"||e==="loop",b0=e=>e==="a2a";function As(e){return e.trimEnd().replace(/[。.]+$/,"")}function tg(e,t){const n=e.trim().toLocaleLowerCase();return n?t.some(r=>r==null?void 0:r.toLocaleLowerCase().includes(n)):!0}function ro(e,t){return e[t]|e[t+1]<<8}function gl(e,t){return(e[t]|e[t+1]<<8|e[t+2]<<16|e[t+3]<<24)>>>0}async function lge(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 Y6(e,t={}){let r=-1;for(let u=e.length-22;u>=0&&u>e.length-65557;u--)if(gl(e,u)===101010256){r=u;break}if(r<0)throw new Error("无效的 zip:找不到 EOCD");const s=ro(e,r+10);if(t.maxEntries!==void 0&&s>t.maxEntries)throw new Error(`zip 文件数不能超过 ${t.maxEntries} 个`);let i=gl(e,r+16);const a=new TextDecoder("utf-8"),o=[];let c=0;for(let u=0;ut.maxUncompressedBytes)throw new Error("zip 解压后的内容过大");const x=ro(e,E+26),b=ro(e,E+28),_=E+30+x+b,k=e.subarray(_,_+f);let N;if(d===0)N=k;else if(d===8)N=await lge(k);else{i+=46+p+m+y;continue}o.push({name:g,text:a.decode(N)}),i+=46+p+m+y}return o}const cge="/skillhub/v1/skills";async function uge(e,t="public"){const n=e.trim(),r=`${cge}?query=${encodeURIComponent(n)}&namespace=${encodeURIComponent(t)}`,s=await fetch(r,{headers:{accept:"application/json"},signal:Gs(void 0,Kc)});if(!s.ok)throw new Error(`搜索失败 (${s.status})`);return((await s.json()).Skills??[]).map(a=>{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 dge({selected:e,onChange:t}){const[n,r]=w.useState(""),[s,i]=w.useState([]),[a,o]=w.useState(!1),[c,u]=w.useState(null),[d,f]=w.useState(!1),h=y=>e.some(E=>E.source==="skillhub"&&E.slug===y),p=y=>{y.slug&&(h(y.slug)?t(e.filter(E=>!(E.source==="skillhub"&&E.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 E=await uge(y);i(E)}catch(E){u(E instanceof Error?E.message:"搜索失败,请稍后重试。"),i([])}finally{o(!1)}};return w.useEffect(()=>{const y=n.trim();if(!y){i([]),f(!1),u(null);return}const E=setTimeout(()=>m(y),300);return()=>clearTimeout(E)},[n]),l.jsxs("div",{className:"cw-skillhub",children:[l.jsxs("div",{className:"cw-skill-searchrow",children:[l.jsxs("div",{className:"cw-skill-searchbox",children:[l.jsx(Vd,{className:"cw-i cw-skill-searchicon","aria-hidden":!0}),l.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))}})]}),l.jsxs("button",{type:"button",className:"cw-btn cw-btn-soft",onClick:()=>n.trim()&&m(n),disabled:!n.trim()||a,children:[a?l.jsx(Rt,{className:"cw-i cw-spin"}):l.jsx(Vd,{className:"cw-i"}),"搜索"]})]}),c&&l.jsxs("div",{className:"cw-banner",children:[l.jsx(Ka,{className:"cw-i"}),l.jsx("span",{children:c})]}),a&&s.length===0?l.jsx("p",{className:"cw-empty-line",children:"正在搜索…"}):s.length>0?l.jsx("div",{className:"cw-skill-results",children:s.map(y=>{const E=h(y.slug||"");return l.jsxs("button",{type:"button",className:`cw-skill-result ${E?"is-on":""}`,onClick:()=>p(y),"aria-pressed":E,children:[l.jsx("span",{className:"cw-skill-result-icon","aria-hidden":!0,children:E?l.jsx(Js,{className:"cw-i cw-i-sm"}):l.jsx(rr,{className:"cw-i cw-i-sm"})}),l.jsxs("span",{className:"cw-skill-result-meta",children:[l.jsx("span",{className:"cw-skill-result-name",children:y.name}),y.description&&l.jsx("span",{className:"cw-skill-result-desc",children:As(y.description)}),y.sourceRepo&&l.jsx("span",{className:"cw-skill-result-repo",children:y.sourceRepo})]})]},y.id||y.slug)})}):d&&!c?l.jsx("p",{className:"cw-empty-line",children:"没有找到匹配的技能,换个关键词试试。"}):!d&&l.jsx("p",{className:"cw-empty-line",children:"输入关键词搜索火山 Find Skill 技能广场,所选技能会在生成项目时下载到 skills/ 目录。"})]})}const WE=/(^|\/)skill\.md$/i;function fge(e){const t=(e??"").replace(/\r\n?/g,` -`).split(` -`);if(!t.length||t[0].trim()!=="---")return{name:"",description:""};let n=-1;for(let s=1;s=2&&(e.startsWith('"')&&e.endsWith('"')||e.startsWith("'")&&e.endsWith("'"))}function pge(...e){var t;for(const n of e){const r=(t=n.trim().replace(/\\/g,"/").split("/").filter(Boolean).pop())==null?void 0:t.replace(/[^A-Za-z0-9_-]+/g,"-").replace(/^-+|-+$/g,"");if(r)return r.slice(0,64)}return"local-skill"}function mge(e,t){return t.trim()||e}function W6(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 gge(e){const t=new Map,n=new Set;for(const r of e)if(WE.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=WE.test("/"+r.path);if(!i&&!a&&!n.has("")||!n.has(i)&&!a)continue;const o=i?r.path.slice(i.length+1):r.path,c=t.get(i)||[];c.push({path:o,text:r.text}),t.set(i,c)}return t}function yge(e,t,n){const r=`${n}${e?"/"+e:""}`,s=t.find(c=>WE.test("/"+c.path));if(!s)return{hit:null,error:`${r} 缺少 SKILL.md`};const i=fge(s.text),a=pge(i.name,e,n.replace(/\.[^.]+$/,"")),o=[];for(const c of t){if(c.path.split("/").some(f=>f===".."))return{hit:null,error:`${r} 包含非法路径(..):${c.path}`};const d=`skills/${a}/${c.path}`;if(!d.startsWith(`skills/${a}/`))return{hit:null,error:`${r} 包含非法路径:${c.path}`};o.push({path:d,content:c.text})}return{hit:{source:"local",id:`local:${a}:${t.length}`,name:mge(a,i.name),description:i.description||"本地 Skill",folder:a,localFiles:o},error:null}}async function bge(e){const t=new Uint8Array(await e.arrayBuffer()),r=(await Y6(t)).map(s=>({path:s.name,text:s.text}));return G6(W6(r),e.name)}async function Ege(e,t=new Map){const n=[];for(let r=0;re.file(t,n))}async function wge(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 q6(e,t=""){const n=t?`${t}/${e.name}`:e.name;if(e.isFile)return[{file:await xge(e),path:n}];if(!e.isDirectory)return[];const r=await wge(e);return(await Promise.all(r.map(s=>q6(s,n)))).flat()}function vge({selected:e,onChange:t}){const[n,r]=w.useState([]),[s,i]=w.useState([]),[a,o]=w.useState(!1),[c,u]=w.useState(!1),d=w.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=w.useRef([]),m=w.useRef(e);w.useEffect(()=>{p.current=s},[s]),w.useEffect(()=>{m.current=e},[e]);const y=b=>{const _=new Set([...p.current.map(S=>S.folder||S.name),...m.current.filter(S=>S.source==="local").map(S=>S.folder)]),k=[],N=[];for(const S of b.hits){const A=S.folder||S.name;if(_.has(A)){k.push(S.name);continue}_.add(A),N.push(S)}i(S=>[...S,...N]);const C=[...b.errors];if(k.length>0&&C.push(`已跳过重复技能:${k.join("、")}`),r(C),N.length===1&&b.errors.length===0&&k.length===0){const S=N[0];S.localFiles&&t([...m.current,{source:"local",folder:S.folder||S.name,name:S.name,description:S.description,localFiles:S.localFiles}])}},E=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)},x=async b=>{if(b.preventDefault(),d.current=0,u(!1),a)return;const _=Array.from(b.dataTransfer.items).map(k=>{var N;return(N=k.webkitGetAsEntry)==null?void 0:N.call(k)}).filter(k=>k!==null);if(_.length===0){r(["请拖入包含 SKILL.md 的文件夹或一个 .zip 文件"]);return}o(!0);try{const k=(await Promise.all(_.map(S=>q6(S)))).flat(),N=_.some(S=>S.isDirectory);if(!N&&k.length===1&&k[0].file.name.toLowerCase().endsWith(".zip")){y(await bge(k[0].file));return}if(!N){r(["请拖入包含 SKILL.md 的文件夹或一个 .zip 文件"]);return}const C=new Map(k.map(({file:S,path:A})=>[S,A]));y(await Ege(k.map(({file:S})=>S),C))}catch(k){r([`读取失败:${k instanceof Error?k.message:String(k)}`])}finally{o(!1)}};return l.jsxs("div",{className:"cw-local",children:[l.jsxs("div",{className:`cw-local-dropzone ${c?"is-dragging":""}`,role:"group","aria-label":"拖入文件夹或 ZIP,自动识别 Skill",onDragEnter:E,onDragOver:b=>b.preventDefault(),onDragLeave:g,onDrop:b=>void x(b),children:[l.jsx(Ow,{className:"cw-local-drop-icon","aria-hidden":!0}),l.jsx("p",{className:"cw-local-drop-hint",children:"拖入文件夹或 ZIP,自动识别 Skill"})]}),l.jsx("p",{className:"cw-local-hint",children:"每个技能需包含 SKILL.md。支持包含多个技能的目录。"}),a&&l.jsx("p",{className:"cw-empty-line",children:"正在读取文件…"}),n.length>0&&l.jsxs("div",{className:"cw-banner",children:[l.jsx(Ka,{className:"cw-i"}),l.jsx("span",{children:n.join(";")})]}),s.length>0&&l.jsx("div",{className:"cw-skill-results",children:s.map(b=>{var k;const _=f(b.folder||b.name);return l.jsxs("button",{type:"button",className:`cw-skill-result ${_?"is-on":""}`,onClick:()=>h(b),"aria-pressed":_,children:[l.jsx("span",{className:"cw-skill-result-icon","aria-hidden":!0,children:_?l.jsx(Js,{className:"cw-i cw-i-sm"}):l.jsx(rr,{className:"cw-i cw-i-sm"})}),l.jsxs("span",{className:"cw-skill-result-meta",children:[l.jsx("span",{className:"cw-skill-result-name",children:b.name}),b.description&&l.jsx("span",{className:"cw-skill-result-desc",children:As(b.description)}),l.jsxs("span",{className:"cw-skill-result-repo",children:["本地 · ",((k=b.localFiles)==null?void 0:k.length)??0," 个文件"]})]})]},b.id)})})]})}function _ge({selected:e,onChange:t}){const[n,r]=w.useState([]),[s,i]=w.useState([]),[a,o]=w.useState(""),[c,u]=w.useState(!0),[d,f]=w.useState(!1),[h,p]=w.useState(null);w.useEffect(()=>{let g=!1;return(async()=>{u(!0),p(null);try{const x=await kM();g||(r(x),x.length>0&&o(x[0].id))}catch(x){g||p(x instanceof Error?x.message:"加载失败")}finally{g||u(!1)}})(),()=>{g=!0}},[]),w.useEffect(()=>{if(!a){i([]);return}const g=n.find(b=>b.id===a);let x=!1;return(async()=>{f(!0),p(null);try{const b=await NM(a,g==null?void 0:g.region);x||i(b)}catch(b){x||p(b instanceof Error?b.message:"加载失败")}finally{x||f(!1)}})(),()=>{x=!0}},[a,n]);const m=n.find(g=>g.id===a),y=(g,x)=>e.some(b=>b.source==="skillspace"&&b.skillId===g&&(b.version||"")===x),E=g=>{if(m)if(y(g.skillId,g.version))t(e.filter(x=>!(x.source==="skillspace"&&x.skillId===g.skillId&&(x.version||"")===g.version)));else{const x=gV(m,g);t([...e,{source:"skillspace",folder:x.folder||g.skillName,name:x.name,description:x.description,skillSpaceId:x.skillSpaceId,skillSpaceName:x.skillSpaceName,skillSpaceRegion:x.skillSpaceRegion,skillId:x.skillId,version:x.version}])}};return l.jsx("div",{className:"cw-skillspace",children:c?l.jsxs("p",{className:"cw-empty-line",children:[l.jsx(Rt,{className:"cw-i cw-spin"})," 正在加载 AgentKit Skills 中心…"]}):h?l.jsxs("div",{className:"cw-banner",children:[l.jsx(Ka,{className:"cw-i"}),l.jsx("span",{children:h})]}):n.length===0?l.jsx("p",{className:"cw-empty-line",children:"此账号下没有 AgentKit Skills 中心。"}):l.jsxs(l.Fragment,{children:[l.jsxs("div",{className:"cw-skillspace-header",children:[l.jsx("select",{className:"cw-input cw-skillspace-select",value:a,onChange:g=>o(g.target.value),"aria-label":"选择 AgentKit Skills 中心",children:n.map(g=>l.jsxs("option",{value:g.id,children:[g.name||g.id,g.region?` [${g.region}]`:"",g.description?` — ${As(g.description)}`:""]},g.id))}),m&&l.jsx("a",{href:yV(m.id,m.region),target:"_blank",rel:"noopener noreferrer",className:"cw-button cw-button-secondary cw-skillspace-console-link",title:"在火山引擎控制台打开",children:l.jsx(Iw,{className:"cw-i cw-i-sm"})})]}),d?l.jsxs("p",{className:"cw-empty-line",children:[l.jsx(Rt,{className:"cw-i cw-spin"})," 正在加载技能列表…"]}):s.length===0?l.jsx("p",{className:"cw-empty-line",children:"此 AgentKit Skills 中心暂无技能。"}):l.jsx("div",{className:"cw-skill-results",children:s.map(g=>{const x=y(g.skillId,g.version);return l.jsxs("button",{type:"button",className:`cw-skill-result ${x?"is-on":""}`,onClick:()=>E(g),"aria-pressed":x,children:[l.jsx("span",{className:"cw-skill-result-icon","aria-hidden":!0,children:x?l.jsx(Js,{className:"cw-i cw-i-sm"}):l.jsx(rr,{className:"cw-i cw-i-sm"})}),l.jsxs("span",{className:"cw-skill-result-meta",children:[l.jsxs("span",{className:"cw-skill-result-name",children:[g.skillName,g.version&&l.jsxs("span",{className:"cw-skill-result-version",children:[" ","v",g.version]})]}),g.skillDescription&&l.jsx("span",{className:"cw-skill-result-desc",children:As(g.skillDescription)}),l.jsxs("span",{className:"cw-skill-result-repo",children:[l.jsx(gH,{className:"cw-i cw-i-sm"})," ",(m==null?void 0:m.name)||a]})]})]},`${g.skillId}/${g.version}`)})})]})})}async function kge(e){const t=await fetch(e,{headers:{accept:"application/json"},signal:Gs(void 0,Kc)});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 Nge(e={}){const t=new URLSearchParams({region:e.region||"cn-beijing",page_size:String(e.pageSize??100),project:e.project||"default"});return(await kge(`/web/a2a-spaces?${t.toString()}`)).items||[]}async function Sge(e){const t=await fetch(e,{headers:{accept:"application/json"},signal:Gs(void 0,Kc)});if(t.status===409)throw new Error("服务端未配置 Volcengine AK/SK,无法访问 VikingDB 知识库");if(t.status===401)throw new Error("请先登录以访问 VikingDB 知识库");if(!t.ok){let n="";try{n=(await t.json()).detail||""}catch{}throw new Error(`请求失败 (${t.status})${n?": "+n:""}`)}return t.json()}async function Tge(e={}){const t=new URLSearchParams({region:e.region||"cn-beijing",project:e.project||"default"});return(await Sge(`/web/viking-knowledgebases?${t.toString()}`)).items||[]}const Age=w.lazy(()=>oc(()=>import("./MarkdownPromptEditor-DH4ASeh5.js"),__vite__mapDeps([0,1])));function Cge(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 rC=[{id:"type",label:"Agent 类型",hint:"选择 Agent 类型",icon:WH,required:!0},{id:"basic",label:"基本信息",hint:"名称、描述与系统提示词",icon:Ka,required:!0},{id:"model",label:"模型配置",hint:"模型与服务(可选)",icon:bH},{id:"tools",label:"工具",hint:"可调用的能力",icon:RL},{id:"skills",label:"技能",hint:"声明式技能",icon:Po},{id:"knowledge",label:"知识库",hint:"外部知识检索",icon:vp},{id:"advanced",label:"进阶配置",hint:"记忆与观测",icon:AL},{id:"subagents",label:"子 Agent",hint:"嵌套协作",icon:wL},{id:"review",label:"完成",hint:"预览并创建",icon:VH}];function Ige({className:e}){return l.jsxs("svg",{className:e,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"1.8",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",children:[l.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"}),l.jsx("path",{d:"M5.75 8.25v7.5",opacity:"0.8"}),l.jsx("path",{d:"M3 10v4",opacity:"0.45"}),l.jsx("path",{d:"M17.9 5.25v2.2M19 6.35h-2.2",strokeWidth:"1.55"})]})}function X6({className:e}){return l.jsx("svg",{className:e,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",children:l.jsx("path",{d:"m7 9 5 5 5-5"})})}function Q6({className:e}){return l.jsxs("svg",{className:e,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"1.75",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",children:[l.jsx("path",{d:"M18.25 8.2A7.1 7.1 0 0 0 6.1 6.65L4.5 8.25"}),l.jsx("path",{d:"M4.5 4.75v3.5H8"}),l.jsx("path",{d:"M5.75 15.8A7.1 7.1 0 0 0 17.9 17.35l1.6-1.6"}),l.jsx("path",{d:"M19.5 19.25v-3.5H16"})]})}const Oge={llm:"智能体",sequential:"分步协作",parallel:"同时处理",loop:"循环执行",a2a:"远程智能体"},sC={llm:"理解任务并完成一个具体工作",sequential:"内部步骤按照顺序依次执行",parallel:"内部步骤同时工作,完成后统一汇总",loop:"重复执行内部步骤,直到满足停止条件",a2a:"调用已经存在的远程 Agent"},iC={REGISTRY_SPACE_ID:"registrySpaceId",REGISTRY_TOP_K:"registryTopK",REGISTRY_REGION:"registryRegion",REGISTRY_ENDPOINT:"registryEndpoint"},Z6="REGISTRY_SPACE_ID",Rge=SM.filter(e=>e.key!==Z6);function J6(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())||qs.topK,n.REGISTRY_REGION=((s=e.registryRegion)==null?void 0:s.trim())||qs.region,n.REGISTRY_ENDPOINT=((i=e.registryEndpoint)==null?void 0:i.trim())||qs.endpoint):(n.REGISTRY_TOP_K=e.registryTopK??"",n.REGISTRY_REGION=e.registryRegion??"",n.REGISTRY_ENDPOINT=e.registryEndpoint??""),n}function aC({items:e,selected:t,onToggle:n,scrollRows:r}){return l.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 l.jsxs("button",{type:"button",className:`cw-check ${i?"is-on":""}`,onClick:()=>n(s.id),"aria-pressed":i,children:[l.jsx("span",{className:"cw-check-box","aria-hidden":!0,children:i&&l.jsx(Js,{className:"cw-i cw-i-sm"})}),l.jsxs("span",{className:"cw-check-text",children:[l.jsx("span",{className:"cw-check-title",children:s.label}),l.jsx("span",{className:"cw-check-desc",children:As(s.desc)})]})]},s.id)})})}function pb({options:e,value:t,onChange:n}){return l.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 l.jsxs("button",{type:"button",className:`cw-seg ${s?"is-on":""}`,onClick:()=>n(r.id),"aria-pressed":s,title:As(r.desc),children:[l.jsx("span",{className:"cw-seg-title",children:r.label}),l.jsx("span",{className:"cw-seg-desc",children:As(r.desc)})]},r.id)})})}function Lge(e){return/(SECRET|PASSWORD|KEY|TOKEN)$/.test(e)}function yl({env:e,values:t,onChange:n}){return e.length===0?l.jsx("p",{className:"cw-env-empty",children:"此后端无需额外运行参数。"}):l.jsx("div",{className:"cw-env-fields",children:e.map(r=>l.jsxs("label",{className:"cw-env-field",children:[l.jsxs("span",{className:"cw-env-field-head",children:[l.jsxs("span",{className:"cw-env-field-label",children:[r.comment||r.key,r.required&&l.jsx("span",{className:"cw-req",children:"*"})]}),r.comment&&l.jsx("code",{title:r.key,children:r.key})]}),l.jsx("input",{className:"cw-input",type:Lge(r.key)?"password":"text",value:t[r.key]??"",placeholder:r.placeholder||"请输入参数值",autoComplete:"off",onChange:s=>n(r.key,s.currentTarget.value)})]},r.key))})}function mb(e){return e.name.trim()||"未命名智能体中心"}function gb(e){return e.name.trim()||e.id||"未命名知识库"}function Mge({value:e,region:t,invalid:n,onChange:r}){const s=t.trim()||qs.region,[i,a]=w.useState([]),[o,c]=w.useState(!1),[u,d]=w.useState(null),[f,h]=w.useState(0),[p,m]=w.useState(!1),[y,E]=w.useState(""),g=w.useRef(null);w.useEffect(()=>{let A=!1;return c(!0),d(null),Nge({region:s}).then(O=>{A||a(O)}).catch(O=>{A||(a([]),d(O instanceof Error?O.message:"加载失败"))}).finally(()=>{A||c(!1)}),()=>{A=!0}},[s,f]);const x=!e||i.some(A=>A.id===e.trim()),b=i.find(A=>A.id===e.trim()),_=b?mb(b):e&&!x?"已选择的智能体中心":"请选择智能体中心",k=o&&i.length===0,N=w.useMemo(()=>i.filter(A=>tg(y,[mb(A),A.id,A.projectName])),[y,i]),C=!!(e&&!x&&tg(y,["已选择的智能体中心",e]));w.useEffect(()=>{if(!p)return;const A=D=>{const U=D.target;U instanceof Node&&g.current&&!g.current.contains(U)&&m(!1)},O=D=>{D.key==="Escape"&&m(!1)};return window.addEventListener("pointerdown",A),window.addEventListener("keydown",O),()=>{window.removeEventListener("pointerdown",A),window.removeEventListener("keydown",O)}},[p]);const S=A=>{r(A),m(!1)};return l.jsxs("div",{className:"cw-a2a-space-picker",ref:g,children:[l.jsxs("div",{className:"cw-a2a-space-row",children:[l.jsxs("div",{className:"cw-a2a-space-select-wrap",children:[l.jsxs("button",{type:"button",className:`cw-a2a-space-trigger ${n?"is-error":""}`,disabled:k,"aria-haspopup":"listbox","aria-expanded":p,"aria-label":"选择 AgentKit 智能体中心",onClick:()=>{E(""),m(A=>!A)},children:[l.jsx("span",{className:e?void 0:"is-placeholder",children:_}),l.jsx(X6,{className:"cw-a2a-space-trigger-icon"})]}),p&&l.jsxs("div",{className:"cw-a2a-space-menu",children:[l.jsx("div",{className:"cw-picker-search",children:l.jsx("input",{className:"cw-picker-search-input",type:"search",value:y,autoFocus:!0,autoComplete:"off","aria-label":"搜索 AgentKit 智能体中心",placeholder:"搜索名称或 ID",onChange:A=>E(A.currentTarget.value)})}),l.jsxs("div",{className:"cw-picker-options",role:"listbox","aria-label":"AgentKit 智能体中心",children:[C&&l.jsx("button",{type:"button",role:"option","aria-selected":!0,className:"cw-a2a-space-option is-selected",onClick:()=>S(e),children:"已选择的智能体中心"}),N.map(A=>{const O=mb(A),D=A.id===e;return l.jsx("button",{type:"button",role:"option","aria-selected":D,className:`cw-a2a-space-option ${D?"is-selected":""}`,title:`${O} (${A.id})`,onClick:()=>S(A.id),children:O},A.id)}),!C&&N.length===0&&l.jsx("div",{className:"cw-picker-empty",children:"未找到匹配的智能体中心"})]})]})]}),l.jsx("button",{type:"button",className:"cw-icon-btn cw-a2a-space-refresh",title:"刷新智能体中心列表","aria-label":"刷新智能体中心列表",disabled:o,onClick:()=>h(A=>A+1),children:o?l.jsx(Rt,{className:"cw-i cw-i-sm cw-spin"}):l.jsx(Q6,{className:"cw-i cw-i-sm"})})]}),u?l.jsxs("div",{className:"cw-banner cw-a2a-space-error",children:[l.jsx(Ka,{className:"cw-i"}),l.jsx("span",{children:u})]}):o?l.jsxs("span",{className:"cw-help cw-a2a-space-status",children:[l.jsx(Rt,{className:"cw-i cw-i-sm cw-spin"}),"正在加载 AgentKit 智能体中心…"]}):i.length===0?l.jsx("span",{className:"cw-help",children:"此账号下暂无 AgentKit 智能体中心。"}):l.jsxs("span",{className:"cw-help",children:["已加载 ",i.length," 个智能体中心,列表仅展示中心名称。"]})]})}function jge({value:e,onChange:t}){const[n,r]=w.useState([]),[s,i]=w.useState(!1),[a,o]=w.useState(null),[c,u]=w.useState(0),[d,f]=w.useState(!1),[h,p]=w.useState(""),m=w.useRef(null);w.useEffect(()=>{let N=!1;return i(!0),o(null),Tge().then(C=>{N||r(C)}).catch(C=>{N||(r([]),o(C instanceof Error?C.message:"加载失败"))}).finally(()=>{N||i(!1)}),()=>{N=!0}},[c]);const y=!e||n.some(N=>N.id===e.trim()),E=n.find(N=>N.id===e.trim()),g=E?gb(E):e&&!y?e:"请选择 VikingDB 知识库",x=s&&n.length===0,b=w.useMemo(()=>n.filter(N=>tg(h,[gb(N),N.id,N.description,N.projectName])),[n,h]),_=!!(e&&!y&&tg(h,[e]));w.useEffect(()=>{if(!d)return;const N=S=>{const A=S.target;A instanceof Node&&m.current&&!m.current.contains(A)&&f(!1)},C=S=>{S.key==="Escape"&&f(!1)};return window.addEventListener("pointerdown",N),window.addEventListener("keydown",C),()=>{window.removeEventListener("pointerdown",N),window.removeEventListener("keydown",C)}},[d]);const k=N=>{t(N),f(!1)};return l.jsxs("div",{className:"cw-a2a-space-picker cw-viking-kb-picker",ref:m,children:[l.jsxs("div",{className:"cw-a2a-space-row",children:[l.jsxs("div",{className:"cw-a2a-space-select-wrap",children:[l.jsxs("button",{type:"button",className:"cw-a2a-space-trigger",disabled:x,"aria-haspopup":"listbox","aria-expanded":d,"aria-label":"选择 VikingDB 知识库",onClick:()=>{p(""),f(N=>!N)},children:[l.jsx("span",{className:e?void 0:"is-placeholder",children:g}),l.jsx(X6,{className:"cw-a2a-space-trigger-icon"})]}),d&&l.jsxs("div",{className:"cw-a2a-space-menu cw-viking-kb-menu",children:[l.jsx("div",{className:"cw-picker-search",children:l.jsx("input",{className:"cw-picker-search-input",type:"search",value:h,autoFocus:!0,autoComplete:"off","aria-label":"搜索 VikingDB 知识库",placeholder:"搜索名称或 ID",onChange:N=>p(N.currentTarget.value)})}),l.jsxs("div",{className:"cw-picker-options",role:"listbox","aria-label":"VikingDB 知识库",children:[_&&l.jsx("button",{type:"button",role:"option","aria-selected":!0,className:"cw-a2a-space-option is-selected",onClick:()=>k(e),children:e}),b.map(N=>{const C=gb(N),S=N.id===e;return l.jsx("button",{type:"button",role:"option","aria-selected":S,className:`cw-a2a-space-option ${S?"is-selected":""}`,title:`${C} (${N.id})`,onClick:()=>k(N.id),children:C},N.id)}),!_&&b.length===0&&l.jsx("div",{className:"cw-picker-empty",children:"未找到匹配的知识库"})]})]})]}),l.jsx("button",{type:"button",className:"cw-icon-btn cw-a2a-space-refresh cw-viking-kb-refresh",title:"刷新知识库列表","aria-label":"刷新知识库列表",disabled:s,onClick:()=>u(N=>N+1),children:s?l.jsx(Rt,{className:"cw-i cw-i-sm cw-spin"}):l.jsx(Q6,{className:"cw-i cw-i-sm"})})]}),a?l.jsxs("div",{className:"cw-banner cw-a2a-space-error",children:[l.jsx(Ka,{className:"cw-i"}),l.jsx("span",{children:a})]}):s?l.jsxs("span",{className:"cw-help cw-a2a-space-status",children:[l.jsx(Rt,{className:"cw-i cw-i-sm cw-spin"}),"正在加载 VikingDB 知识库…"]}):n.length===0?l.jsx("span",{className:"cw-help",children:"此账号下暂无 VikingDB 知识库。"}):l.jsxs("span",{className:"cw-help",children:["已加载 ",n.length," 个知识库,选择的知识库会用于当前 Agent。"]})]})}function Dge({tools:e,onChange:t}){const n=(i,a)=>t(e.map((o,c)=>c===i?{...o,...a}:o)),r=i=>t(e.filter((a,o)=>o!==i)),s=()=>t([...e,{name:"",transport:"http",url:""}]);return l.jsxs("div",{className:"cw-mcp",children:[e.length>0&&l.jsx("div",{className:"cw-mcp-list",children:l.jsx(pi,{initial:!1,children:e.map((i,a)=>l.jsxs($t.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:[l.jsxs("div",{className:"cw-mcp-rowhead",children:[l.jsxs("div",{className:"cw-mcp-transport",children:[l.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:l.jsx("span",{className:"cw-seg-title",children:"HTTP"})}),l.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:l.jsx("span",{className:"cw-seg-title",children:"stdio"})})]}),l.jsx("button",{type:"button",className:"cw-icon-btn cw-icon-danger",onClick:()=>r(a),"aria-label":"移除 MCP 工具",children:l.jsx(ea,{className:"cw-i cw-i-sm"})})]}),l.jsx("input",{className:"cw-input",value:i.name,placeholder:"名称(用于命名,可留空)",onChange:o=>n(a,{name:o.target.value})}),i.transport==="http"?l.jsxs(l.Fragment,{children:[l.jsx("input",{className:"cw-input",value:i.url??"",placeholder:"MCP 服务地址(StreamableHTTP)",onChange:o=>n(a,{url:o.target.value})}),l.jsx("input",{className:"cw-input",value:i.authToken??"",placeholder:"Bearer Token(可选)",onChange:o=>n(a,{authToken:o.target.value})})]}):l.jsxs(l.Fragment,{children:[l.jsx("input",{className:"cw-input",value:i.command??"",placeholder:"启动命令,例如 npx",onChange:o=>n(a,{command:o.target.value})}),l.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)})}),l.jsx("p",{className:"cw-mcp-note",children:"stdio MCP 暂不参与调试运行;点击“去部署”时会完整保留这项配置并生成对应代码。"})]})]},a))})}),l.jsxs("button",{type:"button",className:"cw-add-sub",onClick:s,children:[l.jsx(rr,{className:"cw-i"}),"添加 MCP 工具"]}),e.length===0&&l.jsx("p",{className:"cw-empty-line",children:"暂无 MCP 工具,点击「添加 MCP 工具」连接外部 MCP 服务。"})]})}function e5({className:e}){return l.jsxs("svg",{className:e,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"1.7",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":!0,children:[l.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"}),l.jsx("path",{d:"M7 4.75h9.5a2 2 0 0 1 2 2",opacity:".58"}),l.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"}),l.jsx("path",{d:"M19.25 11.25h1.5M20 10.5V12",opacity:".72"})]})}function Pge({s:e,onRemove:t}){let n=Po,r="火山 Find Skill 技能广场";return e.source==="local"?(n=Ow,r="本地"):e.source==="skillspace"&&(n=e5,r="AgentKit Skills 中心"),l.jsxs($t.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:[l.jsx("span",{className:"cw-selected-skill-icon","aria-hidden":!0,children:l.jsx(n,{className:"cw-i cw-i-sm"})}),l.jsxs("span",{className:"cw-selected-skill-meta",children:[l.jsx("span",{className:"cw-selected-skill-name",children:e.name}),l.jsxs("span",{className:"cw-selected-skill-detail",children:[r,e.description?` · ${As(e.description)}`:""]})]}),l.jsx("button",{type:"button",className:"cw-selected-skill-remove",onClick:t,"aria-label":`移除 ${e.name}`,title:`移除 ${e.name}`,children:l.jsx(zr,{className:"cw-i cw-i-sm"})})]},`${e.source}:${e.folder}:${e.skillId||e.slug||""}:${e.version||""}`)}const yb=[{id:"local",label:"本地文件",icon:Ow},{id:"skillspace",label:"AgentKit Skills 中心",icon:e5},{id:"skillhub",label:"火山 Find Skill 技能广场",icon:Cg}];function Bge({selected:e,onChange:t}){const[n,r]=w.useState("local"),[s,i]=w.useState(!1),a=yb.findIndex(c=>c.id===n),o=c=>t(e.filter(u=>bb(u)!==c));return w.useEffect(()=>{if(!s)return;const c=u=>{u.key==="Escape"&&i(!1)};return window.addEventListener("keydown",c),()=>window.removeEventListener("keydown",c)},[s]),l.jsxs("div",{className:"cw-skillspane",children:[l.jsxs("button",{type:"button",className:"cw-skill-add","aria-haspopup":"dialog",onClick:()=>i(!0),children:[l.jsx("span",{className:"cw-skill-add-icon","aria-hidden":!0,children:l.jsx(rr,{className:"cw-i"})}),l.jsx("span",{children:"添加 Skill"})]}),e.length>0&&l.jsxs("div",{className:"cw-skill-selected",children:[l.jsxs("span",{className:"cw-skill-selected-label",children:["已加入技能 · ",e.length]}),l.jsx("div",{className:"cw-selected-skill-list",children:l.jsx(pi,{initial:!1,children:e.map(c=>l.jsx(Pge,{s:c,onRemove:()=>o(bb(c))},bb(c)))})})]}),l.jsx(pi,{children:s&&l.jsx($t.div,{className:"cw-skill-dialog-backdrop",initial:{opacity:0},animate:{opacity:1},exit:{opacity:0},transition:{duration:.16},onMouseDown:c=>{c.target===c.currentTarget&&i(!1)},children:l.jsxs($t.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:[l.jsxs("div",{className:"cw-skill-dialog-head",children:[l.jsx("h3",{id:"cw-skill-dialog-title",children:"添加 Skill"}),l.jsx("button",{type:"button",className:"cw-skill-dialog-close","aria-label":"关闭添加 Skill",onClick:()=>i(!1),children:l.jsx(zr,{className:"cw-i"})})]}),l.jsxs("div",{className:"cw-skill-dialog-body",children:[l.jsxs("div",{className:"cw-skill-sourcetabs",role:"tablist",style:{"--cw-skill-tab-slider-width":`calc((100% - 16px) / ${yb.length})`,"--cw-active-skill-tab-offset":`calc(${a*100}% + ${a*4}px)`},children:[l.jsx("span",{className:"cw-skill-tab-slider","aria-hidden":!0}),yb.map(({id:c,label:u,icon:d})=>l.jsxs("button",{type:"button",role:"tab",id:`cw-skill-tab-${c}`,"aria-controls":"cw-skill-tabpanel","aria-selected":n===c,className:`cw-skill-pickertab ${n===c?"is-on":""}`,onClick:()=>r(c),children:[l.jsx(d,{className:"cw-i cw-i-sm"}),u]},c))]}),l.jsxs("div",{id:"cw-skill-tabpanel",className:"cw-skill-tabbody",role:"tabpanel","aria-labelledby":`cw-skill-tab-${n}`,children:[n==="skillhub"&&l.jsx(dge,{selected:e,onChange:t}),n==="local"&&l.jsx(vge,{selected:e,onChange:t}),n==="skillspace"&&l.jsx(_ge,{selected:e,onChange:t})]})]})]})})})]})}function bb(e){return e.source==="skillhub"?`hub:${e.namespace}/${e.slug}`:e.source==="local"?`local:${e.folder}`:`ss:${e.skillSpaceId}/${e.skillId}/${e.version||""}`}function Iu({checked:e,onChange:t,title:n,desc:r,icon:s}){return l.jsxs("button",{type:"button",className:`cw-toggle ${e?"is-on":""}`,onClick:()=>t(!e),"aria-pressed":e,children:[l.jsx("span",{className:"cw-toggle-icon",children:l.jsx(s,{className:"cw-i"})}),l.jsxs("span",{className:"cw-toggle-text",children:[l.jsx("span",{className:"cw-toggle-title",children:n}),l.jsx("span",{className:"cw-toggle-desc",children:As(r)})]}),l.jsx("span",{className:"cw-switch","aria-hidden":!0,children:l.jsx($t.span,{className:"cw-switch-knob",layout:!0,transition:{type:"spring",stiffness:520,damping:34}})})]})}function Fge(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 sp(e,t){let n=e;for(const r of t)n=n.subAgents[r];return n}function Gf(e,t,n){if(t.length===0)return n(e);const[r,...s]=t,i=e.subAgents.slice();return i[r]=Gf(i[r],s,n),{...e,subAgents:i}}function Uge(e,t){return Gf(e,t,n=>({...n,subAgents:[...n.subAgents,Sr()]}))}function $ge(e,t,n){return Gf(e,t,r=>{const s=r.subAgents.slice();return s.splice(n,0,Sr()),{...r,subAgents:s}})}function Hge(e,t){if(t.length===0)return e;const n=t.slice(0,-1),r=t[t.length-1];return Gf(e,n,s=>({...s,subAgents:s.subAgents.filter((i,a)=>a!==r)}))}const GE=e=>!b0(e.agentType),oC=3;function zge(e,t,n=!1){var s;if(b0(e.agentType))return n?"远程 Agent 只能作为子 Agent":(s=e.a2aRegistry)!=null&&s.registrySpaceId.trim()?null:"缺少 AgentKit 智能体中心";const r=lc(e.name);return r||(t.has(e.name)?"Agent 名称在当前结构中必须唯一":e.description.trim().length===0?"缺少描述":K6(e.agentType)?e.subAgents.length===0?"缺少子 Agent":null:e.instruction.trim().length===0?"缺少系统提示词":null)}function t5(e,t,n=[]){const r=[],s=b0(e.agentType),i=zge(e,t,n.length===0);return i&&r.push({path:n,name:s?"远程 Agent":e.name.trim()||"未命名",problem:i}),GE(e)&&e.subAgents.forEach((a,o)=>r.push(...t5(a,t,[...n,o]))),r}function n5(e){return 1+e.subAgents.reduce((t,n)=>t+n5(n),0)}function r5(e){const t=[],n={},r=i=>{var a,o,c,u;for(const d of i.builtinTools??[]){const f=vc.find(h=>h.id===d);f&&t.push({env:f.env})}if((a=i.a2aRegistry)!=null&&a.enabled&&(t.push({env:SM}),Object.assign(n,J6(i.a2aRegistry,{includeDefaults:!0}))),i.memory.shortTerm&&t.push({env:((o=Q1.find(d=>d.id===(i.shortTermBackend??"local")))==null?void 0:o.env)??[]}),i.memory.longTerm&&t.push({env:((c=Z1.find(d=>d.id===(i.longTermBackend??"local")))==null?void 0:c.env)??[]}),i.knowledgebase&&t.push({env:((u=J1.find(d=>d.id===(i.knowledgebaseBackend??Gd)))==null?void 0:u.env)??[]}),i.tracing)for(const d of i.tracingExporters??[]){const f=eE.find(h=>h.id===d);f&&t.push({env:f.env,enableFlag:f.enableFlag})}i.subAgents.forEach(r)};r(e);const s=$6(t);return{specs:s.specs,fixedValues:{...s.fixedValues,...n}}}function s5(e){var t;return{...e,deployment:{feishuEnabled:!!((t=e.deployment)!=null&&t.feishuEnabled)}}}function Vge(e){var n;const t=e.name.trim();return t||(e.agentType!=="sequential"?"":((n=e.subAgents.find(r=>r.name.trim()))==null?void 0:n.name.trim())??"")}function i5(e){var r,s;const t=r5(e),n={...((r=e.deployment)==null?void 0:r.envValues)??{},...t.fixedValues};return{...s5(e),deployment:{feishuEnabled:!!((s=e.deployment)!=null&&s.feishuEnabled),envValues:Object.fromEntries(H6(t.specs,n).map(({key:i,value:a})=>[i,a]))}}}function Kge(e){return JSON.stringify(i5(e))}function ng(e,t){return JSON.stringify({draftSnapshot:e,modelName:t.modelName,description:t.description,instruction:t.instruction,optimizations:t.optimizations})}function Gl(e){return JSON.stringify({modelName:e.modelName.trim(),description:e.description.trim(),instruction:e.instruction.trim(),optimizations:e.optimizations})}function Yge({enabled:e,disabledReason:t,variants:n,draftSnapshot:r,input:s,onInput:i,onSend:a,onStartVariant:o,onDeployVariant:c,onAddVariant:u,onRemoveVariant:d,onToggleConfig:f,onCompleteConfig:h,onConfigChange:p}){const m=n.filter(g=>g.phase!=="ready"?!1:g.runtimeSnapshot===ng(r,g)),y=n.some(g=>g.phase==="sending"),E=m.length>0&&!y;return l.jsxs("section",{className:"cw-ab-workspace","aria-label":"A/B 调试工作台",children:[l.jsx("div",{className:"cw-ab-stage",children:e?l.jsxs("div",{className:"cw-ab-grid",children:[n.map((g,x)=>{const b=g.modelName.trim(),_=g.description.trim(),k=g.instruction.trim(),N=Gl(g),C=!!(b&&_&&k&&n.findIndex(T=>Gl(T)===N)!==x),S=!b||!_||!k||C,A=!!(g.runtimeSnapshot&&g.runtimeSnapshot!==ng(r,g)),O=g.phase==="starting",D=g.phase==="ready"&&!A,U=O||g.phase==="sending",X=U||g.configOpen||S,M=b?_?k?C?"该配置与已有测试组相同":"":"请填写系统提示词":"请填写描述":"请先选择模型",j=O?"正在启动":A?"应用配置并重启":D||g.phase==="error"?"重新启动环境":"启动环境";return l.jsx("article",{className:"cw-ab-card",children:l.jsxs("div",{className:`cw-ab-card-inner${g.configOpen?" is-flipped":""}`,children:[l.jsxs("section",{className:"cw-ab-card-face cw-ab-card-front","aria-hidden":g.configOpen,children:[l.jsxs("header",{className:"cw-ab-card-head",children:[l.jsxs("div",{className:"cw-ab-card-title",children:[l.jsx("strong",{children:g.name}),l.jsx("span",{children:g.modelName||"默认模型"})]}),l.jsxs("div",{className:"cw-ab-card-actions",children:[l.jsx("button",{type:"button",className:"cw-ab-config-trigger",disabled:g.configOpen||U,onClick:()=>f(g.id),children:"测试配置"}),g.id!=="baseline"&&l.jsx("button",{type:"button",className:"cw-ab-remove","aria-label":`删除${g.name}`,disabled:g.configOpen||U,onClick:()=>d(g.id),children:l.jsx(ea,{className:"cw-i"})})]})]}),l.jsx("div",{className:"cw-ab-conversation",children:g.error?l.jsx(eg,{message:g.error,className:"cw-debug-error-detail",onRetry:async()=>{await o(g.id)}}):O?l.jsxs("div",{className:"cw-ab-empty cw-ab-starting",children:[l.jsx(Rt,{className:"cw-i cw-spin"}),l.jsx("span",{children:"正在创建独立测试环境"})]}):A?l.jsxs("div",{className:"cw-ab-empty cw-ab-launch",children:[l.jsx("span",{children:"配置已变更,请重新启动此环境"}),l.jsxs("button",{type:"button",className:"cw-ab-start",disabled:X,onClick:()=>o(g.id),children:[l.jsx(H1,{className:"cw-i"}),j]})]}):g.messages.length===0?l.jsxs("div",{className:"cw-ab-empty cw-ab-launch",children:[l.jsxs("button",{type:"button",className:"cw-ab-start",disabled:X,title:M||void 0,onClick:()=>o(g.id),children:[D?l.jsx(H1,{className:"cw-i"}):l.jsx(Ige,{className:"cw-i cw-debug-run-icon"}),j]}),M?l.jsx("span",{className:"cw-ab-launch-hint",children:M}):D?l.jsx("span",{className:"cw-ab-launch-hint",children:"等待测试输入"}):null]}):g.messages.map((T,L)=>l.jsx("div",{className:`cw-debug-msg cw-debug-msg-${T.role}`,children:l.jsx("div",{className:"cw-debug-content",children:T.role==="user"?T.content:T.error?l.jsx(eg,{message:T.error,className:"cw-debug-msg-error"}):T.blocks&&T.blocks.length>0?l.jsx(Yv,{blocks:T.blocks,onAction:()=>{}}):T.content?T.content:L===g.messages.length-1&&g.phase==="sending"?l.jsx(Y4,{}):null})},L))}),l.jsx("footer",{className:"cw-ab-deploy-footer",children:l.jsx("button",{type:"button",className:"cw-ab-deploy",disabled:U||!b,onClick:()=>c(g.id),children:"部署该配置"})})]}),l.jsxs("section",{className:"cw-ab-card-face cw-ab-card-back","aria-hidden":!g.configOpen,children:[l.jsxs("header",{className:"cw-ab-config-head",children:[l.jsxs("div",{children:[l.jsx("strong",{children:"测试配置"}),l.jsx("span",{children:g.name})]}),l.jsxs("span",{className:`cw-ab-config-done-wrap${M?" is-disabled":""}`,tabIndex:M?0:void 0,children:[l.jsx("button",{type:"button",className:"cw-ab-config-done",disabled:!g.configOpen||S,onClick:()=>h(g.id),children:g.id==="baseline"?"完成配置":"完成并启动"}),M&&l.jsx("span",{className:"cw-ab-config-done-tip",role:"tooltip",children:M})]})]}),l.jsxs("div",{className:"cw-ab-config",children:[l.jsxs("label",{children:[l.jsx("span",{children:"模型"}),l.jsx("input",{value:g.modelName,placeholder:"使用 Agent 当前模型",disabled:!g.configOpen,onChange:T=>p(g.id,"modelName",T.target.value)})]}),l.jsxs("label",{children:[l.jsx("span",{children:"描述"}),l.jsx("textarea",{rows:2,value:g.description,disabled:!g.configOpen,onChange:T=>p(g.id,"description",T.target.value)})]}),l.jsxs("label",{children:[l.jsx("span",{children:"系统提示词"}),l.jsx("textarea",{rows:5,value:g.instruction,disabled:!g.configOpen,onChange:T=>p(g.id,"instruction",T.target.value)})]}),l.jsxs("fieldset",{className:"cw-ab-optimizations-disabled",children:[l.jsxs("legend",{children:[l.jsx("span",{children:"优化选项"}),l.jsx("em",{children:"待开放"})]}),l.jsx("div",{className:"cw-ab-optimization-list",children:a5.map(T=>l.jsxs("label",{children:[l.jsx("input",{type:"checkbox",checked:g.optimizations.includes(T.id),disabled:!0}),l.jsx("span",{children:T.label})]},T.id))})]}),l.jsx("p",{children:"设置完成后返回正面,再启动当前测试环境。"})]})]})]})},g.id)}),n.length<3&&l.jsxs("button",{type:"button",className:"cw-ab-add",onClick:u,children:[l.jsx(rr,{className:"cw-i"}),l.jsx("strong",{children:"添加对照组"}),l.jsx("span",{children:"最多同时创建 3 个测试组"})]})]}):l.jsx("div",{className:"cw-debug-empty",children:t})}),l.jsx("div",{className:"cw-ab-composer",children:l.jsxs("div",{className:"cw-debug-composerbox",children:[l.jsx("textarea",{className:"cw-debug-input",rows:1,value:s,placeholder:E?"输入测试消息,将发送到所有已启动测试组...":"请先启动至少一个测试组",disabled:!E,onChange:g=>i(g.target.value),onKeyDown:g=>{W4(g.nativeEvent)||g.key==="Enter"&&!g.shiftKey&&(g.preventDefault(),a())}}),l.jsx("button",{type:"button",className:"cw-debug-send",title:"发送",disabled:!E||!s.trim(),onClick:a,children:y?l.jsx(Rt,{className:"cw-i cw-spin"}):l.jsx(EL,{className:"cw-i"})})]})})]})}const lC=[{id:"build",label:"构建"},{id:"validate",label:"调试"},{id:"publish",label:"发布"}],a5=[{id:"context",label:"上下文优化",description:"压缩历史对话,保留与当前任务相关的信息"},{id:"grounding",label:"幻觉抑制",description:"对不确定内容要求依据,并明确表达未知"},{id:"tools",label:"工具调用优化",description:"减少重复调用,优先复用可信的工具结果"},{id:"latency",label:"响应加速",description:"缓存稳定上下文,降低重复推理开销"}];function Wge({mode:e,agentName:t,busy:n,onChange:r,onDiscard:s}){const i=lC.findIndex(a=>a.id===e);return l.jsxs("header",{className:"cw-workspace-header",children:[l.jsx("div",{className:"cw-workspace-identity",children:l.jsx("strong",{title:t,children:t||"未命名 Agent"})}),l.jsx("nav",{className:"cw-workspace-stepper","aria-label":"Agent 创建步骤",children:lC.map((a,o)=>{const c=a.id===e,u=or(a.id),children:l.jsx("strong",{children:a.label})},a.id)})}),s&&l.jsx("div",{className:"cw-workspace-actions",children:l.jsx("button",{type:"button",className:"cw-discard-edit",disabled:n,onClick:s,children:"放弃编辑"})})]})}function Gge({onBack:e,onCreate:t,onAgentAdded:n,initialDraft:r,features:s,onDeploymentTaskChange:i,deploymentTarget:a,onDeploymentComplete:o,onDeploymentStarted:c,onDraftChange:u,onDiscard:d}){var cs,Kr,Ga,qa,Xa,Si,Hn,Qa,Ti,Xf,Qf,nl,rl,sl,Zf;const[f,h]=w.useState(()=>r??Sr()),p=w.useRef(JSON.stringify(f)),m=w.useRef(p.current),y=JSON.stringify(f),E=y!==p.current,g=w.useRef(u);w.useEffect(()=>{g.current=u},[u]),w.useEffect(()=>{var q;y!==m.current&&(m.current=y,(q=g.current)==null||q.call(g,f,E))},[f,E,y]);const[x,b]=w.useState("build"),[_,k]=w.useState(!1),[N,C]=w.useState(!1),[S,A]=w.useState(0),[O,D]=w.useState(null),[U,X]=w.useState(!1),[M,j]=w.useState((a==null?void 0:a.region)??"cn-beijing"),T=(s==null?void 0:s.generatedAgentTestRun)===!0,L=(s==null?void 0:s.generatedAgentTestRunDisabledReason)||"当前后端暂不支持生成 Agent 调试运行。",[R,F]=w.useState(()=>[{id:"baseline",name:"基准组",modelName:(r??Sr()).modelName??"",description:(r??Sr()).description,instruction:(r??Sr()).instruction,optimizations:[],configOpen:!1,phase:"idle",runtimeSnapshot:"",messages:[],error:null}]),[I,V]=w.useState("baseline"),W=w.useRef(1),P=w.useRef(new Map),[ie,G]=w.useState(0),[re,ue]=w.useState(""),[ee,le]=w.useState("basic"),[ne,me]=w.useState(""),[ye,te]=w.useState(!1),[de,Ee]=w.useState(!1),[Te,Ke]=w.useState(!1),[Ne,it]=w.useState(!1),[He,Ue]=w.useState([]),Et=w.useRef(null),rt=w.useRef({});w.useEffect(()=>()=>{for(const{run:q}of P.current.values())Fu(q.runId).catch(pe=>console.warn("清理调试运行失败",pe));P.current.clear()},[]);const St=w.useRef(null);St.current||(St.current=({meta:q,children:pe})=>l.jsxs("section",{ref:ve=>{rt.current[q.id]=ve},id:`cw-sec-${q.id}`,"data-step-id":q.id,className:"cw-section",children:[l.jsx("header",{className:"cw-sec-head",children:l.jsxs("h2",{className:"cw-sec-title",children:[q.label,q.required&&l.jsx("span",{className:"cw-sec-required",children:"必填"})]})}),pe]}));const ct=Fge(f,He)?He:[],B=sp(f,ct),Q=ct.length===0,oe=`cw-model-advanced-${ct.join("-")||"root"}`,be=`cw-a2a-registry-advanced-${ct.join("-")||"root"}`,Oe=`cw-more-tool-types-${ct.join("-")||"root"}`,Ye=`cw-advanced-config-${ct.join("-")||"root"}`,tt=q=>h(pe=>Gf(pe,ct,ve=>({...ve,...q}))),ze=(q,pe)=>h(ve=>{var Qe;return{...ve,deployment:{...ve.deployment??{feishuEnabled:!1},envValues:{...((Qe=ve.deployment)==null?void 0:Qe.envValues)??{},[q]:pe}}}}),Tt=q=>tt({a2aRegistry:{...B.a2aRegistry??{enabled:!1,registrySpaceId:"",registryTopK:"",registryRegion:"",registryEndpoint:""},...q}}),Re=(q,pe)=>{if(!(q in iC))return;const ve=iC[q];Tt({[ve]:pe}),ze(q,pe)},kt=q=>{if(!(Q&&q==="a2a")){if(q==="a2a"){tt({agentType:q,a2aRegistry:{...B.a2aRegistry??{registrySpaceId:"",registryTopK:"",registryRegion:"",registryEndpoint:""},enabled:!0}});return}tt({agentType:q,a2aRegistry:B.a2aRegistry?{...B.a2aRegistry,enabled:!1}:void 0})}},Pt=(q,pe)=>{h(q),pe&&Ue(pe)},Bt=q=>{const pe=sp(f,q);if(!GE(pe)||q.length>=oC)return;const ve=Uge(f,q),Qe=sp(ve,q).subAgents.length-1;Pt(ve,[...q,Qe])},bn=(q,pe)=>{const ve=sp(f,q);if(!GE(ve)||q.length>=oC)return;const Qe=Math.max(0,Math.min(pe,ve.subAgents.length)),Mt=$ge(f,q,Qe);Pt(Mt,[...q,Qe])},Xe=()=>{window.confirm("清空根 Agent 的全部配置和子 Agent?此操作无法撤销。")&&(h(Sr()),Ue([]),C(!1),it(!1))},ft=q=>{if(q.length===0){Xe();return}Pt(Hge(f,q),q.slice(0,-1))},xt=B.builtinTools??[],vt=B.mcpTools??[],fe=B.tracingExporters??[],$e=B.selectedSkills??[],nt=[B.memory.shortTerm,B.memory.longTerm,B.tracing].filter(Boolean).length,qt=q=>tt({builtinTools:xt.includes(q)?xt.filter(pe=>pe!==q):[...xt,q]}),fn=q=>{const pe=fe.includes(q)?fe.filter(ve=>ve!==q):[...fe,q];tt({tracingExporters:pe,tracing:pe.length>0?!0:B.tracing})},Lt=K6(B.agentType),J=b0(B.agentType),he=w.useMemo(()=>V6(f),[f]),Le=J?null:lc(B.name)??(he.has(B.name)?"Agent 名称在当前结构中必须唯一":null),Be=Le!==null,ot=!J&&B.description.trim().length===0,It=B.instruction.trim().length===0,st=J&&!((cs=B.a2aRegistry)!=null&&cs.registrySpaceId.trim()),Z=q=>N&&q?`is-error cw-error-shake-${S%2}`:"",we=w.useMemo(()=>t5(f,he),[f,he]),_e=we.length===0,We=w.useMemo(()=>Kge(f),[f]),Ve=R.find(q=>q.id===I)??R[0],Je=w.useMemo(()=>r5(f),[f]),ut=w.useMemo(()=>{var q,pe,ve,Qe;return{type:!0,basic:J?!st:!Be&&(Lt||!It),model:!!((q=B.modelName)!=null&&q.trim()||(pe=B.modelProvider)!=null&&pe.trim()||(ve=B.modelApiBase)!=null&&ve.trim()),tools:xt.length>0||vt.length>0,skills:$e.length>0,knowledge:B.knowledgebase,advanced:B.memory.shortTerm||B.memory.longTerm||B.tracing,subagents:(((Qe=B.subAgents)==null?void 0:Qe.length)??0)>0,review:_e}},[B,Be,It,Lt,J,_e,xt,vt,$e]),Ft=Lt||J?["type","basic"]:["type","basic","model","tools","skills","knowledge",...Q?["advanced"]:[]],hn=rC.filter(q=>Ft.includes(q.id)),Tn=Ft.join("|"),Kt=ct.join("."),os=hn.findIndex(q=>q.id===ee),Er=q=>{var pe;(pe=rt.current[q])==null||pe.scrollIntoView({behavior:"smooth",block:"start"})};w.useEffect(()=>{if(O)return;const q=Et.current;if(!q)return;const pe=Tn.split("|");let ve=0;const Qe=()=>{ve=0;const rn=pe[pe.length-1];let pn=pe[0];if(q.scrollTop+q.clientHeight>=q.scrollHeight-2)pn=rn;else{const Mn=q.getBoundingClientRect().top+24;for(const Cn of pe){const In=rt.current[Cn];if(!In||In.getBoundingClientRect().top>Mn)break;pn=Cn}}pn&&le(Mn=>Mn===pn?Mn:pn)},Mt=()=>{ve||(ve=window.requestAnimationFrame(Qe))};return Qe(),q.addEventListener("scroll",Mt,{passive:!0}),window.addEventListener("resize",Mt),()=>{q.removeEventListener("scroll",Mt),window.removeEventListener("resize",Mt),ve&&window.cancelAnimationFrame(ve)}},[O,Tn,Kt]);const Xn=()=>_e?!0:(C(!0),A(q=>q+1),we[0]&&(Ue(we[0].path),window.requestAnimationFrame(()=>Er("basic"))),!1),Or=async()=>{const q=[...P.current.values()];P.current.clear(),G(0),F(pe=>pe.map(ve=>({...ve,phase:"idle",runtimeSnapshot:"",messages:[],error:null}))),await Promise.all(q.map(async({run:pe})=>{try{await Fu(pe.runId)}catch(ve){console.warn("清理调试运行失败",ve)}}))},Qn=async q=>{const pe=P.current.get(q);if(pe){P.current.delete(q),G(P.current.size);try{await Fu(pe.run.runId)}catch(ve){console.warn("清理调试运行失败",ve)}}},ar=async()=>x!=="validate"||ie===0?!0:window.confirm("离开调试页面后,当前环境将被清理。您可以通过重新启动环境进行新的测试。")?(await Or(),!0):!1,An=async q=>{if(await ar()){if(me(""),!Xn()){b("build");return}X(!0);try{const pe=q?R.find(Mt=>Mt.id===q):Ve;pe&&V(pe.id);const ve=pe?{...f,modelName:pe.modelName||f.modelName,description:pe.description,instruction:pe.instruction}:f,Qe=await $w(s5(ve));ve!==f&&h(ve),D(Qe),b("publish")}catch(pe){me(pe instanceof Error?pe.message:String(pe))}finally{X(!1)}}},Xt=async q=>{if(!T||U||!Xn())return;const pe=R.find(Ct=>Ct.id===q);if(!pe||pe.phase==="starting"||pe.phase==="sending")return;const ve=pe.modelName.trim(),Qe=pe.description.trim(),Mt=pe.instruction.trim(),rn=Gl(pe),pn=R.findIndex(Ct=>Ct.id===q),Mn=R.findIndex(Ct=>Gl(Ct)===rn);if(!ve||!Qe||!Mt||Mn!==pn)return;const Cn=ng(We,pe);F(Ct=>Ct.map(lr=>lr.id===q?{...lr,configOpen:!1,phase:"starting",messages:[],error:null}:lr)),ue("");let In=null;try{await Qn(q);const Ct={...f,modelName:pe.modelName||f.modelName,description:pe.description,instruction:pe.instruction};In=await dM(i5(Ct));const lr=await fM(In.runId,"test_user");P.current.set(q,{run:In,sessionId:lr}),G(P.current.size),F(sn=>sn.map(iu=>iu.id===q?{...iu,phase:"ready",runtimeSnapshot:Cn}:iu))}catch(Ct){if(In)try{await Fu(In.runId)}catch(lr){console.warn("清理调试运行失败",lr)}F(lr=>lr.map(sn=>sn.id===q?{...sn,phase:"error",runtimeSnapshot:"",error:Ct instanceof Error?Ct.message:String(Ct)}:sn))}},En=async()=>{const q=re.trim(),pe=R.filter(Qe=>Qe.phase==="ready"&&Qe.runtimeSnapshot===ng(We,Qe)&&P.current.has(Qe.id));if(!q||pe.length===0)return;ue("");const ve=new Set(pe.map(Qe=>Qe.id));F(Qe=>Qe.map(Mt=>ve.has(Mt.id)?{...Mt,phase:"sending",messages:[...Mt.messages,{role:"user",content:q},{role:"assistant",content:"",blocks:[]}]}:Mt)),await Promise.all(pe.map(async Qe=>{const Mt=P.current.get(Qe.id);if(Mt)try{let rn=zs();for await(const pn of hM({runId:Mt.run.runId,userId:"test_user",sessionId:Mt.sessionId,text:q})){const Mn=pn.error||pn.errorMessage||pn.error_message;if(F(Cn=>Cn.map(In=>{if(In.id!==Qe.id)return In;const Ct=[...In.messages],lr={...Ct[Ct.length-1]};return Mn?lr.error=String(Mn):(rn=Ec(rn,pn),lr.content=rn.blocks.filter(sn=>sn.kind==="text").map(sn=>sn.text).join(""),lr.blocks=rn.blocks),Ct[Ct.length-1]=lr,{...In,messages:Ct}})),Mn)break}}catch(rn){F(pn=>pn.map(Mn=>{if(Mn.id!==Qe.id)return Mn;const Cn=[...Mn.messages],In={...Cn[Cn.length-1]};return In.error=rn instanceof Error?rn.message:String(rn),Cn[Cn.length-1]=In,{...Mn,messages:Cn}}))}finally{F(rn=>rn.map(pn=>pn.id===Qe.id?{...pn,phase:"ready"}:pn))}}))},Un=()=>{F(q=>{if(q.length>=3)return q;const pe=W.current++,ve=`variant-${pe}`;return[...q,{id:ve,name:`对照组 ${pe}`,modelName:f.modelName??"",description:f.description,instruction:f.instruction,optimizations:[],configOpen:!0,phase:"idle",runtimeSnapshot:"",messages:[],error:null}]})},or=async q=>{await Qn(q),F(pe=>pe.filter(ve=>ve.id!==q)),I===q&&V("baseline")},nn=(q,pe)=>F(ve=>ve.map(Qe=>Qe.id===q?{...Qe,...pe}:Qe)),ls=(q,pe,ve)=>{nn(q,{[pe]:ve}),!(I!==q||q==="baseline")&&V("baseline")},Zn=q=>{const pe=R.find(Cn=>Cn.id===q);if(!pe)return;const ve=pe.modelName.trim(),Qe=pe.description.trim(),Mt=pe.instruction.trim(),rn=Gl(pe),pn=R.findIndex(Cn=>Cn.id===q),Mn=R.findIndex(Cn=>Gl(Cn)===rn);if(!(!ve||!Qe||!Mt||Mn!==pn)){if(q==="baseline"){nn(q,{configOpen:!1});return}Xt(q)}},$n=async(q,pe,ve)=>{var rn;const Qe=(rn=f.deployment)==null?void 0:rn.network,Mt=Qe&&Qe.mode&&Qe.mode!=="public"?{mode:Qe.mode,vpc_id:Qe.vpcId,subnet_ids:Qe.subnetIds,enable_shared_internet_access:Qe.enableSharedInternetAccess}:void 0;return Rg(q.name,q.files,{region:(a==null?void 0:a.region)??M,projectName:"default",network:Mt},{...ve,onStage:pe,runtimeId:a==null?void 0:a.runtimeId,description:f.description})},Jn=()=>{Xn()&&(F(q=>q.map(pe=>pe.id==="baseline"&&!P.current.has(pe.id)?{...pe,modelName:f.modelName??"",description:f.description,instruction:f.instruction}:pe)),b("validate"))},Is=async q=>{if(q==="publish"){O?b("publish"):An();return}if(q==="validate"){Jn();return}await ar()&&b(q)},Rr=St.current,xr=q=>rC.find(pe=>pe.id===q);return l.jsxs("div",{className:"cw-root",children:[l.jsx(Wge,{mode:x,agentName:Vge(f),busy:U,onChange:Is,onDiscard:d?()=>{E?k(!0):d()}:void 0}),ne&&l.jsx("div",{className:"cw-workspace-alert",role:"alert",children:ne}),l.jsxs("main",{className:"cw-workspace-main",id:"cw-workspace-main",children:[x==="build"&&l.jsxs("div",{className:"cw-editor",children:[l.jsx(Xm,{draft:f,direction:"vertical",selectedPath:ct,onSelect:Ue,onAdd:Bt,onInsert:bn,onDelete:ft}),l.jsxs("div",{className:"cw-detail",children:[l.jsx("div",{className:"cw-detail-scroll",ref:Et,children:l.jsx("div",{className:"cw-detail-inner",children:l.jsxs("div",{className:"cw-lower",children:[l.jsxs("div",{className:"cw-form-col",children:[l.jsx(Rr,{meta:xr("type"),children:l.jsx("div",{className:"cw-agent-type-options",role:"radiogroup","aria-label":"Agent 类型",children:oge.map(q=>{const pe=(B.agentType??"llm")===q.id,ve=Q&&q.id==="a2a",Qe=ve?"cw-remote-agent-disabled-hint":void 0;return l.jsxs("label",{"data-agent-type":q.id,className:`cw-agent-type-option ${pe?"is-on":""} ${ve?"is-disabled":""}`,title:ve?void 0:sC[q.id],tabIndex:ve?0:void 0,"aria-describedby":Qe,children:[l.jsx("input",{type:"radio",name:"agentType",className:"cw-agent-type-radio",checked:pe,disabled:ve,onChange:()=>kt(q.id)}),l.jsxs("span",{className:"cw-agent-type-copy",children:[l.jsx("strong",{children:Oge[q.id]}),l.jsx("small",{children:sC[q.id]})]}),ve&&l.jsx("span",{id:Qe,className:"cw-agent-type-disabled-hint",role:"tooltip",children:"远程智能体只能作为子步骤使用"})]},q.id)})})}),l.jsx(Rr,{meta:xr("basic"),children:l.jsxs("div",{className:"cw-form",children:[!J&&l.jsxs(l.Fragment,{children:[l.jsxs("div",{className:"cw-field",children:[l.jsxs("label",{className:"cw-label",children:[Q?"Agent 名称":"步骤名称",l.jsx("span",{className:"cw-req",children:"*"})]}),l.jsx("input",{className:`cw-input ${Z(Be)}`,value:B.name,placeholder:"customer_service",onChange:q=>tt({name:q.target.value})}),N&&Le?l.jsx("span",{className:"cw-error-text",children:Le}):l.jsx("span",{className:"cw-help",children:"遵循 Google ADK 命名规则,且在执行流程中保持唯一。"})]}),l.jsxs("div",{className:"cw-field",children:[l.jsxs("label",{className:"cw-label",children:[Q?"描述":"任务说明",l.jsx("span",{className:"cw-req",children:"*"})]}),l.jsx("textarea",{className:`cw-textarea cw-textarea-sm ${Z(ot)}`,value:B.description,placeholder:"简要描述这个 Agent 的用途,便于团队识别…",onChange:q=>tt({description:q.target.value})}),N&&ot?l.jsx("span",{className:"cw-error-text",children:"描述为必填项"}):l.jsx("span",{className:"cw-help",children:"描述会显示在 Agent 列表与选择器中。"})]})]}),Lt?l.jsxs(l.Fragment,{children:[l.jsx("p",{className:"cw-section-desc",children:"这是一个协作容器,本身不生成回答。请在左侧画布中 添加任务步骤,并通过拖拽调整它们的位置。"}),B.agentType==="loop"&&l.jsxs("div",{className:"cw-field",children:[l.jsx("label",{className:"cw-label",children:"最大轮次"}),l.jsx("input",{className:"cw-input",type:"number",min:1,value:B.maxIterations??3,onChange:q=>tt({maxIterations:Math.max(1,Number(q.target.value)||1)})}),l.jsx("span",{className:"cw-help",children:"循环编排反复执行子 Agent,直到满足条件或达到该轮次上限。"})]})]}):J?l.jsxs("div",{className:"cw-field cw-remote-center-fields",children:[l.jsxs("div",{className:"cw-remote-center-head",children:[l.jsxs("div",{className:"cw-label",children:["AgentKit 智能体中心",l.jsx("span",{className:"cw-req",children:"*"})]}),l.jsx("p",{className:"cw-help cw-remote-center-description",children:"远程 Agent 的名称、描述和能力来自中心返回的 Agent Card。 系统会根据每轮任务动态发现并挂载匹配的 Agent。"})]}),l.jsx(Mge,{value:((Kr=B.a2aRegistry)==null?void 0:Kr.registrySpaceId)??"",region:((Ga=B.a2aRegistry)==null?void 0:Ga.registryRegion)||qs.region,invalid:N&&st,onChange:q=>Re(Z6,q)}),l.jsxs("button",{type:"button",className:"cw-more-options","aria-expanded":de,"aria-controls":be,onClick:()=>Ee(q=>!q),children:[l.jsx("span",{children:"更多选项"}),l.jsx(ws,{className:`cw-more-options-chevron ${de?"is-open":""}`,"aria-hidden":!0})]}),l.jsx(pi,{initial:!1,children:de&&l.jsx($t.div,{id:be,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:l.jsx(yl,{env:Rge,values:J6(B.a2aRegistry,{includeDefaults:!1}),onChange:Re})})}),N&&st&&l.jsx("span",{className:"cw-error-text",children:"请选择 AgentKit 智能体中心"})]}):l.jsxs("div",{className:"cw-field",children:[l.jsxs("label",{className:"cw-label",children:["系统提示词",l.jsx("span",{className:"cw-req",children:"*"})]}),l.jsx(w.Suspense,{fallback:l.jsx("div",{className:"cw-markdown-loading",role:"status",children:"正在加载 Markdown 编辑器…"}),children:l.jsx(Age,{value:B.instruction,invalid:It,onChange:q=>tt({instruction:q})})}),N&&It?l.jsx("span",{className:"cw-error-text",children:"系统提示词为必填项"}):l.jsx("span",{className:"cw-help",children:"支持 Markdown 快捷输入,例如键入 ## 加空格创建二级标题。"})]})]})}),!Lt&&!J&&l.jsxs(l.Fragment,{children:[l.jsx(Rr,{meta:xr("model"),children:l.jsxs("div",{className:"cw-form",children:[l.jsxs("div",{className:"cw-field",children:[l.jsx("label",{className:"cw-label",children:"模型名称"}),l.jsx("input",{className:"cw-input",value:B.modelName??"",placeholder:"doubao-seed-2-1-pro-260628",onChange:q=>tt({modelName:q.target.value})})]}),l.jsxs("button",{type:"button",className:"cw-more-options","aria-expanded":ye,"aria-controls":oe,onClick:()=>te(q=>!q),children:[l.jsx("span",{children:"更多选项"}),l.jsx(ws,{className:`cw-more-options-chevron ${ye?"is-open":""}`,"aria-hidden":!0})]}),l.jsx(pi,{initial:!1,children:ye&&l.jsxs($t.div,{id:oe,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:[l.jsxs("div",{className:"cw-field",children:[l.jsx("label",{className:"cw-label",children:"服务商 Provider"}),l.jsx("input",{className:"cw-input",value:B.modelProvider??"",placeholder:"openai",onChange:q=>tt({modelProvider:q.target.value})})]}),l.jsxs("div",{className:"cw-field",children:[l.jsx("label",{className:"cw-label",children:"API Base"}),l.jsx("input",{className:"cw-input",value:B.modelApiBase??"",placeholder:"https://ark.cn-beijing.volces.com/api/v3/",onChange:q=>tt({modelApiBase:q.target.value})}),l.jsx("span",{className:"cw-help",children:"留空则使用 VeADK 默认模型配置;Ark API Key 会由 Studio 服务端凭据自动获取。其他服务商的 Key 可在部署页添加。"})]})]})})]})}),l.jsx(Rr,{meta:xr("tools"),children:l.jsxs("div",{className:"cw-form",children:[l.jsxs("div",{className:"cw-field",children:[l.jsx("label",{className:"cw-label",children:"内置工具"}),l.jsx("span",{className:"cw-help",children:"勾选 VeADK 提供的内置能力,生成时会自动补全 import 与所需环境变量。"}),l.jsx("div",{className:"cw-tools-list-shell",children:l.jsx(aC,{items:vc,selected:xt,onToggle:qt,scrollRows:6})}),l.jsx(pi,{initial:!1,children:xt.includes("run_code")&&l.jsxs($t.div,{className:"cw-tool-config",initial:{opacity:0,y:-4},animate:{opacity:1,y:0},exit:{opacity:0,y:-4},transition:{duration:.16,ease:"easeOut"},children:[l.jsxs("div",{className:"cw-tool-config-head",children:[l.jsx("span",{className:"cw-label",children:"代码执行配置"}),l.jsx("span",{className:"cw-help",children:"指定 AgentKit 代码执行沙箱。"})]}),l.jsx(yl,{env:((qa=vc.find(q=>q.id==="run_code"))==null?void 0:qa.env)??[],values:((Xa=f.deployment)==null?void 0:Xa.envValues)??{},onChange:ze})]})})]}),l.jsxs("button",{type:"button",className:"cw-more-options","aria-expanded":Te,"aria-controls":Oe,onClick:()=>Ke(q=>!q),children:[l.jsx("span",{children:"更多类型工具"}),vt.length>0&&l.jsxs("span",{className:"cw-more-options-count",children:["已配置 ",vt.length]}),l.jsx(ws,{className:`cw-more-options-chevron ${Te?"is-open":""}`,"aria-hidden":!0})]}),l.jsx(pi,{initial:!1,children:Te&&l.jsx($t.div,{id:Oe,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:l.jsxs("div",{className:"cw-field",children:[l.jsx("label",{className:"cw-label",children:"MCP 工具"}),l.jsx("span",{className:"cw-help",children:"连接外部 MCP 服务,生成时会为每个条目创建对应的 MCPToolset。"}),l.jsx(Dge,{tools:vt,onChange:q=>tt({mcpTools:q})})]})})})]})}),l.jsx(Rr,{meta:xr("skills"),children:l.jsx("div",{className:"cw-form",children:l.jsx(Bge,{selected:$e,onChange:q=>tt({selectedSkills:q})})})}),l.jsx(Rr,{meta:xr("knowledge"),children:l.jsxs("div",{className:"cw-form cw-toggle-stack",children:[l.jsx(Iu,{checked:B.knowledgebase,onChange:q=>tt({knowledgebase:q}),title:"知识库",desc:"启用外部知识检索(RAG),让 Agent 基于你的资料作答。",icon:vp}),B.knowledgebase&&l.jsxs("div",{className:"cw-field cw-subfield",children:[l.jsx("label",{className:"cw-label",children:"知识库后端"}),l.jsx(pb,{options:J1,value:B.knowledgebaseBackend,onChange:q=>tt({knowledgebaseBackend:q,knowledgebaseIndex:q==="viking"?B.knowledgebaseIndex:""})}),(B.knowledgebaseBackend??Gd)==="viking"&&l.jsxs("div",{className:"cw-field cw-subfield",children:[l.jsx("label",{className:"cw-label",children:"VikingDB 知识库"}),l.jsx(jge,{value:B.knowledgebaseIndex??"",onChange:q=>tt({knowledgebaseIndex:q})})]}),l.jsx(yl,{env:((Si=J1.find(q=>q.id===(B.knowledgebaseBackend??Gd)))==null?void 0:Si.env)??[],values:((Hn=f.deployment)==null?void 0:Hn.envValues)??{},onChange:ze})]})]})}),Q&&l.jsxs("section",{ref:q=>{rt.current.advanced=q},id:"cw-sec-advanced","data-step-id":"advanced",className:"cw-section cw-advanced-section",children:[l.jsxs("button",{type:"button",className:"cw-advanced-disclosure","aria-expanded":Ne,"aria-controls":Ye,onClick:()=>it(q=>!q),children:[l.jsx("span",{className:"cw-advanced-disclosure-title",children:"进阶配置"}),l.jsx(ws,{className:`cw-advanced-disclosure-chevron ${Ne?"is-open":""}`,"aria-hidden":!0}),nt>0&&l.jsxs("span",{className:"cw-more-options-count",children:["已启用 ",nt]})]}),l.jsx(pi,{initial:!1,children:Ne&&l.jsxs($t.div,{id:Ye,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:[l.jsxs("div",{className:"cw-advanced-group",children:[l.jsx("div",{className:"cw-advanced-group-head",children:l.jsx("span",{children:"记忆"})}),l.jsxs("div",{className:"cw-form cw-toggle-stack",children:[l.jsx(Iu,{checked:B.memory.shortTerm,onChange:q=>tt({memory:{...B.memory,shortTerm:q}}),title:"短期记忆",desc:"在单次会话内保留上下文,跨轮次记住对话内容。",icon:AL}),B.memory.shortTerm&&l.jsxs("div",{className:"cw-field cw-subfield",children:[l.jsx("label",{className:"cw-label",children:"短期记忆后端"}),l.jsx(pb,{options:Q1,value:B.shortTermBackend,onChange:q=>tt({shortTermBackend:q})}),l.jsx(yl,{env:((Qa=Q1.find(q=>q.id===(B.shortTermBackend??"local")))==null?void 0:Qa.env)??[],values:((Ti=f.deployment)==null?void 0:Ti.envValues)??{},onChange:ze})]}),l.jsx(Iu,{checked:B.memory.longTerm,onChange:q=>tt({memory:{...B.memory,longTerm:q}}),title:"长期记忆",desc:"跨会话持久化关键信息,让 Agent 记住历史偏好。",icon:vp}),B.memory.longTerm&&l.jsxs("div",{className:"cw-field cw-subfield",children:[l.jsx("label",{className:"cw-label",children:"长期记忆后端"}),l.jsx(pb,{options:Z1,value:B.longTermBackend,onChange:q=>tt({longTermBackend:q})}),l.jsx(yl,{env:((Xf=Z1.find(q=>q.id===(B.longTermBackend??"local")))==null?void 0:Xf.env)??[],values:((Qf=f.deployment)==null?void 0:Qf.envValues)??{},onChange:ze}),l.jsx(Iu,{checked:!!B.autoSaveSession,onChange:q=>tt({autoSaveSession:q}),title:"自动保存会话到长期记忆",desc:"会话结束时自动把内容写入长期记忆,无需手动调用。",icon:vp})]})]})]}),l.jsxs("div",{className:"cw-advanced-group",children:[l.jsx("div",{className:"cw-advanced-group-head",children:l.jsx("span",{children:"观测"})}),l.jsxs("div",{className:"cw-form cw-toggle-stack",children:[l.jsx(Iu,{checked:B.tracing,onChange:q=>tt({tracing:q}),title:"观测 / Tracing",desc:"记录每一步的调用链路与耗时,便于调试与性能分析。",icon:_L}),B.tracing&&l.jsxs("div",{className:"cw-field cw-subfield",children:[l.jsx("label",{className:"cw-label",children:"Tracing 导出器"}),l.jsx("span",{className:"cw-help",children:"选择一个或多个观测平台,生成时会写入对应的 ENABLE_* 开关与环境变量。"}),l.jsx(aC,{items:eE,selected:fe,onToggle:fn}),l.jsx(yl,{env:eE.filter(q=>fe.includes(q.id)).flatMap(q=>q.env),values:((nl=f.deployment)==null?void 0:nl.envValues)??{},onChange:ze})]})]})]})]})})]})]})]}),l.jsx("nav",{className:"cw-rail","aria-label":"步骤导航",children:l.jsxs("ol",{className:"cw-steps",children:[l.jsx("div",{className:"cw-rail-track","aria-hidden":!0,children:l.jsx($t.div,{className:"cw-rail-fill",animate:{height:`${Math.max(os,0)/Math.max(hn.length-1,1)*100}%`},transition:{type:"spring",stiffness:260,damping:32}})}),hn.map(q=>{const pe=q.id===ee,ve=ut[q.id];return l.jsx("li",{children:l.jsxs("button",{type:"button",className:`cw-step ${pe?"is-active":""} ${ve?"is-done":""}`,onClick:()=>Er(q.id),"aria-current":pe?"step":void 0,"aria-label":q.label,children:[l.jsx("span",{className:"cw-step-marker","aria-hidden":!0,children:pe?l.jsx("span",{className:"cw-dot"}):ve?l.jsx(Js,{className:"cw-step-check"}):l.jsx("span",{className:"cw-dot"})}),l.jsx("span",{className:"cw-step-tooltip","aria-hidden":!0,children:q.label})]})},q.id)})]})})]})})}),l.jsx("button",{type:"button",className:"cw-build-next studio-update-action",onClick:Jn,children:l.jsx("span",{children:"开始调试"})})]})]}),x==="validate"&&l.jsx("div",{className:"cw-validation-workspace",children:l.jsx("div",{className:"cw-validation-content",children:l.jsx(Yge,{enabled:T,disabledReason:L,variants:R,draftSnapshot:We,input:re,onInput:ue,onSend:En,onStartVariant:Xt,onDeployVariant:q=>void An(q),onAddVariant:Un,onRemoveVariant:or,onToggleConfig:q=>{const pe=R.find(ve=>ve.id===q);pe&&nn(q,{configOpen:!pe.configOpen})},onCompleteConfig:Zn,onConfigChange:ls})})}),x==="publish"&&l.jsx("div",{className:"cw-preview-body",children:O?l.jsx(y0,{embedded:!0,project:O,agentDraft:f,agentName:f.name||"未命名 Agent",agentCount:n5(f),releaseConfiguration:Ve?{modelName:Ve.modelName||f.modelName||"默认模型",description:Ve.description,instruction:Ve.instruction,optimizations:Ve.optimizations.flatMap(q=>{const pe=a5.find(ve=>ve.id===q);return pe?[pe.label]:[]})}:void 0,onChange:D,onDeploy:$n,onAgentAdded:n,onDeploymentTaskChange:i,deploymentActionLabel:a?"更新并发布":"部署",deploymentRuntimeId:a==null?void 0:a.runtimeId,onDeploymentStarted:c,onDeploymentComplete:o,feishuEnabled:!!((rl=f.deployment)!=null&&rl.feishuEnabled),onFeishuEnabledChange:q=>{const pe={...f,deployment:{...f.deployment??{feishuEnabled:!1},feishuEnabled:q}};h(pe)},deploymentEnv:Je.specs,deploymentEnvValues:{...(sl=f.deployment)==null?void 0:sl.envValues,...Je.fixedValues},onDeploymentEnvChange:ze,network:(Zf=f.deployment)==null?void 0:Zf.network,onNetworkChange:q=>h(pe=>({...pe,deployment:{...pe.deployment??{feishuEnabled:!1},network:q}})),deployRegion:M,onDeployRegionChange:j,onExportYaml:()=>Cge(`${f.name||"agent"}.yaml`,Ime(f),"text/yaml")}):l.jsxs("div",{className:"cw-publish-loading",role:"status",children:[l.jsx(Rt,{className:"cw-i cw-spin"}),l.jsx("strong",{children:"正在生成发布配置"}),l.jsx("span",{children:"校验 Agent 结构并准备部署快照…"})]})})]}),_&&l.jsx("div",{className:"confirm-scrim",onClick:()=>k(!1),children:l.jsxs("div",{className:"confirm-box",role:"dialog","aria-modal":"true","aria-labelledby":"discard-edit-title",onClick:q=>q.stopPropagation(),children:[l.jsx("div",{className:"confirm-title",id:"discard-edit-title",children:"放弃本次编辑?"}),l.jsx("div",{className:"confirm-text",children:"本次修改将不会保留,智能体会恢复到进入编辑前的状态。"}),l.jsxs("div",{className:"confirm-actions",children:[l.jsx("button",{type:"button",className:"confirm-btn",onClick:()=>k(!1),children:"继续编辑"}),l.jsx("button",{type:"button",className:"confirm-btn confirm-btn--danger",onClick:()=>{k(!1),d==null||d()},children:"放弃编辑"})]})]})})]})}function ji(e){return{...Sr(),...e}}const qge=[{id:"support",icon:OH,draft:ji({name:"客服助手",description:"7×24 在线答疑,结合知识库与历史对话,稳定、礼貌地解决用户问题。",instruction:"你是一名专业、耐心的客服助手。请始终保持礼貌、友好的语气,优先依据知识库中的资料回答用户问题;当资料不足以确定答案时,如实告知用户并主动引导其提供更多信息,切勿编造。回答尽量简洁、分点清晰,必要时给出操作步骤。",model:"doubao-1.5-pro-32k",knowledgebase:!0,memory:{shortTerm:!0,longTerm:!0}})},{id:"analyst",icon:pH,draft:ji({name:"数据分析师",description:"运行代码完成统计与可视化,开启链路追踪,分析过程可观测、可复现。",instruction:"你是一名严谨的数据分析师。面对数据问题时,先厘清分析目标与口径,再通过编写并运行代码完成清洗、统计与可视化。每一步都要说明你的假设与方法,给出结论时附上关键数据支撑,并指出潜在的偏差与局限。",model:"doubao-1.5-pro-32k",tools:["code_runner"],tracing:!0})},{id:"translator",icon:RH,draft:ji({name:"翻译助手",description:"中英互译,忠实、通顺、地道,保留原文语气与专业术语。",instruction:"你是一名专业的翻译助手,精通中英互译。请在忠实于原文含义的前提下,使译文自然、地道、符合目标语言表达习惯;保留专有名词与专业术语的准确性,并尽量贴合原文的语气与风格。仅输出译文,除非用户额外要求解释。",model:"doubao-1.5-pro-32k"})},{id:"coder",icon:Tw,draft:ji({name:"代码助手",description:"编写、调试与重构代码,可运行代码验证结果,给出清晰可维护的实现。",instruction:"你是一名资深软件工程师。请根据需求编写正确、清晰、可维护的代码,遵循目标语言的惯用风格与最佳实践。在不确定时通过运行代码验证你的实现,给出关键的边界条件与测试思路,并对复杂逻辑附上简要注释。",model:"doubao-1.5-pro-32k",tools:["code_runner","file_reader"],tracing:!0})},{id:"researcher",icon:BH,draft:ji({name:"研究员",description:"联网检索一手资料,结合知识库与长期记忆,输出有据可查的研究结论。",instruction:"你是一名严谨的研究员。面对研究问题时,先拆解关键子问题,再通过联网检索收集多个一手、可信的来源,交叉验证后再下结论。结论需注明出处与不确定性,区分事实与推断,避免以偏概全。",model:"doubao-1.5-pro-32k",tools:["web_search"],knowledgebase:!0,memory:{shortTerm:!0,longTerm:!0}})},{id:"research-team",icon:QH,draft:ji({name:"多智能体研究团队",description:"由检索员、分析员、撰写员协作的研究编排,分工完成端到端调研报告。",instruction:"你是一支研究团队的总协调者。负责拆解用户的研究任务,将检索、分析、撰写分别委派给对应的子 Agent,汇总各子 Agent 的产出,把控整体质量,最终输出结构清晰、有据可查的研究报告。",model:"doubao-1.5-pro-32k",tracing:!0,memory:{shortTerm:!0,longTerm:!0},subAgents:[ji({name:"检索员",description:"联网搜集与课题相关的一手资料与数据。",instruction:"你是研究团队中的检索员。根据课题联网检索多个可信来源,整理出关键事实、数据与原文出处,交付给分析员,不做主观结论。",tools:["web_search"]}),ji({name:"分析员",description:"对检索到的材料做交叉验证与归纳分析。",instruction:"你是研究团队中的分析员。对检索员提供的材料做交叉验证、归纳与对比,提炼洞见、识别矛盾与不确定性,形成结构化的分析要点。",tools:["code_runner"]}),ji({name:"撰写员",description:"将分析结论组织为结构清晰、引用规范的报告。",instruction:"你是研究团队中的撰写员。把分析员的要点组织成结构清晰、语言通顺、引用规范的研究报告,确保每个结论都能追溯到来源。"})]})}];function Xge(e){const t=[];return e.tools.length&&t.push({icon:RL,label:"工具"}),(e.memory.shortTerm||e.memory.longTerm)&&t.push({icon:hH,label:"记忆"}),e.knowledgebase&&t.push({icon:fH,label:"知识库"}),e.tracing&&t.push({icon:dH,label:"观测"}),e.subAgents.length&&t.push({icon:OL,label:`子Agent ${e.subAgents.length}`}),t}function Qge({onBack:e,onCreate:t}){const[n,r]=w.useState(null);return l.jsx("div",{className:"tpl-root",children:n?l.jsx(Jge,{template:n,onBack:()=>r(null),onCreate:t}):l.jsx(Zge,{onPick:r})})}function Zge({onPick:e}){return l.jsxs("div",{className:"tpl-scroll",children:[l.jsxs("div",{className:"tpl-head",children:[l.jsx("h1",{className:"tpl-title",children:"从模板新建"}),l.jsx("p",{className:"tpl-sub",children:"选择一个预制 agent 模板,按需微调后即可创建。"})]}),l.jsx("div",{className:"tpl-grid",children:qge.map((t,n)=>l.jsxs($t.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:[l.jsx("span",{className:"tpl-card-icon",children:l.jsx(t.icon,{className:"icon"})}),l.jsx("span",{className:"tpl-card-name",children:t.draft.name}),l.jsx("span",{className:"tpl-card-desc",children:As(t.draft.description)})]},t.id))})]})}function Jge({template:e,onBack:t,onCreate:n}){const[r,s]=w.useState(e.draft.name),i=e.icon,a=Xge(e.draft);function o(){const c=r.trim()||e.draft.name;n({...e.draft,name:c})}return l.jsxs("div",{className:"tpl-scroll tpl-scroll--detail",children:[l.jsxs("button",{className:"tpl-back",onClick:t,children:[l.jsx(yL,{className:"icon"})," 返回模板列表"]}),l.jsxs($t.div,{className:"tpl-detail",initial:{opacity:0,y:10},animate:{opacity:1,y:0},transition:{duration:.28,ease:[.22,1,.36,1]},children:[l.jsxs("div",{className:"tpl-detail-head",children:[l.jsx("span",{className:"tpl-detail-icon",children:l.jsx(i,{className:"icon"})}),l.jsxs("div",{className:"tpl-detail-headtext",children:[l.jsx("div",{className:"tpl-detail-name",children:e.draft.name}),l.jsx("div",{className:"tpl-detail-desc",children:As(e.draft.description)})]})]}),a.length>0&&l.jsx("div",{className:"tpl-tags tpl-tags--detail",children:a.map(c=>l.jsxs("span",{className:"tpl-tag",children:[l.jsx(c.icon,{className:"tpl-tag-icon"})," ",c.label]},c.label))}),l.jsxs("label",{className:"tpl-field",children:[l.jsx("span",{className:"tpl-field-label",children:"名称"}),l.jsx("input",{className:"tpl-input",value:r,onChange:c=>s(c.target.value),placeholder:e.draft.name})]}),l.jsxs("div",{className:"tpl-field",children:[l.jsx("span",{className:"tpl-field-label",children:"系统提示词"}),l.jsx("p",{className:"tpl-instruction",children:e.draft.instruction})]}),l.jsxs("div",{className:"tpl-meta-grid",children:[e.draft.model&&l.jsxs("div",{className:"tpl-meta",children:[l.jsx("span",{className:"tpl-meta-key",children:"模型"}),l.jsx("span",{className:"tpl-meta-val tpl-mono",children:e.draft.model})]}),l.jsxs("div",{className:"tpl-meta",children:[l.jsx("span",{className:"tpl-meta-key",children:"工具"}),l.jsx("span",{className:"tpl-meta-val",children:e.draft.tools.length?e.draft.tools.join("、"):"无"})]}),l.jsxs("div",{className:"tpl-meta",children:[l.jsx("span",{className:"tpl-meta-key",children:"记忆"}),l.jsx("span",{className:"tpl-meta-val",children:e0e(e.draft)})]}),l.jsxs("div",{className:"tpl-meta",children:[l.jsx("span",{className:"tpl-meta-key",children:"知识库"}),l.jsx("span",{className:"tpl-meta-val",children:e.draft.knowledgebase?"已开启":"关闭"})]}),l.jsxs("div",{className:"tpl-meta",children:[l.jsx("span",{className:"tpl-meta-key",children:"观测追踪"}),l.jsx("span",{className:"tpl-meta-val",children:e.draft.tracing?"已开启":"关闭"})]})]}),e.draft.subAgents.length>0&&l.jsxs("div",{className:"tpl-field",children:[l.jsxs("span",{className:"tpl-field-label",children:["子 Agent(",e.draft.subAgents.length,")"]}),l.jsx("div",{className:"tpl-subagents",children:e.draft.subAgents.map((c,u)=>l.jsxs("div",{className:"tpl-subagent",children:[l.jsxs("div",{className:"tpl-subagent-top",children:[l.jsx("span",{className:"tpl-subagent-name",children:c.name}),c.tools.length>0&&l.jsx("span",{className:"tpl-subagent-tools",children:c.tools.join("、")})]}),l.jsx("div",{className:"tpl-subagent-desc",children:As(c.description)})]},u))})]}),l.jsxs("button",{className:"tpl-create",onClick:o,children:["使用此模板创建 ",l.jsx(ws,{className:"icon"})]})]})]})}function e0e(e){const t=[];return e.memory.shortTerm&&t.push("短期"),e.memory.longTerm&&t.push("长期"),t.length?t.join(" + "):"关闭"}const t0e=[{type:"sequential",label:"顺序",desc:"节点依次执行",Icon:CL},{type:"parallel",label:"并行",desc:"节点同时执行",Icon:bL},{type:"loop",label:"循环",desc:"节点循环执行",Icon:Rw}];let qE=0;function Eb(){return qE+=1,`node_${qE}`}function xb(e,t,n){const r=Sr();return{id:e,type:"agentNode",position:t,data:{agent:{...r,name:(n==null?void 0:n.name)??`agent_${e.replace("node_","")}`,...n}}}}function n0e({data:e,selected:t}){const n=e.agent;return l.jsxs("div",{className:`wfb-node ${t?"wfb-node--selected":""}`,children:[l.jsx(mr,{type:"target",position:Pe.Left,className:"wfb-handle"}),l.jsx("div",{className:"wfb-node-icon",children:l.jsx(Do,{className:"icon"})}),l.jsxs("div",{className:"wfb-node-body",children:[l.jsx("div",{className:"wfb-node-name",children:n.name||"未命名节点"}),l.jsx("div",{className:"wfb-node-desc",children:n.instruction?n.instruction.slice(0,48):"点击编辑指令…"})]}),l.jsx(mr,{type:"source",position:Pe.Right,className:"wfb-handle"})]})}const r0e={agentNode:n0e},cC={type:"smoothstep",markerEnd:{type:Oc.ArrowClosed,width:16,height:16}};function s0e({onBack:e,onCreate:t}){const n=w.useRef(null),[r,s]=w.useState(""),[i,a]=w.useState(""),[o,c]=w.useState("sequential"),u=w.useMemo(()=>{qE=0;const T=Eb();return xb(T,{x:80,y:120},{name:"agent_1"})},[]),[d,f,h]=e4([u]),[p,m,y]=t4([]),[E,g]=w.useState(u.id),x=d.find(T=>T.id===E)??null,b=r.trim()||"workflow_agent",_=w.useMemo(()=>V6({name:b,subAgents:d.map(T=>T.data.agent)}),[b,d]),k=lc(b)??(_.has(b)?"名称须与 Agent 节点名称保持唯一":null),N=x?lc(x.data.agent.name)??(_.has(x.data.agent.name)?"Agent 名称在当前工作流中必须唯一":null):null,C=d.length>0&&k===null&&d.every(T=>lc(T.data.agent.name)===null&&!_.has(T.data.agent.name)),S=w.useCallback(T=>m(L=>AP({...T,...cC},L)),[m]),A=w.useCallback(()=>{const T=Eb(),L=d.length*28,R=xb(T,{x:80+L,y:120+L});f(F=>F.concat(R)),g(T)},[d.length,f]),O=T=>{T.dataTransfer.setData("application/wfb-node","agentNode"),T.dataTransfer.effectAllowed="move"},D=w.useCallback(T=>{T.preventDefault(),T.dataTransfer.dropEffect="move"},[]),U=w.useCallback(T=>{if(T.preventDefault(),T.dataTransfer.getData("application/wfb-node")!=="agentNode"||!n.current)return;const R=n.current.screenToFlowPosition({x:T.clientX,y:T.clientY}),F=Eb(),I=xb(F,R);f(V=>V.concat(I)),g(F)},[f]),X=w.useCallback(T=>{E&&f(L=>L.map(R=>R.id===E?{...R,data:{...R.data,agent:{...R.data.agent,...T}}}:R))},[E,f]),M=w.useCallback(()=>{E&&(f(T=>T.filter(L=>L.id!==E)),m(T=>T.filter(L=>L.source!==E&&L.target!==E)),g(null))},[E,f,m]),j=w.useCallback(()=>{if(!C)return;const T=d.map(R=>R.data.agent),L={...Sr(),name:b,description:i.trim(),instruction:i.trim(),subAgents:T,workflow:{type:o,nodes:d.map(R=>({id:R.id,agent:R.data.agent})),edges:p.map(R=>({from:R.source,to:R.target}))}};t(L)},[C,d,p,b,i,o,t]);return l.jsx("div",{className:"wfb",children:l.jsxs("div",{className:"wfb-grid",children:[l.jsxs("aside",{className:"wfb-palette",children:[l.jsx("div",{className:"wfb-section-label",children:"工作流信息"}),l.jsxs("label",{className:"wfb-field",children:[l.jsx("span",{className:"wfb-field-label",children:"名称"}),l.jsx("input",{className:`wfb-input ${k?"wfb-input--error":""}`,value:r,onChange:T=>s(T.target.value),placeholder:"my_workflow"}),k&&l.jsx("span",{className:"wfb-field-error",children:k})]}),l.jsxs("label",{className:"wfb-field",children:[l.jsx("span",{className:"wfb-field-label",children:"描述"}),l.jsx("textarea",{className:"wfb-input wfb-textarea",value:i,onChange:T=>a(T.target.value),placeholder:"这个工作流做什么…",rows:2})]}),l.jsx("div",{className:"wfb-section-label",children:"执行方式"}),l.jsx("div",{className:"wfb-types",children:t0e.map(({type:T,label:L,desc:R,Icon:F})=>l.jsxs("button",{type:"button",className:`wfb-type ${o===T?"wfb-type--active":""}`,onClick:()=>c(T),children:[l.jsx(F,{className:"icon"}),l.jsxs("span",{className:"wfb-type-text",children:[l.jsx("span",{className:"wfb-type-name",children:L}),l.jsx("span",{className:"wfb-type-desc",children:R})]})]},T))}),l.jsx("div",{className:"wfb-section-label",children:"节点"}),l.jsxs("div",{className:"wfb-palette-item",draggable:!0,onDragStart:O,title:"拖拽到画布,或点击下方按钮添加",children:[l.jsx(IH,{className:"icon wfb-grip"}),l.jsx("span",{className:"wfb-node-icon wfb-node-icon--sm",children:l.jsx(Do,{className:"icon"})}),l.jsx("span",{className:"wfb-palette-item-text",children:"Agent 节点"})]}),l.jsxs("button",{className:"wfb-add",type:"button",onClick:A,children:[l.jsx(rr,{className:"icon"}),"添加节点"]}),l.jsx("div",{className:"wfb-hint",children:"拖拽节点的圆点连线以表达执行顺序。"})]}),l.jsxs("div",{className:"wfb-canvas",children:[l.jsxs("button",{className:"wfb-create",onClick:j,disabled:!C,type:"button",children:[l.jsx(Po,{className:"icon"}),"创建工作流"]}),l.jsxs(JP,{nodes:d,edges:p,onNodesChange:h,onEdgesChange:y,onConnect:S,onInit:T=>n.current=T,nodeTypes:r0e,defaultEdgeOptions:cC,onDrop:U,onDragOver:D,onNodeClick:(T,L)=>g(L.id),onPaneClick:()=>g(null),fitView:!0,fitViewOptions:{padding:.3,maxZoom:1},proOptions:{hideAttribution:!0},children:[l.jsx(r4,{gap:16,size:1,color:"hsl(240 5.9% 88%)"}),l.jsx(i4,{showInteractive:!1}),l.jsx(Tue,{pannable:!0,zoomable:!0,className:"wfb-minimap"})]})]}),l.jsx("aside",{className:"wfb-inspector",children:x?l.jsxs(l.Fragment,{children:[l.jsxs("div",{className:"wfb-inspector-head",children:[l.jsx("div",{className:"wfb-section-label",children:"节点配置"}),l.jsx("button",{className:"wfb-icon-btn",type:"button",onClick:M,title:"删除节点",children:l.jsx(ea,{className:"icon"})})]}),l.jsxs("label",{className:"wfb-field",children:[l.jsx("span",{className:"wfb-field-label",children:"名称"}),l.jsx("input",{className:`wfb-input ${N?"wfb-input--error":""}`,value:x.data.agent.name,onChange:T=>X({name:T.target.value}),placeholder:"agent_name"}),N?l.jsx("span",{className:"wfb-field-error",children:N}):l.jsx("span",{className:"wfb-field-help",children:"仅使用英文字母、数字和下划线,且名称保持唯一。"})]}),l.jsxs("label",{className:"wfb-field",children:[l.jsx("span",{className:"wfb-field-label",children:"描述"}),l.jsx("input",{className:"wfb-input",value:x.data.agent.description,onChange:T=>X({description:T.target.value}),placeholder:"这个 agent 做什么…"})]}),l.jsxs("label",{className:"wfb-field",children:[l.jsx("span",{className:"wfb-field-label",children:"指令 (instruction)"}),l.jsx("textarea",{className:"wfb-input wfb-textarea",value:x.data.agent.instruction,onChange:T=>X({instruction:T.target.value}),placeholder:"你是一个…",rows:6})]}),l.jsxs("label",{className:"wfb-field",children:[l.jsx("span",{className:"wfb-field-label",children:"工具 (逗号分隔)"}),l.jsx("input",{className:"wfb-input",value:x.data.agent.tools.join(", "),onChange:T=>X({tools:T.target.value.split(",").map(L=>L.trim()).filter(Boolean)}),placeholder:"web_search, calculator"})]}),l.jsxs("div",{className:"wfb-inspector-meta",children:[l.jsx("span",{className:"wfb-meta-key",children:"节点 ID"}),l.jsx("code",{className:"wfb-meta-val",children:x.id})]})]}):l.jsxs("div",{className:"wfb-inspector-empty",children:[l.jsx(Do,{className:"wfb-empty-icon"}),l.jsx("p",{children:"选择一个节点以编辑其配置"}),l.jsxs("p",{className:"wfb-empty-sub",children:["共 ",d.length," 个节点 · ",p.length," 条连线"]})]})})]})})}function i0e(e){return l.jsx(Dv,{children:l.jsx(s0e,{...e})})}const uC=50*1024*1024,XE=800,a0e={name:"code_package",files:[]};function o0e(e){let n=e.replace(/\.zip$/i,"").trim().replace(/[^A-Za-z0-9_]+/g,"_").replace(/^_+|_+$/g,"");return n||(n="uploaded_agent"),/^[A-Za-z_]/.test(n)||(n=`agent_${n}`),n==="user"&&(n="uploaded_agent"),n.slice(0,64)}function l0e(e){const t=e.replace(/\\/g,"/").replace(/^\.\//,"");if(!t||t.endsWith("/"))return null;if(t.startsWith("/")||t.includes("\0"))throw new Error(`压缩包包含非法路径:${e}`);const n=t.split("/");if(n.some(r=>!r||r==="."||r===".."))throw new Error(`压缩包包含非法路径:${e}`);return n[0]==="__MACOSX"||n[n.length-1]===".DS_Store"?null:n.join("/")}function c0e(e){const t=e.flatMap(a=>{const o=l0e(a.name);return o?[{path:o,content:a.text}]:[]});if(t.length===0)throw new Error("压缩包中没有可部署的文件。");if(t.length>XE)throw new Error(`代码包文件数不能超过 ${XE} 个。`);const s=new Set(t.map(a=>a.path.split("/")[0])).size===1&&t.every(a=>a.path.includes("/"))?t.map(a=>({...a,path:a.path.split("/").slice(1).join("/")})):t,i=new Set;for(const a of s){if(i.has(a.path))throw new Error(`代码包包含重复文件:${a.path}`);i.add(a.path)}if(!i.has("app.py"))throw new Error("代码包根目录必须包含 app.py,作为 AgentKit 启动入口。");return s}function u0e({onBack:e,onAgentAdded:t,onDeploymentTaskChange:n}){const r=w.useRef(null),s=w.useRef(0),[i,a]=w.useState(null),[o,c]=w.useState(""),[u,d]=w.useState(!1),[f,h]=w.useState(!1),[p,m]=w.useState(!1),[y,E]=w.useState(""),[g,x]=w.useState("cn-beijing"),[b,_]=w.useState();w.useEffect(()=>()=>{s.current+=1},[]);async function k(A){const O=++s.current;if(E(""),!A.name.toLowerCase().endsWith(".zip")){E("请选择 .zip 格式的代码包。");return}if(A.size>uC){E("代码包不能超过 50 MB。");return}h(!0);try{const D=await Y6(new Uint8Array(await A.arrayBuffer()),{maxEntries:XE,maxUncompressedBytes:uC}),U=c0e(D);if(O!==s.current)return;c(A.name),a({name:o0e(A.name),files:U})}catch(D){if(O!==s.current)return;c(""),a(null),E(D instanceof Error?D.message:String(D))}finally{O===s.current&&h(!1)}}function N(A){var D;const O=(D=A.currentTarget.files)==null?void 0:D[0];A.currentTarget.value="",O&&k(O)}function C(A){var D;A.preventDefault(),m(!1);const O=(D=A.dataTransfer.files)==null?void 0:D[0];O&&k(O)}async function S(A,O,D){const U=b&&b.mode!=="public"?{mode:b.mode,vpc_id:b.vpcId,subnet_ids:b.subnetIds,enable_shared_internet_access:b.enableSharedInternetAccess}:void 0;return Rg(A.name,A.files,{region:g,projectName:"default",network:U},{...D,onStage:O})}return l.jsxs("div",{className:"package-create package-create-preview",children:[l.jsx(y0,{project:i??a0e,agentName:(i==null?void 0:i.name)||"代码包",onChange:i?a:void 0,onDeploy:S,onAgentAdded:t,onDeploymentTaskChange:n,network:b,onNetworkChange:_,deployRegion:g,onDeployRegionChange:x,onBack:e,backLabel:"返回创建方式",deployDisabled:!i||f,deployDisabledReason:f?"正在读取代码包":i?void 0:"请先上传代码包",deploymentPrimaryPane:l.jsxs("section",{className:"package-source-pane","aria-label":"代码包上传",children:[l.jsx("div",{className:"package-source-label",children:"代码包"}),l.jsxs("div",{className:`package-dropzone${p?" is-dragging":""}${i?" is-ready":""}`,onDragEnter:A=>{A.preventDefault(),m(!0)},onDragOver:A=>A.preventDefault(),onDragLeave:A=>{A.currentTarget.contains(A.relatedTarget)||m(!1)},onDrop:C,onClick:()=>{var A;f||(A=r.current)==null||A.click()},onKeyDown:A=>{var O;!f&&(A.key==="Enter"||A.key===" ")&&(A.preventDefault(),(O=r.current)==null||O.click())},role:"button",tabIndex:f?-1:0,"aria-label":i?"重新上传代码包":"上传代码包","aria-disabled":f,children:[l.jsx("strong",{children:f?"正在读取代码包…":i?o:"请上传代码包"}),l.jsx("span",{children:i?`已识别 ${i.files.length} 个文件,点击区域可重新上传`:"点击或拖拽上传,支持 .zip 格式,最大 50 MB,根目录需包含 app.py"}),l.jsx("div",{className:"package-upload-actions",children:i&&l.jsx("button",{type:"button",className:"package-upload-secondary",onClick:A=>{A.stopPropagation(),d(!0)},onKeyDown:A=>A.stopPropagation(),children:"查看文件"})}),l.jsx("input",{ref:r,type:"file",accept:".zip,application/zip","aria-label":"选择代码包",onChange:N})]}),y&&l.jsx("div",{className:"package-create-error",role:"alert",children:y})]})}),i&&l.jsx(z6,{project:i,open:u,onClose:()=>d(!1),onChange:a})]})}const d0e=3*60*1e3,f0e=3e3,h0e=10*60*1e3,rg="veadk.studio.pending-update",dC=[{id:"resolving",label:"读取目标版本信息"},{id:"downloading",label:"下载并校验完整更新包"},{id:"preparing",label:"准备 VeFaaS Function 代码"},{id:"submitting",label:"提交 Function 更新"},{id:"publishing",label:"发布新 Revision 并重启服务"}],p0e={resolving:"读取版本信息",downloading:"下载更新包",preparing:"准备 Function 代码",submitting:"提交 Function 更新",publishing:"发布 Revision",checking:"检查更新",unknown:"未知阶段"};function m0e(e){return e<60?`${e} 秒`:`${Math.floor(e/60)} 分 ${e%60} 秒`}function g0e(e,t){return e===t?!0:/^\d{14}$/.test(e)&&/^\d{14}$/.test(t)&&e>t}function y0e(){if(typeof window>"u")return null;const e=window.localStorage.getItem(rg);if(!e)return null;try{const t=JSON.parse(e);if(typeof t.targetVersion=="string"&&typeof t.startedAt=="number")return{targetVersion:t.targetVersion,startedAt:t.startedAt}}catch{}return window.localStorage.removeItem(rg),null}function wb(e,t){window.localStorage.setItem(rg,JSON.stringify({targetVersion:e,startedAt:t}))}function ip(){window.localStorage.removeItem(rg)}function fC({className:e}){return l.jsxs("svg",{className:e,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"1.8",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":!0,children:[l.jsx("path",{d:"M19.2 8.3A8 8 0 1 0 20 13"}),l.jsx("path",{d:"M19.2 4.8v3.5h-3.5"}),l.jsx("path",{d:"M12 7.8v7.7"}),l.jsx("path",{d:"m9.2 12.7 2.8 2.8 2.8-2.8"})]})}function b0e(){return l.jsx("svg",{viewBox:"0 0 16 16",fill:"none","aria-hidden":!0,children:l.jsx("path",{d:"m4 6 4 4 4-4"})})}function E0e(){return l.jsx("svg",{viewBox:"0 0 16 16",fill:"none","aria-hidden":!0,children:l.jsx("path",{d:"m3.5 8.2 2.8 2.8 6.2-6"})})}function hC({lines:e,phase:t,copyState:n,onCopy:r}){const s=w.useRef(null),i=w.useRef(!0);return w.useEffect(()=>{const a=s.current;a&&i.current&&(a.scrollTop=a.scrollHeight)},[e]),l.jsxs("section",{className:"studio-update-live-log","aria-label":"VeFaaS 更新日志",children:[l.jsxs("div",{className:"studio-update-log-header",children:[l.jsxs("span",{children:[l.jsx("i",{className:`is-${t}`,"aria-hidden":!0}),"VeFaaS 更新日志",l.jsx("small",{children:t==="active"?"实时":t==="complete"?"已完成":"已停止"})]}),l.jsx("button",{type:"button",onClick:r,disabled:!e.length,children:n==="copied"?"已复制":n==="error"?"复制失败":"复制日志"})]}),l.jsx("div",{ref:s,className:"studio-update-log-lines",role:"log","aria-live":"off",tabIndex:0,onScroll:a=>{const o=a.currentTarget;i.current=o.scrollHeight-o.scrollTop-o.clientHeight<24},children:e.length?e.map((a,o)=>l.jsx("div",{children:a},`${o}-${a}`)):l.jsx("p",{children:t==="active"?"等待 VeFaaS 返回更新日志…":"本次更新未返回发布日志"})})]})}function x0e(){var X,M;const[e]=w.useState(y0e),[t,n]=w.useState(null),[r,s]=w.useState(e?"submitting":"idle"),[i,a]=w.useState(!1),[o,c]=w.useState(""),[u,d]=w.useState((e==null?void 0:e.targetVersion)??""),[f,h]=w.useState(!1),[p,m]=w.useState("idle"),[y,E]=w.useState(0),g=w.useRef(null),x=w.useRef((e==null?void 0:e.targetVersion)??""),b=w.useRef((e==null?void 0:e.startedAt)??0);w.useEffect(()=>{if(!f)return;const j=L=>{var R;L.target instanceof Node&&!((R=g.current)!=null&&R.contains(L.target))&&h(!1)},T=L=>{L.key==="Escape"&&h(!1)};return window.addEventListener("pointerdown",j),window.addEventListener("keydown",T),()=>{window.removeEventListener("pointerdown",j),window.removeEventListener("keydown",T)}},[f]);const _=w.useCallback(async()=>{const j=await oM(x.current||void 0,b.current||void 0);return n(j),j},[]);if(w.useEffect(()=>{let j=!0;const T=()=>{_().catch(()=>{j&&n(R=>R)})};T();const L=window.setInterval(T,d0e);return()=>{j=!1,window.clearInterval(L)}},[_]),w.useEffect(()=>{if(r!=="submitting")return;const j=window.setInterval(()=>{_().then(T=>{const L=x.current;if(L&&g0e(T.currentVersion,L)||!L&&!T.available&&T.latestVersion){window.clearInterval(j),ip(),s("published"),c("Studio 已更新,刷新页面即可使用新版本");return}if(T.state==="error"){window.clearInterval(j),ip(),s("error"),c(T.message||"Studio 更新失败");return}Date.now()-b.current>h0e&&(window.clearInterval(j),ip(),s("error"),c("等待 VeFaaS 发布超时,请稍后重新检查版本"))}).catch(()=>{})},f0e);return()=>window.clearInterval(j)},[r,_]),w.useEffect(()=>{r!=="idle"||(t==null?void 0:t.state)!=="updating"||(x.current=t.targetVersion,b.current=t.startedAt||Date.now(),wb(t.targetVersion,b.current),d(t.targetVersion),s("submitting"))},[r,t]),w.useEffect(()=>{if(r!=="submitting"){E(0);return}const j=()=>{const L=b.current||Date.now();E(Math.max(0,Math.floor((Date.now()-L)/1e3)))};j();const T=window.setInterval(j,1e3);return()=>window.clearInterval(T)},[r]),!(t!=null&&t.enabled)||!(t.available||t.state==="updating"||r!=="idle"))return null;const N=t.releases??[],C=u||((X=N[0])==null?void 0:X.version)||t.latestVersion,S=N.find(j=>j.version===C),A=async()=>{x.current=C,b.current=Date.now(),wb(C,b.current),s("submitting"),c(""),m("idle");try{const j=await lM(C);x.current=j.version,wb(j.version,b.current),c("更新已提交,正在等待 VeFaaS 发布新版本")}catch(j){if(j instanceof TypeError){c("连接已切换,正在确认新版本状态");return}ip(),s("error");const T=j instanceof Error?j.message:"Studio 更新失败";try{const L=await _();c(L.message||T)}catch{c(T)}}},O=(M=t.updateLogs)!=null&&M.length?t.updateLogs:(t.errorLog||t.progressMessage||o).split(` -`).filter(Boolean),D=async()=>{try{await navigator.clipboard.writeText(O.join(` -`)),m("copied")}catch{m("error")}},U=()=>{var j;h(!1),m("idle"),c(""),d(x.current||((j=N[0])==null?void 0:j.version)||""),s("confirm")};return l.jsxs(l.Fragment,{children:[l.jsxs("button",{type:"button",className:`studio-update-trigger is-${r}`,title:r==="submitting"?"正在更新 Studio":r==="published"?"Studio 已更新":`更新 Studio 至 ${t.latestVersion}`,onClick:()=>{var j;r==="published"?window.location.reload():(r==="submitting"||r==="error"||(d(((j=N[0])==null?void 0:j.version)||t.latestVersion),s("confirm")),a(!0))},children:[l.jsx(fC,{className:"studio-update-icon"}),r==="submitting"?l.jsx(ta,{as:"span",children:"正在更新"}):r==="published"?l.jsx("span",{children:"刷新使用新版"}):r==="error"?l.jsx("span",{children:"更新失败"}):l.jsx("span",{children:"有新版更新"})]}),i&&r!=="idle"&&l.jsx("div",{className:"confirm-scrim",role:"presentation",children:l.jsxs("section",{className:"confirm-box studio-update-dialog",role:"dialog","aria-modal":"true","aria-labelledby":"studio-update-title",children:[l.jsx("div",{className:"studio-update-dialog-mark",children:l.jsx(fC,{})}),l.jsx("div",{id:"studio-update-title",className:"confirm-title",children:r==="error"?"Studio 更新失败":r==="submitting"?"正在更新 Studio":r==="published"?"Studio 更新完成":"发现新版本"}),r==="error"?l.jsxs("div",{className:"studio-update-error-panel",children:[l.jsx("p",{className:"confirm-text studio-update-error",children:o}),l.jsxs("dl",{className:"studio-update-error-meta",children:[l.jsxs("div",{children:[l.jsx("dt",{children:"失败阶段"}),l.jsx("dd",{children:p0e[t.errorStage]||t.errorStage||"未知阶段"})]}),l.jsxs("div",{children:[l.jsx("dt",{children:"错误 ID"}),l.jsx("dd",{children:t.errorId||"未生成"})]})]}),l.jsx(hC,{lines:O,phase:"error",copyState:p,onCopy:()=>void D()}),t.consoleUrl&&l.jsxs("a",{className:"studio-update-console-link",href:t.consoleUrl,target:"_blank",rel:"noreferrer",children:["前往 VeFaaS 控制台查看 Function 日志",l.jsx("span",{"aria-hidden":!0,children:"↗"})]})]}):r==="submitting"||r==="published"?l.jsxs(l.Fragment,{children:[l.jsxs("div",{className:"studio-update-progress-summary",children:[l.jsxs("div",{children:[l.jsx("span",{children:"目标版本"}),l.jsx("strong",{children:x.current||C})]}),l.jsxs("div",{children:[l.jsx("span",{children:r==="published"?"更新状态":"已用时"}),l.jsx("strong",{children:r==="published"?"已完成":m0e(y)})]})]}),l.jsx("ol",{className:"studio-update-progress","aria-label":"Studio 更新进度",children:dC.map((j,T)=>{const L=dC.findIndex(I=>I.id===t.progressStage),R=r==="published"||Tvoid D()}),l.jsx("p",{className:"studio-update-progress-note",children:"发布阶段会短暂中断连接;关闭此窗口不会停止更新,可随时点击右上角按钮重新查看。"})]}):l.jsxs(l.Fragment,{children:[l.jsx("p",{className:"confirm-text",children:"更新会重启 Studio 服务,预计约 3–5 分钟完成更新与发布。期间正在进行的对话、 流式响应或部署任务可能中断,登录态不会受到影响。"}),l.jsxs("div",{className:"studio-update-field",ref:g,children:[l.jsx("span",{children:"选择版本"}),l.jsxs("button",{type:"button",className:"studio-update-version-trigger","aria-label":"选择版本","aria-haspopup":"listbox","aria-expanded":f,onClick:()=>h(j=>!j),onKeyDown:j=>{(j.key==="ArrowDown"||j.key==="ArrowUp")&&(j.preventDefault(),h(!0))},children:[l.jsx("span",{children:C}),l.jsx(b0e,{})]}),f&&l.jsx("div",{className:"studio-update-version-menu",role:"listbox","aria-label":"选择版本",children:N.map(j=>{const T=j.version===C;return l.jsxs("button",{type:"button",role:"option","aria-selected":T,className:`studio-update-version-option${T?" is-selected":""}`,onClick:()=>{d(j.version),h(!1)},children:[l.jsx("span",{children:j.version}),T&&l.jsx(E0e,{})]},j.version)})})]}),l.jsxs("dl",{className:"studio-update-versions",children:[l.jsxs("div",{children:[l.jsx("dt",{children:"当前版本"}),l.jsx("dd",{children:t.currentVersion})]}),l.jsxs("div",{children:[l.jsx("dt",{children:"目标版本"}),l.jsx("dd",{children:C})]}),l.jsxs("div",{children:[l.jsx("dt",{children:"Commit"}),l.jsx("dd",{children:((S==null?void 0:S.gitSha)||t.latestGitSha).slice(0,8)})]})]}),l.jsxs("section",{className:"studio-update-changelog","aria-labelledby":"studio-update-changelog-title",children:[l.jsx("div",{id:"studio-update-changelog-title",children:"更新内容"}),S!=null&&S.changelog.length?l.jsx("ul",{children:S.changelog.map(j=>l.jsx("li",{children:j},j))}):l.jsx("p",{children:"暂无更新说明"})]})]}),l.jsxs("div",{className:"confirm-actions",children:[l.jsx("button",{type:"button",className:"confirm-btn",onClick:()=>{a(!1),h(!1),r==="confirm"&&(s("idle"),c(""))},children:r==="submitting"?"后台运行":r==="confirm"?"取消":"关闭"}),r==="confirm"&&l.jsx("button",{type:"button",className:"confirm-btn studio-update-confirm",onClick:()=>void A(),children:"立即更新"}),r==="error"&&l.jsx("button",{type:"button",className:"confirm-btn studio-update-confirm",onClick:U,children:"重新尝试"})]})]})})]})}const w0e="/web/skill-creator";class c_ extends Error{constructor(n,r){super(n);M_(this,"status");this.name="SkillCreatorApiError",this.status=r}}function tl(e,t){if(!e||typeof e!="object"||Array.isArray(e))throw new Error(`${t} 格式错误`);return e}function Zt(e,...t){for(const n of t){const r=e[n];if(typeof r=="string"&&r)return r}}function o5(e,...t){for(const n of t){const r=e[n];if(typeof r=="number"&&Number.isFinite(r))return r}}async function qf(e,t){return fetch(xi(`${w0e}${e}`),{...t,headers:Ig({Accept:"application/json",...t!=null&&t.body?{"Content-Type":"application/json"}:{},...t==null?void 0:t.headers})})}async function u_(e,t){if((e.headers.get("content-type")??"").includes("application/json")){const s=tl(await e.json(),"错误响应");return Zt(s,"detail","message","error")??t}return(await e.text()).trim()||t}async function d_(e,t){if(!e.ok)throw new c_(await u_(e,t),e.status);if(!(e.headers.get("content-type")??"").includes("application/json"))throw new Error(`${t}:服务端返回了非 JSON 响应`);return e.json()}function v0e(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 _0e(e){if(e==="provisioning"||e==="generating"||e==="validating"||e==="packaging"||e==="completed"||e==="failed")return e;throw new Error(`未知的 Skill 生成阶段:${String(e)}`)}function k0e(e){return Array.isArray(e)?e.map((t,n)=>{const r=tl(t,`文件 ${n+1}`),s=Zt(r,"path");if(!s)throw new Error(`文件 ${n+1} 缺少 path`);const i=o5(r,"size");if(i===void 0)throw new Error(`文件 ${n+1} 缺少 size`);return{path:s,size:i}}):[]}function N0e(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 S0e(e){if(e===void 0)return[];if(!Array.isArray(e))throw new Error("Skill 生成活动记录格式错误");return e.map((t,n)=>{const r=tl(t,`活动 ${n+1}`),s=Zt(r,"id"),i=Zt(r,"kind"),a=Zt(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 c=Zt(r,"name");if(!c)throw new Error(`活动 ${n+1} 缺少工具名称`);return{id:s,kind:i,name:c,args:r.input,response:r.output,status:a}}const o=Zt(r,"text");if(!o)throw new Error(`活动 ${n+1} 缺少文本`);return{id:s,kind:i,text:o,status:a}})}function T0e(e,t){const n=tl(e,`候选方案 ${t+1}`),r=Zt(n,"id","candidate_id","candidateId"),s=Zt(n,"model","model_id","modelId");if(!r||!s)throw new Error(`候选方案 ${t+1} 缺少 id 或 model`);return{id:r,model:s,modelLabel:Zt(n,"modelLabel","model_label")??s,status:v0e(n.status),stage:_0e(n.stage),name:Zt(n,"name","skill_name","skillName"),description:Zt(n,"description"),skillMd:Zt(n,"skillMd","skill_md"),files:k0e(n.files),activities:S0e(n.activities),validation:N0e(n.validation),durationMs:o5(n,"elapsedMs","elapsed_ms"),error:Zt(n,"error","error_message","errorMessage"),published:n.published===!0,skillId:Zt(n,"skill_id","skillId"),version:Zt(n,"version")}}function QE(e,t=""){const n=tl(e,"Skill 创建任务"),r=Zt(n,"id","job_id","jobId");if(!r)throw new Error("Skill 创建任务缺少 id");const s=Array.isArray(n.candidates)?n.candidates.map(T0e):[],i=Zt(n,"status")??"running";if(i!=="provisioning"&&i!=="running"&&i!=="completed")throw new Error(`未知的 Skill 任务状态:${i}`);return{id:r,prompt:Zt(n,"prompt")??t,status:i,candidates:s}}async function A0e(e,t){const n=await qf("/jobs",{method:"POST",body:JSON.stringify({prompt:e})});if(!n.ok)throw new c_(await u_(n,"创建 Skill 任务失败"),n.status);const r=n.headers.get("content-type")??"";if(r.includes("application/json")){const u=QE(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 c=u=>{if(!u.trim())return;const d=tl(JSON.parse(u),"Skill 创建进度");if(d.type==="error")throw new Error(Zt(d,"error")??"创建 Skill 任务失败");if(d.type!=="progress"&&d.type!=="complete")throw new Error("未知的 Skill 创建进度事件");o=QE(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(c),u)break}if(c(a),!o)throw new Error("创建 Skill 任务失败:服务端未返回任务");return o}async function C0e(e){const t=await qf(`/jobs/${encodeURIComponent(e)}`);return QE(await d_(t,"读取 Skill 任务失败"))}async function I0e(e){const t=await qf(`/jobs/${encodeURIComponent(e)}`,{method:"DELETE"});await d_(t,"清理 Skill 任务失败")}async function O0e(e,t){var o;const n=await qf(`/jobs/${encodeURIComponent(e)}/candidates/${encodeURIComponent(t)}/download`);if(!n.ok)throw new Error(await u_(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 R0e(e,t,n){const r=await qf(`/jobs/${encodeURIComponent(e)}/candidates/${encodeURIComponent(t)}/publish`,{method:"POST",body:JSON.stringify(n)}),s=tl(await d_(r,"添加到 AgentKit 失败"),"发布结果"),i=Zt(s,"skill_id","skillId","id");if(!i)throw new Error("发布结果缺少 skill_id");return{skillId:i,name:Zt(s,"name"),version:Zt(s,"version"),skillSpaceIds:Array.isArray(s.skillSpaceIds)?s.skillSpaceIds.map(String):Array.isArray(s.skill_space_ids)?s.skill_space_ids.map(String):[],message:Zt(s,"message")}}const L0e=()=>{};function M0e(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 j0e({activities:e}){const t=w.useMemo(()=>e.filter(n=>n.kind!=="status").map(M0e),[e]);return t.length===0?null:l.jsx("div",{className:"skill-conversation","aria-label":"Skill 生成对话","aria-live":"polite",children:l.jsx(Yv,{blocks:t,onAction:L0e})})}const pC={provisioning:"正在准备 Sandbox",generating:"正在生成 Skill",validating:"正在校验结构",packaging:"正在打包",completed:"生成完成",failed:"生成失败"},mC=12e4;function D0e({status:e}){return e==="succeeded"?l.jsxs("svg",{viewBox:"0 0 20 20","aria-hidden":"true",children:[l.jsx("circle",{cx:"10",cy:"10",r:"7"}),l.jsx("path",{d:"m6.7 10.1 2.1 2.2 4.6-4.8"})]}):e==="failed"?l.jsxs("svg",{viewBox:"0 0 20 20","aria-hidden":"true",children:[l.jsx("circle",{cx:"10",cy:"10",r:"7"}),l.jsx("path",{d:"M10 6.2v4.5M10 13.6h.01"})]}):l.jsxs("svg",{className:"skill-candidate__spinner",viewBox:"0 0 20 20","aria-hidden":"true",children:[l.jsx("circle",{cx:"10",cy:"10",r:"7"}),l.jsx("path",{d:"M10 3a7 7 0 0 1 7 7"})]})}function P0e(){return l.jsxs("svg",{viewBox:"0 0 20 20","aria-hidden":"true",children:[l.jsx("path",{d:"M4.2 3.5h7.1l4.5 4.6v8.4H4.2z"}),l.jsx("path",{d:"M11.3 3.5v4.6h4.5M7 11h6M7 13.8h4.2"})]})}function B0e(){return l.jsx("svg",{viewBox:"0 0 20 20","aria-hidden":"true",children:l.jsx("path",{d:"m9 5-5 5 5 5M4.5 10H16"})})}function F0e({candidate:e}){var c,u;const[t,n]=w.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=(c=e.skillMd)==null?void 0:c.slice(0,mC),o=(((u=e.skillMd)==null?void 0:u.length)??0)>mC;return s.length===0?null:l.jsxs("div",{className:"skill-files",children:[l.jsx("div",{className:"skill-files__tabs",role:"tablist","aria-label":`${e.name??"Skill"} 文件`,children:s.map(d=>l.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"))?l.jsxs(l.Fragment,{children:[l.jsx("pre",{className:"skill-files__content",children:l.jsx("code",{children:a})}),o?l.jsx("p",{className:"skill-files__truncated",children:"预览内容较长,完整文件请下载 ZIP 查看。"}):null]}):l.jsx("div",{className:"skill-files__unavailable",children:i?`${i.path} · ${i.size.toLocaleString()} bytes`:"文件内容将在下载包中提供"})]})}function U0e({label:e,jobId:t,candidate:n,selected:r,publishing:s,publishDisabled:i,publishError:a,onSelect:o,onPublish:c}){const[u,d]=w.useState("conversation"),[f,h]=w.useState(!1),[p,m]=w.useState(!1),[y,E]=w.useState(""),[g,x]=w.useState(""),[b,_]=w.useState(""),[k,N]=w.useState(""),C=w.useRef(null),S=w.useRef(null),A=n.status==="queued"||n.status==="running",O=n.status==="succeeded",D=n.validation;return l.jsxs("article",{className:`skill-candidate skill-candidate--${n.status}${r?" is-selected":""}`,"aria-label":`${e} ${n.model}`,children:[l.jsxs("header",{className:"skill-candidate__header",children:[l.jsx("h2",{children:n.model}),r?l.jsx("span",{className:"skill-candidate__selected",children:"已选方案"}):null]}),u==="conversation"?l.jsxs("div",{className:"skill-candidate__view skill-candidate__view--conversation",children:[l.jsxs("div",{className:"skill-candidate__status","aria-live":"polite",children:[l.jsx("span",{className:"skill-candidate__status-icon",children:l.jsx(D0e,{status:n.status})}),A?l.jsx(ta,{duration:2.2,spread:16,children:pC[n.stage]}):l.jsx("span",{children:pC[n.stage]}),n.durationMs!==void 0&&O?l.jsxs("span",{className:"skill-candidate__duration",children:[(n.durationMs/1e3).toFixed(1)," 秒"]}):null]}),l.jsx(j0e,{activities:n.activities}),n.error?l.jsx("div",{className:"skill-candidate__error",children:n.error}):null,O?l.jsx("div",{className:"skill-candidate__view-actions",children:l.jsxs("button",{ref:C,type:"button",className:"skill-action skill-action--preview",onClick:()=>{d("preview"),requestAnimationFrame(()=>{var U;return(U=S.current)==null?void 0:U.focus()})},children:[l.jsx(P0e,{}),"查看 Skill"]})}):null]}):l.jsxs("div",{className:"skill-candidate__view skill-candidate__view--preview",children:[l.jsx("div",{className:"skill-candidate__preview-nav",children:l.jsxs("button",{ref:S,type:"button",className:"skill-candidate__back",onClick:()=>{d("conversation"),requestAnimationFrame(()=>{var U;return(U=C.current)==null?void 0:U.focus()})},children:[l.jsx(B0e,{}),"返回对话"]})}),l.jsxs("div",{className:"skill-candidate__result",children:[l.jsxs("div",{className:"skill-candidate__summary",children:[l.jsxs("div",{children:[l.jsx("span",{children:"Skill"}),l.jsx("strong",{children:n.name??"未命名 Skill"})]}),l.jsxs("div",{children:[l.jsx("span",{children:"文件"}),l.jsx("strong",{children:n.files.length})]}),l.jsxs("div",{children:[l.jsx("span",{children:"校验"}),l.jsx("strong",{className:(D==null?void 0:D.valid)===!1?"is-invalid":"is-valid",children:(D==null?void 0:D.valid)===!1?"未通过":"已通过"})]})]}),n.description?l.jsx("p",{className:"skill-candidate__description",children:n.description}):null,D&&(D.errors.length>0||D.warnings.length>0)?l.jsxs("details",{className:"skill-validation",children:[l.jsx("summary",{children:"查看校验详情"}),[...D.errors,...D.warnings].map((U,X)=>l.jsx("div",{children:U},`${U}-${X}`))]}):null,l.jsx(F0e,{candidate:n}),l.jsxs("div",{className:"skill-candidate__actions",children:[l.jsx("button",{type:"button",className:"skill-action skill-action--select","aria-pressed":r,onClick:o,children:r?"已采用此方案":"采用此方案"}),l.jsx("button",{type:"button",className:"skill-action",disabled:p,onClick:()=>{m(!0),E(""),O0e(t,n.id).catch(U=>{E(U instanceof Error?U.message:String(U))}).finally(()=>m(!1))},children:p?"正在下载…":"下载 ZIP"}),l.jsx("button",{type:"button",className:"skill-action",disabled:!r||s||i||n.published,title:r?void 0:"请先采用此方案",onClick:()=>h(U=>!U),children:n.published?"已添加到 AgentKit":s?"正在添加…":"添加到 AgentKit"})]}),y?l.jsx("div",{className:"skill-candidate__error",children:y}):null,f&&r&&!n.published?l.jsxs("form",{className:"skill-publish-form",onSubmit:U=>{U.preventDefault();const X=g.split(",").map(M=>M.trim()).filter(Boolean);c({skillSpaceIds:X,...b.trim()?{projectName:b.trim()}:{},...k.trim()?{skillId:k.trim()}:{}})},children:[l.jsxs("label",{children:[l.jsx("span",{children:"SkillSpace ID(可选)"}),l.jsx("input",{value:g,onChange:U=>x(U.target.value),placeholder:"多个 ID 用英文逗号分隔"})]}),l.jsxs("div",{className:"skill-publish-form__optional",children:[l.jsxs("label",{children:[l.jsx("span",{children:"项目名称(可选)"}),l.jsx("input",{value:b,onChange:U=>_(U.target.value)})]}),l.jsxs("label",{children:[l.jsx("span",{children:"已有 Skill ID(可选)"}),l.jsx("input",{value:k,onChange:U=>N(U.target.value)})]})]}),l.jsx("button",{type:"submit",className:"skill-action skill-action--select",disabled:s,children:s?"正在添加…":"确认添加"})]}):null,a?l.jsx("div",{className:"skill-candidate__error",children:a}):null]})]})]})}const gC=new Set(["completed"]),ap=1100,$0e=3e4;function H0e(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 z0e({initialJob:e}){const[t,n]=w.useState(e),[r,s]=w.useState(""),[i,a]=w.useState(!1),[o,c]=w.useState(),[u,d]=w.useState(),[f,h]=w.useState(()=>new Set),[p,m]=w.useState({});w.useEffect(()=>{n(e),s(""),a(!1)},[e]),w.useEffect(()=>{if(gC.has(e.status)||e.id.startsWith("pending-"))return;let g=!1,x;const b=Date.now()+$0e,_=async()=>{try{const k=await C0e(e.id);g||(n({...k,prompt:k.prompt||e.prompt}),s(""),gC.has(k.status)||(x=window.setTimeout(_,ap)))}catch(k){if(!g){const N=k instanceof c_?k:void 0;if((N==null?void 0:N.status)===404&&Date.now(){g=!0,x!==void 0&&window.clearTimeout(x)}},[e.id,e.status]);const y=Wv.map((g,x)=>t.candidates.find(b=>b.model===g)??t.candidates[x]??H0e(g,x));async function E(g,x){d(g.id),m(b=>({...b,[g.id]:""}));try{await R0e(t.id,g.id,x),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 l.jsxs("section",{className:"skill-workspace",children:[l.jsx("header",{className:"skill-workspace__intro",children:l.jsx("h1",{children:"正在把需求变成可运行的 Skill"})}),r?l.jsxs("div",{className:"skill-workspace__poll-error",role:"alert",children:["状态刷新失败:",r,"。",i?"":"页面会继续重试。"]}):null,l.jsx("div",{className:"skill-workspace__grid",children:y.map((g,x)=>{const _=f.has(g.id)||g.published?{...g,published:!0}:g;return l.jsx(U0e,{label:`方案 ${x===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:()=>c(g.id),onPublish:k=>void E(g,k)},`${g.model}-${g.id}`)})})]})}const vb="/web/sandbox/sessions",V0e=33e4,K0e=6e5,Y0e=15e3;function _b(e){const t=Ig(e);return t.set("Accept","application/json"),t}async function kb(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 W0e(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 c(){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}),c()}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,c()}function f(h){let p="message";const m=[];for(const E of h.split(/\r?\n/))E.startsWith("event:")&&(p=E.slice(6).trim()),E.startsWith("data:")&&m.push(E.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 Nb={async startSession(e={}){const t=await fetch(xi(vb),{method:"POST",headers:_b({"Content-Type":"application/json"}),signal:Gs(e.signal,V0e)});if(!t.ok)throw await kb(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(xi(`${vb}/${encodeURIComponent(e.sessionId)}/messages`),{method:"POST",headers:_b({Accept:"text/event-stream","Content-Type":"application/json"}),body:JSON.stringify({message:e.text}),signal:Gs(t.signal,K0e)});if(!n.ok)throw await kb(n,"沙箱对话失败,请稍后重试。");return W0e(n,t.onBlocks)},async closeSession(e,t={}){if(!e)return;const n=await fetch(xi(`${vb}/${encodeURIComponent(e)}`),{method:"DELETE",headers:_b(),signal:Gs(t.signal,Y0e)});if(!n.ok&&n.status!==404)throw await kb(n,"无法清理 AgentKit 沙箱会话。")}},G0e=1e4;async function l5(e){const t=await fetch(xi(e),{headers:Ig({Accept:"application/json"}),signal:Gs(void 0,G0e)});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 q0e(){return l5("/web/sandbox/capabilities")}async function X0e(){return l5("/web/skill-creator/capabilities")}function Q0e(e){return l.jsxs("svg",{viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"1.75",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",...e,children:[l.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"}),l.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"}),l.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 Z0e({open:e,state:t,error:n,onCancel:r,onConfirm:s}){const i=w.useRef(null),a=w.useRef(null);if(w.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 E;if(h.key==="Escape"){h.preventDefault(),r();return}if(h.key!=="Tab")return;const p=(E=i.current)==null?void 0:E.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",c=o?"正在初始化沙箱":t==="error"?"启动失败":"启用 Codex 智能体";return Ss.createPortal(l.jsx("div",{className:"sandbox-dialog-backdrop",onMouseDown:u=>{u.target===u.currentTarget&&!o&&r()},children:l.jsxs("section",{ref:i,className:"sandbox-dialog",role:"dialog","aria-modal":"true","aria-labelledby":"sandbox-dialog-title","aria-describedby":"sandbox-dialog-description",children:[l.jsxs("div",{className:"sandbox-dialog-visual","aria-hidden":"true",children:[l.jsx("span",{className:"sandbox-dialog-orbit"}),l.jsx("span",{className:"sandbox-dialog-icon",children:o?l.jsx("span",{className:"sandbox-spinner"}):l.jsx(Q0e,{})})]}),l.jsxs("div",{className:"sandbox-dialog-copy",children:[l.jsx("h2",{id:"sandbox-dialog-title",children:c}),t==="error"?l.jsx("p",{id:"sandbox-dialog-description",className:"sandbox-dialog-error",role:"alert",children:n||"AgentKit 沙箱初始化失败,请稍后重新尝试。"}):o?l.jsx("p",{id:"sandbox-dialog-description","aria-live":"polite",children:"正在寻找可用工具并创建内置智能体会话,通常需要一点时间。"}):l.jsx("p",{id:"sandbox-dialog-description",children:"将启动 AgentKit 沙箱与 Codex 智能体,本次对话不会被持久化保存。"})]}),l.jsxs("footer",{className:"sandbox-dialog-actions",children:[l.jsx("button",{ref:a,type:"button",onClick:r,children:o?"取消启动":"取消"}),!o&&l.jsx("button",{type:"button",className:"is-primary",onClick:s,children:t==="error"?"重新尝试":"确认开启"})]})]})}),document.body)}function J0e({onExit:e}){return l.jsxs("div",{className:"sandbox-session-warning",role:"status",children:[l.jsx("span",{className:"sandbox-session-warning-dot","aria-hidden":"true"}),l.jsx("span",{className:"sandbox-session-warning-copy",children:"当前为 Codex 智能体会话,退出后对话内容消失"}),l.jsx("button",{type:"button",onClick:e,children:"退出内置智能体"})]})}function eye({filled:e=!1,...t}){return l.jsxs("svg",{viewBox:"0 0 24 24",fill:e?"currentColor":"none",stroke:"currentColor",strokeWidth:"1.75",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",...t,children:[l.jsx("rect",{x:"3.5",y:"9.3",width:"4.5",height:"10.2",rx:"1.5"}),l.jsx("path",{d:"M8 10.2 11.3 4.8c.5-.8 1.7-.45 1.7.5v3.8h4.2a2.1 2.1 0 0 1 2.04 2.6l-1.4 5.75A2.1 2.1 0 0 1 15.8 19H8"})]})}function tye({filled:e=!1,...t}){return l.jsxs("svg",{viewBox:"0 0 24 24",fill:e?"currentColor":"none",stroke:"currentColor",strokeWidth:"1.75",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",...t,children:[l.jsx("rect",{x:"3.5",y:"4.5",width:"4.5",height:"10.2",rx:"1.5"}),l.jsx("path",{d:"M8 13.8 11.3 19.2c.5.8 1.7.45 1.7-.5v-3.8h4.2a2.1 2.1 0 0 0 2.04-2.6l-1.4-5.75A2.1 2.1 0 0 0 15.8 5H8"})]})}const yC=["#6366f1","#0ea5e9","#10b981","#f59e0b","#f43f5e","#a855f7","#14b8a6","#f472b6"];function Sb(e){let t=0;for(let n=0;n>>0;return yC[t%yC.length]}function nye(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,c=e.length?Math.max(...e.map(u=>u.end_time)):1;return{rootNodes:a,min:o,total:c-o||1}}function rye(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 bC(e){const t=e/1e6;return t>=1e3?`${(t/1e3).toFixed(2)} s`:`${t.toFixed(t<10?2:1)} ms`}const sye=e=>e.replace(/^(gen_ai|a2ui|adk)\./,"");function EC(e){return Object.entries(e.attributes).filter(([,t])=>t!=null&&typeof t!="object").map(([t,n])=>{const r=String(n);return{key:sye(t),value:r,long:r.length>80||r.includes(` -`)}}).sort((t,n)=>Number(t.long)-Number(n.long))}function iye({appName:e,sessionId:t,onClose:n}){const[r,s]=w.useState(null),[i,a]=w.useState(""),[o,c]=w.useState(new Set),[u,d]=w.useState(null);w.useEffect(()=>{s(null),a(""),WL(e,t).then(x=>{s(x),d(x.length?x.reduce((b,_)=>b.start_time<=_.start_time?b:_).span_id:null)}).catch(x=>a(String(x)))},[e,t]);const{rootNodes:f,min:h,total:p}=w.useMemo(()=>nye(r??[]),[r]),m=w.useMemo(()=>rye(f,o),[f,o]),y=(r==null?void 0:r.find(x=>x.span_id===u))??null,E=p/1e6,g=x=>c(b=>{const _=new Set(b);return _.has(x)?_.delete(x):_.add(x),_});return l.jsxs(l.Fragment,{children:[l.jsx("div",{className:"drawer-scrim",onClick:n}),l.jsxs("aside",{className:"drawer drawer--trace",children:[l.jsxs("header",{className:"drawer-head",children:[l.jsxs("div",{children:[l.jsx("div",{className:"drawer-title",children:"调用链路观测"}),l.jsx("div",{className:"drawer-sub",children:r?`${r.length} 个调用 · ${E.toFixed(1)} ms`:"加载中"})]}),l.jsx("button",{className:"drawer-close",onClick:n,"aria-label":"关闭",children:l.jsx(zr,{className:"icon"})})]}),r==null&&!i&&l.jsxs("div",{className:"drawer-loading",children:[l.jsx(Rt,{className:"icon spin"})," 加载调用链路…"]}),i&&l.jsx("div",{className:"error",children:i}),r&&r.length===0&&l.jsx("div",{className:"drawer-empty",children:"该会话暂无调用链路(可能尚未产生调用)。"}),m.length>0&&l.jsxs("div",{className:"trace-split",children:[l.jsx("div",{className:"trace-tree scroll",children:m.map(x=>{const b=x.span,_=(b.start_time-h)/p*100,k=Math.max((b.end_time-b.start_time)/p*100,.6),N=x.children.length>0;return l.jsxs("button",{className:`trace-row ${u===b.span_id?"active":""}`,onClick:()=>d(b.span_id),children:[l.jsxs("span",{className:"trace-label",style:{paddingLeft:x.depth*14},children:[l.jsx("span",{className:`trace-caret ${N?"":"hidden"} ${o.has(b.span_id)?"":"open"}`,onClick:C=>{C.stopPropagation(),N&&g(b.span_id)},children:l.jsx(ws,{className:"chev"})}),l.jsx("span",{className:"trace-dot",style:{background:Sb(b.name)}}),l.jsx("span",{className:"trace-name",title:b.name,children:b.name})]}),l.jsx("span",{className:"trace-dur",children:bC(b.end_time-b.start_time)}),l.jsx("span",{className:"trace-track",children:l.jsx("span",{className:"trace-bar",style:{left:`${_}%`,width:`${k}%`,background:Sb(b.name)}})})]},b.span_id)})}),l.jsx("div",{className:"trace-detail scroll",children:y?l.jsxs(l.Fragment,{children:[l.jsx("div",{className:"td-title",children:y.name}),l.jsxs("div",{className:"td-dur",children:[l.jsx("span",{className:"td-dot",style:{background:Sb(y.name)}}),bC(y.end_time-y.start_time)]}),l.jsx("div",{className:"td-section",children:"属性"}),l.jsx("div",{className:"td-props",children:EC(y).filter(x=>!x.long).map(x=>l.jsxs("div",{className:"td-prop",children:[l.jsx("span",{className:"td-key",children:x.key}),l.jsx("span",{className:"td-val",children:x.value})]},x.key))}),EC(y).filter(x=>x.long).map(x=>l.jsxs("div",{className:"td-block",children:[l.jsx("div",{className:"td-section",children:x.key}),l.jsx("pre",{className:"td-pre",children:x.value})]},x.key))]}):l.jsx("div",{className:"drawer-empty",children:"选择左侧的一个调用查看详情"})})]})]})]})}function aye(e){return e.toLowerCase()==="github"?l.jsx(CH,{className:"icon"}):l.jsx(jH,{className:"icon"})}function oye({branding:e,onUsername:t}){const[n,r]=w.useState(null),[s,i]=w.useState(""),[a,o]=w.useState(0),[c,u]=w.useState(""),d=w.useRef(null);w.useEffect(()=>{let m=!0;return r(null),i(""),jL().then(y=>{m&&r(y)}).catch(y=>{m&&i(y instanceof Error?y.message:String(y))}),()=>{m=!1}},[a]);const f=n!==null&&n.length===0;w.useEffect(()=>{var m;f&&((m=d.current)==null||m.focus())},[f]);const h=tz.test(c),p=()=>{h&&t(c)};return l.jsxs("div",{className:"login",children:[l.jsx("header",{className:"login-top",children:l.jsxs("span",{className:"login-brand",children:[l.jsx("img",{className:"login-brand-logo",src:e.logoUrl||Hw,width:20,height:20,alt:"","aria-hidden":!0}),e.title]})}),l.jsx("main",{className:"login-main",children:l.jsxs("div",{className:"login-card",children:[l.jsx(ta,{as:"h1",className:"login-title",duration:4.8,spread:22,children:e.title}),s?l.jsxs("div",{className:"login-provider-error",role:"alert",children:[l.jsx("p",{children:s}),l.jsx("button",{type:"button",onClick:()=>o(m=>m+1),children:"重试"})]}):n===null?null:n.length>0?l.jsxs(l.Fragment,{children:[l.jsx("p",{className:"login-sub",children:"登录以继续使用"}),l.jsx("div",{className:"login-providers",children:n.map(m=>l.jsxs("button",{className:"login-btn",onClick:()=>rz(m.loginUrl),children:[aye(m.id),l.jsxs("span",{children:["使用 ",m.label," 登录"]})]},m.id))})]}):l.jsxs(l.Fragment,{children:[l.jsx("p",{className:"login-sub",children:"输入一个用户名即可开始"}),l.jsxs("form",{className:"login-name",onSubmit:m=>{m.preventDefault(),p()},children:[l.jsx("input",{ref:d,className:"login-name-input",value:c,onChange:m=>u(m.target.value),placeholder:"用户名(字母 + 数字,最多 16 位)",maxLength:16}),l.jsx("button",{type:"submit",className:"login-name-go",disabled:!h,"aria-label":"进入",children:l.jsx(id,{className:"icon"})})]}),l.jsx("p",{className:"login-hint","aria-live":"polite",children:c&&!h?"只能包含大小写字母和数字,最多 16 位。":""})]}),l.jsx("p",{className:"login-powered",children:"火山引擎 AgentKit 提供企业级 Agent 解决方案"}),l.jsxs("p",{className:"login-legal",children:["继续即表示你已阅读并同意 AgentKit"," ",l.jsx("a",{href:"https://docs.volcengine.com/docs/86681/1925174?lang=zh",target:"_blank",rel:"noreferrer",children:"产品和服务条款"})]})]})}),l.jsx("footer",{className:"login-footer",children:"© 2026 VeADK. All rights reserved."})]})}function lye({open:e,checking:t,error:n,onLogin:r}){const s=w.useRef(null);return w.useEffect(()=>{var a;if(!e)return;const i=document.body.style.overflow;return document.body.style.overflow="hidden",(a=s.current)==null||a.focus(),()=>{document.body.style.overflow=i}},[e]),e?Ss.createPortal(l.jsx("div",{className:"auth-expired-backdrop",children:l.jsxs("section",{className:"auth-expired-dialog",role:"alertdialog","aria-modal":"true","aria-labelledby":"auth-expired-title","aria-describedby":"auth-expired-description",children:[l.jsx("div",{className:"auth-expired-mark","aria-hidden":"true",children:l.jsx(Ag,{})}),l.jsxs("div",{className:"auth-expired-copy",children:[l.jsx("h2",{id:"auth-expired-title",children:"登录状态已过期"}),l.jsx("p",{id:"auth-expired-description",children:"当前编辑内容会保留。重新登录后,刚才的操作将自动继续。"}),n&&l.jsx("p",{className:"auth-expired-error",role:"alert",children:n})]}),l.jsx("footer",{className:"auth-expired-actions",children:l.jsx("button",{ref:s,type:"button",onClick:r,disabled:t,children:t?"等待登录完成…":"重新登录"})})]})}),document.body):null}function cye({node:e,ctx:t}){const n=e.variant??"default";return l.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)})}el("Button",cye);function uye({node:e,ctx:t}){return l.jsx("div",{className:"a2ui-card","data-a2ui-id":e.id,"data-a2ui-component":e.component,children:t.render(e.child)})}el("Card",uye);const dye={start:"flex-start",center:"center",end:"flex-end",spaceBetween:"space-between",spaceAround:"space-around",spaceEvenly:"space-evenly",stretch:"stretch"},fye={start:"flex-start",center:"center",end:"flex-end",stretch:"stretch"};function c5(e){return dye[e]??"flex-start"}function u5(e){return fye[e]??"stretch"}function hye({node:e,ctx:t}){const n=e.children??[];return l.jsx("div",{className:"a2ui-column","data-a2ui-id":e.id,"data-a2ui-component":e.component,style:{display:"flex",flexDirection:"column",justifyContent:c5(e.justify),alignItems:u5(e.align)},children:n.map(r=>t.render(r))})}el("Column",hye);function pye({node:e}){const t=e.axis==="vertical";return l.jsx("div",{className:`a2ui-divider ${t?"a2ui-divider--v":"a2ui-divider--h"}`,"data-a2ui-id":e.id,"data-a2ui-component":e.component})}el("Divider",pye);const mye={send:"✈️",check:"✅",close:"✖️",star:"⭐",favorite:"❤️",info:"ℹ️",help:"❓",error:"⛔",calendarToday:"📅",event:"📅",schedule:"🕒",locationOn:"📍",accountCircle:"👤",mail:"✉️",call:"📞",home:"🏠",settings:"⚙️",search:"🔍"};function gye({node:e}){const t=e.name??"";return l.jsx("span",{className:"a2ui-icon",title:t,"aria-label":t,"data-a2ui-id":e.id,"data-a2ui-component":e.component,children:mye[t]??"•"})}el("Icon",gye);function yye({node:e,ctx:t}){const n=e.children??[];return l.jsx("div",{className:"a2ui-row","data-a2ui-id":e.id,"data-a2ui-component":e.component,style:{display:"flex",flexDirection:"row",justifyContent:c5(e.justify),alignItems:u5(e.align??"center")},children:n.map(r=>t.render(r))})}el("Row",yye);const bye=new Set(["h1","h2","h3","h4","h5"]);function Eye({node:e,ctx:t}){const n=e.variant??"body",r=t.resolveString(e.text),s=bye.has(n)?n:"p";return l.jsx(s,{className:`a2ui-text a2ui-text--${n}`,"data-a2ui-id":e.id,"data-a2ui-component":e.component,children:r})}el("Text",Eye);const xye="创建 Agent",wye={intelligent:"智能模式",custom:"自定义",template:"从模板新建",workflow:"工作流",package:"代码包部署"},vl={app:"veadk.appName",view:"veadk.view",session:"veadk.sessionId"},vye=new Set,_ye=[];function Di(){return{skills:[]}}function po(e){return`veadk.agentDrafts.${encodeURIComponent(e)}`}function Tb(e){return`${po(e)}.active`}function ZE(e){return`veadk.agentOrder.${encodeURIComponent(e)}`}function kye(e){if(!e)return[];try{const t=JSON.parse(localStorage.getItem(po(e))||"[]");return Array.isArray(t)?t:[]}catch{return[]}}function Nye(e){if(!e)return[];try{const t=JSON.parse(localStorage.getItem(ZE(e))||"[]");return Array.isArray(t)?t.filter(n=>typeof n=="string"):[]}catch{return[]}}function JE(e,t){if(e.name===t||e.id===t)return e;for(const n of e.children){const r=JE(n,t);if(r)return r}}function d5(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(...d5(n)));return t}function xC(){const e=typeof localStorage<"u"?localStorage.getItem(vl.view):null;return e==="menu"||e==="intelligent"||e==="custom"||e==="template"||e==="workflow"?e:null}function Sye({className:e}){return l.jsxs("svg",{className:e,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"1.7",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":!0,children:[l.jsx("ellipse",{cx:"12",cy:"12",rx:"6.6",ry:"8.2"}),l.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 Tye(){return l.jsxs("svg",{viewBox:"0 0 24 24",width:"14",height:"14",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round","aria-hidden":!0,children:[l.jsx("rect",{x:"3",y:"4",width:"14",height:"3.2",rx:"1.2",fill:"currentColor",stroke:"none"}),l.jsx("rect",{x:"6",y:"10.4",width:"13",height:"3.2",rx:"1.2",fill:"currentColor",stroke:"none",opacity:"0.7"}),l.jsx("rect",{x:"9",y:"16.8",width:"9",height:"3.2",rx:"1.2",fill:"currentColor",stroke:"none",opacity:"0.45"})]})}function f5(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 Aye(e){if(!e)return"";const t=[];return e.ts&&t.push(f5(e.ts)),e.tokens!=null&&t.push(`${e.tokens.toLocaleString()} tokens`),t.join(" · ")}function wC(e){return e.blocks.map(t=>t.kind==="text"?t.text:"").join("").trim()}const Cye="send_a2ui_json_to_client";function Iye(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===Cye&&t.done):t.kind==="agent-transfer"?!1:t.kind==="a2ui"?B4(t.messages).some(n=>n.components[n.rootId]):t.kind==="auth")}function Oye(e){return e.blocks.some(t=>t.kind==="auth"&&!t.done)}function Rye(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",c)},o=d=>{if(!i){i=!0,a();try{s.close()}catch{}t(d)}},c=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",c);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 Lye(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 vC({text:e}){const[t,n]=w.useState(!1);return l.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?l.jsx(Js,{className:"icon"}):l.jsx(Aw,{className:"icon"})})}function Mye(e){return e==="cn-beijing"?"华北 2(北京)":e==="cn-shanghai"?"华东 2(上海)":e||"未指定"}function jye({tasks:e,onCancel:t}){const[n,r]=w.useState(!1),[s,i]=w.useState(null),a=e.filter(f=>f.status==="running").length,o=e[0],c=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 l.jsxs("div",{className:"global-deploy-center",children:[l.jsxs("button",{type:"button",className:`global-deploy-task is-${c}`,"aria-expanded":n,"aria-haspopup":"dialog",onClick:()=>r(f=>!f),children:[c==="running"?l.jsx(Rt,{className:"global-deploy-task-icon spin"}):c==="success"?l.jsx(vL,{className:"global-deploy-task-icon"}):c==="error"?l.jsx(Ag,{className:"global-deploy-task-icon"}):c==="cancelled"?l.jsx($1,{className:"global-deploy-task-icon"}):l.jsx(MH,{className:"global-deploy-task-icon"}),l.jsx("span",{className:"global-deploy-task-detail",children:u}),l.jsx(Sw,{className:`global-deploy-task-chevron${n?" is-open":""}`})]}),n&&l.jsxs(l.Fragment,{children:[l.jsx("button",{type:"button",className:"global-deploy-task-scrim","aria-label":"关闭部署任务",onClick:()=>r(!1)}),l.jsxs("section",{className:"global-deploy-popover",role:"dialog","aria-label":"部署任务",children:[l.jsxs("header",{className:"global-deploy-popover-head",children:[l.jsx("span",{children:"部署任务"}),l.jsx("span",{children:e.length})]}),l.jsx("div",{className:"global-deploy-list",children:e.length===0?l.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 l.jsxs("article",{className:`global-deploy-item is-${f.status}`,children:[l.jsxs("div",{className:"global-deploy-item-head",children:[l.jsx("span",{className:"global-deploy-runtime-name",children:f.runtimeName}),l.jsx("span",{className:"global-deploy-status",children:h})]}),l.jsxs("dl",{className:"global-deploy-meta",children:[l.jsxs("div",{children:[l.jsx("dt",{children:"Runtime 名称"}),l.jsx("dd",{children:f.runtimeName})]}),l.jsxs("div",{children:[l.jsx("dt",{children:"部署地域"}),l.jsx("dd",{children:Mye(f.region)})]}),f.runtimeId&&l.jsxs("div",{children:[l.jsx("dt",{children:"Runtime ID"}),l.jsx("dd",{children:f.runtimeId})]})]}),f.message&&f.status==="error"?l.jsx(eg,{className:"global-deploy-error",message:f.message,onRetry:f.retry}):f.message?l.jsx("p",{className:"global-deploy-message",children:f.message}):null,f.status==="running"&&l.jsxs(l.Fragment,{children:[l.jsx("div",{className:"global-deploy-progress","aria-hidden":!0,children:l.jsx("span",{style:{width:`${Math.max(6,Math.min(100,f.pct??6))}%`}})}),l.jsx("div",{className:"global-deploy-item-actions",children:l.jsx("button",{type:"button",disabled:s===f.id,onClick:()=>d(f),children:s===f.id?"取消中…":"取消部署"})})]})]},f.id)})})]})]})]})}const _C=["今天想做点什么?","有什么可以帮你的?","需要我帮你查点什么吗?","有问题尽管问我","嗨,我们开始吧","开始一段新对话吧","今天想先解决哪件事?","把你的想法告诉我吧","我们从哪里开始?","有什么任务交给我?","准备好一起推进了吗?","说说你现在最关心的问题","今天也一起把事情做好","我在,随时可以开始"],kC=()=>_C[Math.floor(Math.random()*_C.length)];function Ab(e){var t;for(const n of e)(t=n.previewUrl)!=null&&t.startsWith("blob:")&&URL.revokeObjectURL(n.previewUrl)}function Dye(){return`draft-${Date.now()}-${Math.random().toString(36).slice(2)}`}function Pye(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 Bye(){const[e,t]=w.useState([]),[n,r]=w.useState(""),[s,i]=w.useState([]),[a,o]=w.useState(""),c=w.useRef(null),[u,d]=w.useState(!1),[f,h]=w.useState([]),[p,m]=w.useState(null),[y,E]=w.useState([]),[g,x]=w.useState(!1),[b,_]=w.useState(!1),[k,N]=w.useState("confirm"),[C,S]=w.useState(""),A=w.useRef(null),O=w.useRef(null),[D,U]=w.useState({}),X=a?D[a]??[]:f,M=p?y:X,j=($,K)=>U(ae=>({...ae,[$]:typeof K=="function"?K(ae[$]??[]):K})),[T,L]=w.useState(""),[R,F]=w.useState("agent"),[I,V]=w.useState({}),[W,P]=w.useState(null),[ie,G]=w.useState(!1),re=w.useRef(0),[ue,ee]=w.useState([]),[le,ne]=w.useState(Di),[me,ye]=w.useState(null),[te,de]=w.useState(!1),[Ee,Te]=w.useState(null),[Ke,Ne]=w.useState(!1),[it,He]=w.useState([]),[Ue,Et]=w.useState(!1),rt=w.useRef(new Set),[St,ct]=w.useState(()=>new Set),[B,Q]=w.useState(()=>new Set),oe=w.useRef(new Map),be=w.useRef(new Map),Oe=($,K)=>ct(ae=>{const ge=new Set(ae);return K?ge.add($):ge.delete($),ge}),Ye=$=>{const K=be.current.get($);K!==void 0&&window.clearTimeout(K),be.current.delete($),Q(ae=>new Set(ae).add($))},tt=$=>{const K=be.current.get($);K!==void 0&&window.clearTimeout(K);const ae=window.setTimeout(()=>{be.current.delete($),Q(ge=>{const Me=new Set(ge);return Me.delete($),Me})},2400);be.current.set($,ae)},ze=w.useRef(""),[Tt,Re]=w.useState(""),[kt,Pt]=w.useState(()=>new Set),[Bt,bn]=w.useState(!1),[Xe,ft]=w.useState(!1),xt=w.useRef(null),vt=w.useCallback(()=>ft(!1),[]),[fe,$e]=w.useState(kC),[nt,qt]=w.useState(null),[fn,Lt]=w.useState(!1),[J,he]=w.useState(!1),[Le,Be]=w.useState(""),ot=w.useRef(!1),[It,st]=w.useState(null),[Z,we]=w.useState(""),[_e,We]=w.useState(),[Ve,Je]=w.useState(null),[ut,Vt]=w.useState({newChat:!0,search:!0,skillCenter:!0,history:!0,addAgent:!0,manageAgents:!0,addAgentkit:!0}),[Ft,hn]=w.useState("cloud"),[Tn,Kt]=w.useState(Wd),[os,Er]=w.useState(""),[Xn,Or]=w.useState("chat"),[Qn,ar]=w.useState(!1),[An,Xt]=w.useState(!1),[En,Un]=w.useState(!1),[or,nn]=w.useState({}),[ls,Zn]=w.useState({}),[$n,Jn]=w.useState({}),Is=St.has(a),Rr=B.has(a),xr=Is||u,cs=!!a&&Ke,Kr=p?g:xr,Ga=Kr||!p&&Rr,qa=or[a]??"",Xa=ls[a]??vye,Si=$n[a]??_ye,Hn=me==null?void 0:me.graph,Qa=[me==null?void 0:me.name,Hn==null?void 0:Hn.name,Hn==null?void 0:Hn.id].filter($=>!!$),Ti=le.targetAgent&&Hn?JE(Hn,le.targetAgent.name):Hn,Xf=(Ti==null?void 0:Ti.skills)??(le.targetAgent?[]:(me==null?void 0:me.skills)??[]),Qf=Hn?d5(Hn):[];function nl($){Ab($);for(const K of $)K.status==="uploading"?rt.current.add(K.id):K.uri&&kp(n,K.uri).catch(ae=>Re(String(ae)))}function rl(){re.current+=1;const $=W;P(null),G(!1),$&&!$.id.startsWith("pending-")&&I0e($.id).catch(K=>{Re(K instanceof Error?K.message:String(K))})}async function sl($){try{await Y1(n,Z,$),await K1(n,Z,$),i(K=>K.filter(ae=>ae.id!==$)),U(K=>{const{[$]:ae,...ge}=K;return ge})}catch(K){Re(String(K))}}function Zf($){const K=ue.find(Me=>Me.id===$);if(!K)return;const ae=ue.filter(Me=>Me.id!==$);Ab([K]),K.status==="uploading"&&rt.current.add($),ee(ae),ae.length===0&&!T.trim()&&!!a&&M.length===0?(ze.current="",o(""),sl(a)):K.uri&&kp(n,K.uri).catch(Me=>Re(String(Me)))}const q=($,K)=>{var Se,je,Ge,De,At;const ae=K.author&&K.author!=="user"?K.author:void 0;ae&&(nn(Ze=>({...Ze,[$]:ae})),Zn(Ze=>({...Ze,[$]:new Set(Ze[$]??[]).add(ae)})),Jn(Ze=>{var ht;return(ht=Ze[$])!=null&&ht.length?Ze:{...Ze,[$]:[ae]}}));const ge=((Se=K.actions)==null?void 0:Se.transferToAgent)??((je=K.actions)==null?void 0:je.transfer_to_agent);ge&&Jn(Ze=>{const ht=Ze[$]??[];return ht[ht.length-1]===ge?Ze:{...Ze,[$]:[...ht,ge]}}),(((Ge=K.actions)==null?void 0:Ge.endOfAgent)??((De=K.actions)==null?void 0:De.end_of_agent)??((At=K.actions)==null?void 0:At.escalate))&&Jn(Ze=>{const ht=Ze[$]??[];return ht.length<=1?Ze:{...Ze,[$]:ht.slice(0,-1)}})},[pe,ve]=w.useState(xC),[Qe,Mt]=w.useState([]),rn=w.useCallback($=>{Mt(K=>{const ae=K.findIndex(Me=>Me.id===$.id);if(ae===-1)return[$,...K];const ge=[...K];return ge[ae]={...ge[ae],...$},ge})},[]),pn=w.useCallback(async $=>{try{await rM($.id),Mt(K=>K.map(ae=>ae.id===$.id?{...ae,status:"cancelled",label:"已取消",message:"部署已取消,相关 Runtime 资源已请求销毁。"}:ae))}catch(K){const ae=K instanceof Error?K.message:String(K);Mt(ge=>ge.map(Me=>Me.id===$.id?{...Me,message:`取消失败:${ae}`}:Me))}},[]),[Mn,Cn]=w.useState(!0),[In,Ct]=w.useState(!1),[lr,sn]=w.useState(!1),[iu,zn]=w.useState(!1),[h5,wr]=w.useState(null),[f_,Za]=w.useState([]),[h_,Jf]=w.useState([]),[Lr,Os]=w.useState(""),us=w.useRef(null),[E0,Rs]=w.useState(!1),[p5,Vn]=w.useState(!1),x0=w.useRef(null),[w0,il]=w.useState(()=>{const $=ps();return Yc($),$}),[m5,p_]=w.useState(!1),[g5,v0]=w.useState(""),[m_,eh]=w.useState(null),[y5,g_]=w.useState({}),[al,ri]=w.useState(null),[b5,Ai]=w.useState(""),[E5,Ci]=w.useState(""),[x5,th]=w.useState(!1),_0=w.useRef(!1),nh=w.useRef(!1),w5=w.useCallback(($,K,ae)=>{!$||!Z||Za(ge=>{const Se=[{id:$,draft:K,updatedAt:Date.now(),deploymentTarget:ae},...ge.filter(je=>je.id!==$)];return localStorage.setItem(po(Z),JSON.stringify(Se)),Se})},[Z]),k0=w.useCallback($=>{!$||!Z||Za(K=>{const ae=K.filter(ge=>ge.id!==$);return localStorage.setItem(po(Z),JSON.stringify(ae)),ae})},[Z]),v5=w.useCallback($=>{if(!Z||$.length===0)return;const K=new Set($.map(ae=>ae.id));Za(ae=>{const ge=ae.filter(Me=>!K.has(Me.id));return localStorage.setItem(po(Z),JSON.stringify(ge)),ge}),K.has(Lr)&&(Os(""),wr(null),ri(null),us.current=null,localStorage.removeItem(Tb(Z)))},[Lr,Z]),y_=w.useCallback($=>{if(!$||!Z)return;const K=us.current;Za(ae=>{const ge=ae.filter(Se=>Se.id!==$),Me=(K==null?void 0:K.id)===$?[K,...ge]:ge;return localStorage.setItem(po(Z),JSON.stringify(Me)),Me})},[Z]);w.useEffect(()=>{if(!Z){Za([]),Jf([]),Os(""),us.current=null;return}const $=kye(Z);Za($),Jf(Nye(Z));const K=localStorage.getItem(Tb(Z))||"",ae=$.find(ge=>ge.id===K);us.current=ae??null,pe==="custom"&&ae&&(Os(ae.id),wr(ae.draft),ri(ae.deploymentTarget??null))},[Z]),w.useEffect(()=>{if(!Z)return;const $=Tb(Z);pe==="custom"&&Lr?localStorage.setItem($,Lr):localStorage.removeItem($)},[pe,Lr,Z]);const _5=w.useCallback($=>{if(!Z)return;const K=[...new Set($.filter(Boolean))];Jf(K),localStorage.setItem(ZE(Z),JSON.stringify(K))},[Z]),k5=w.useCallback(async $=>{const K=$.filter(Se=>!!Se.runtimeId&&Se.canDelete===!0);if(K.length===0)return;const ae=new Set,ge=new Set,Me=[];for(const Se of K)try{await uM(Se.runtimeId,Se.region??"cn-beijing"),Sm(Se.runtimeId),ae.add(Se.runtimeId),ge.add(Se.id)}catch(je){const Ge=je instanceof Error?je.message:String(je);Me.push(`${Se.label}: ${Ge}`)}if(ae.size>0&&(il(ps()),eh(Se=>{if(!Se)return Se;const je=new Set(Se);for(const Ge of ae)je.delete(Ge);return je}),g_(Se=>Object.fromEntries(Object.entries(Se).filter(([je])=>!ae.has(je)))),Jf(Se=>{const je=Se.filter(Ge=>!ge.has(Ge));return Z&&localStorage.setItem(ZE(Z),JSON.stringify(je)),je}),Za(Se=>{const je=Se.filter(Ge=>{var De;return!((De=Ge.deploymentTarget)!=null&&De.runtimeId)||!ae.has(Ge.deploymentTarget.runtimeId)});return Z&&localStorage.setItem(po(Z),JSON.stringify(je)),je}),K.some(Se=>Se.id===n)&&(ze.current="",o(""),r(""))),Me.length>0){const Se=Me.slice(0,3).join(";"),je=Me.length>3?`;另有 ${Me.length-3} 个失败`:"";throw new Error(`${Me.length} 个 Agent 删除失败:${Se}${je}`)}},[n,Z]),b_=w.useCallback(async()=>{p_(!0),v0("");try{const $=[];let K="";do{const ge=await ld({scope:"mine",region:"all",pageSize:100,nextToken:K});$.push(...ge.runtimes),K=ge.nextToken}while(K&&$.length<2e3);eh(new Set($.map(ge=>ge.runtimeId))),g_(Object.fromEntries($.map(ge=>[ge.runtimeId,{canDelete:ge.canDelete}])));const ae=[];for(const ge of $)try{await Nm(ge.runtimeId,ge.name,ge.region,ge.currentVersion)}catch{ae.push(ge.name)}il(ps()),ae.length>0&&v0(`${ae.length} 个 Runtime 暂时无法读取,请稍后重试。`)}catch($){v0($ instanceof Error?$.message:String($))}finally{p_(!1)}},[]);function rh($){console.log("create agent draft:",$),ve(null),ll()}function N0($,K){console.log("Agent added, navigating to:",$,K),il(ps()),eh(null),k0(Lr),Os(""),us.current=null,ri(null),Ai(""),Ci($),ve(null),Vn(!0),r($)}const N5=w.useCallback($=>{ve(null),zn(!1),Vn(!0),Ci(""),Ai($.id),Re("")},[]),S5=w.useCallback(async $=>{if(!$.runtimeId)throw new Error("部署完成,但未返回 Runtime ID。");const K=(al==null?void 0:al.region)??"cn-beijing",ae=await Nm($.runtimeId,$.agentName,$.region??K,$.version);il(ps()),eh(ge=>{const Me=new Set(ge??[]);return Me.add($.runtimeId),Me}),ri(null),k0(Lr),Os(""),us.current=null,Ai(""),Ci(ae),ve(null),Vn(!0),r(ae)},[Lr,k0,al]),au=w.useRef(null),ol=w.useRef(!0),aa=w.useRef(!1),Ja=w.useRef(null),E_=w.useRef({key:"",turnCount:0}),S0=(p==null?void 0:p.id)??a;w.useLayoutEffect(()=>{const $=au.current,K=E_.current,ae=K.key!==S0,ge=!ae&&M.length>K.turnCount;if(E_.current={key:S0,turnCount:M.length},!$||M.length===0||!ae&&!ge)return;ol.current=!0,aa.current=!1,Ja.current!==null&&(window.clearTimeout(Ja.current),Ja.current=null);const Me=window.matchMedia("(prefers-reduced-motion: reduce)").matches;if(ae||Me){$.scrollTop=$.scrollHeight;return}aa.current=!0,$.scrollTo({top:$.scrollHeight,behavior:"smooth"}),Ja.current=window.setTimeout(()=>{aa.current=!1,Ja.current=null},450)},[S0,M.length]),w.useLayoutEffect(()=>{const $=au.current;!$||!ol.current||aa.current||($.scrollTop=$.scrollHeight)},[Kr,M]),w.useEffect(()=>()=>{Ja.current!==null&&window.clearTimeout(Ja.current)},[]);const T5=w.useCallback(()=>{const $=au.current;!$||aa.current||(ol.current=$.scrollHeight-$.scrollTop-$.clientHeight<32)},[]),A5=w.useCallback($=>{$.deltaY<0&&(aa.current=!1,ol.current=!1)},[]),C5=w.useCallback(()=>{aa.current=!1,ol.current=!1},[]),I5=w.useCallback(()=>{const $=au.current;!$||!ol.current||aa.current||($.scrollTop=$.scrollHeight)},[]),T0=w.useCallback(()=>{st(null),z1().then($=>{we($.userId),We($.info),Xt(!!$.local),qt($.status)}).catch($=>{st($ instanceof Error?$.message:String($))})},[]);w.useEffect(()=>{T0()},[T0]),w.useEffect(()=>{const $=()=>{Be(""),Lt(!0)};return window.addEventListener(V1,$),dz()&&$(),()=>window.removeEventListener(V1,$)},[]);const O5=w.useCallback(async()=>{if(ot.current)return;ot.current=!0;const $=sz();if(!$){ot.current=!1,Be("登录窗口被浏览器拦截,请允许弹出窗口后重试。");return}he(!0),Be("");try{for(;;){await new Promise(K=>window.setTimeout(K,1e3));try{const K=await z1();if(K.status==="authenticated"){we(K.userId),We(K.info),Xt(!!K.local),qt(K.status),Lt(!1),fz(),$.close();return}}catch{}if($.closed){Be("登录窗口已关闭,请重新登录以继续当前操作。");return}}}finally{ot.current=!1,he(!1)}},[]);w.useEffect(()=>{An&&Z&&fS(Z)},[An,Z]),w.useEffect(()=>{if(nt!=="authenticated"||!Z){V({});return}let $=!1;return Promise.allSettled([q0e(),X0e()]).then(([K,ae])=>{$||V({temporaryEnabled:K.status==="fulfilled"&&K.value.enabled,skillCreateEnabled:ae.status==="fulfilled"&&ae.value.enabled})}),()=>{$=!0}},[nt,Z]),w.useEffect(()=>{if(nt!=="authenticated"||!Z){Je(null);return}let $=!1;return Je(null),aM().then(K=>{$||Je(K)}).catch(K=>{console.warn("[app] /web/access failed; using ordinary-user access:",K),$||Je(iM)}),()=>{$=!0}},[nt,Z]),w.useEffect(()=>{sM().then($=>{Vt($.features),hn($.agentsSource),Kt($.branding),Er($.version),Or($.defaultView),ar(!0)})},[]),w.useEffect(()=>{!Ve||!Qn||nh.current||(nh.current=!0,Xn==="addAgent"&&Ve.capabilities.createAgents&&(ve(null),Ct(!1),Rs(!1),Vn(!1),sn(!1),zn(!0)))},[Ve,Xn,Qn]),w.useEffect(()=>{Ve&&(Ve.capabilities.createAgents||(ve(null),wr(null),sn(!1),zn(!1),Mt([])),Ve.capabilities.manageAgents||Vn(!1))},[Ve]),w.useEffect(()=>{document.title=Tn.title;let $=document.querySelector('link[rel~="icon"]');$||($=document.createElement("link"),$.rel="icon",document.head.appendChild($)),$.removeAttribute("type"),$.href=Tn.logoUrl||Hw},[Tn]),w.useEffect(()=>{fetch("/web/runtime-config",{signal:AbortSignal.timeout(1e4)}).then($=>$.ok?$.json():null).then($=>{$&&Cn(!!$.credentials)}).catch($=>{console.warn("[app] /web/runtime-config probe failed; workbench stays hidden:",$)})},[]);function R5($){fS($),_0.current=!0,nh.current=!1,Je(null),ve(null),wr(null),Ct(!1),sn(!1),zn(!1),Rs(!1),Vn(!1),ll(),we($),We({name:$}),Xt(!0),qt("authenticated")}function L5(){nh.current=!1,Je(null),An?(nz(),we(""),We(void 0),qt("unauthenticated")):az()}w.useEffect(()=>{nt!=="unauthenticated"&&HL().then($=>{if(t($),Ft==="cloud"){r("");return}const K=localStorage.getItem(vl.app),ae=w0.flatMap(Se=>Se.apps.map(je=>Bo(Se.id,je))),ge=K&&($.includes(K)||ae.includes(K)),Me=["web_search_agent","web_demo"].find(Se=>$.includes(Se))??$.find(Se=>!/^\d/.test(Se))??$[0];r(ge?K:Me||"")}).catch($=>Re(String($)))},[nt,Ft]),w.useEffect(()=>{n&&localStorage.setItem(vl.app,n)},[n]),w.useEffect(()=>{let $=!1;if(Te(null),He([]),!n||!Z||!a){Ne(!1);return}return Ne(!0),GL(n,Z,a).then(K=>{$||(Te(K),qL(n).then(ae=>{$||He(ae)}).catch(()=>{$||He([])}))}).catch(()=>{$||Te(null)}).finally(()=>{$||Ne(!1)}),()=>{$=!0}},[n,Z,a]),w.useEffect(()=>{let $=!1;if(ye(null),ne(Di()),!n){de(!1);return}return de(!0),Fw(n).then(K=>{$||ye(K)}).catch(()=>{$||ye(null)}).finally(()=>{$||de(!1)}),()=>{$=!0}},[n]),w.useEffect(()=>{Ve&&localStorage.setItem(vl.view,Ve.capabilities.createAgents?pe??"chat":"chat")},[Ve,pe]),w.useEffect(()=>{localStorage.setItem(vl.session,a),ze.current=a},[a]),w.useEffect(()=>()=>oe.current.forEach($=>$.abort()),[]),w.useEffect(()=>()=>be.current.forEach($=>{window.clearTimeout($)}),[]),w.useEffect(()=>()=>{var $,K;($=A.current)==null||$.abort(),(K=O.current)==null||K.abort()},[]),w.useEffect(()=>{!n||!Z||(async()=>{const $=await sh(n);if(!_0.current){_0.current=!0;const K=localStorage.getItem(vl.session)||"";if(xC()===null&&K&&$.some(ae=>ae.id===K)){ih(K);return}}ll()})()},[n,Z]),w.useEffect(()=>{const $=x0.current;$&&$.app===n&&(x0.current=null,ih($.sid))},[n]);function M5($,K){Rs(!1),$===n?ih(K):(x0.current={app:$,sid:K},r($))}async function sh($){try{const K=await Dw($,Z),ae=await Promise.all(K.map(ge=>{var Me;return(Me=ge.events)!=null&&Me.length?Promise.resolve(ge):_m($,Z,ge.id)}));return i(ae),ae}catch(K){return Re(String(K)),[]}}function j5(){p||(Re(""),S(""),N("confirm"),_(!0))}function D5(){var $;($=A.current)==null||$.abort(),A.current=null,_(!1),N("confirm"),S(""),!p&&R==="temporary"&&F("agent")}async function P5(){var K;(K=A.current)==null||K.abort();const $=new AbortController;A.current=$,N("loading"),S("");try{const ae=await Nb.startSession({signal:$.signal});if(A.current!==$)return;ze.current="",o(""),h([]),L(""),ne(Di()),F("temporary"),rl(),G(!1),nl(ue),ee([]),E([]),m(ae),ve(null),Ct(!1),sn(!1),zn(!1),Rs(!1),Vn(!1),_(!1),N("confirm")}catch(ae){if((ae==null?void 0:ae.name)==="AbortError"||A.current!==$)return;S(ae instanceof Error?ae.message:String(ae)),N("error")}finally{A.current===$&&(A.current=null)}}function eo(){var K;(K=O.current)==null||K.abort(),O.current=null,x(!1),E([]),L(""),Re(""),F("agent");const $=p;m(null),$&&Nb.closeSession($.id).catch(ae=>Re(String(ae)))}async function B5($){var Me;const K=p;if(!K||g||!$.trim())return;Re("");const ae=new AbortController;(Me=O.current)==null||Me.abort(),O.current=ae;const ge=[{role:"user",blocks:[{kind:"text",text:$}],meta:{ts:Date.now()/1e3}},{role:"assistant",blocks:[]}];E(Se=>[...Se,...ge]),x(!0);try{const Se=await Nb.sendMessage({sessionId:K.id,text:$},{signal:ae.signal,onBlocks:je=>{O.current===ae&&E(Ge=>{const De=Ge.slice(),At=De[De.length-1];return(At==null?void 0:At.role)==="assistant"&&(De[De.length-1]={...At,blocks:je}),De})}});if(O.current!==ae)return;E(je=>{const Ge=je.slice(),De=Ge[Ge.length-1];return(De==null?void 0:De.role)==="assistant"&&(Ge[Ge.length-1]={...De,blocks:Se.blocks,meta:{ts:Date.now()/1e3}}),Ge})}catch(Se){if((Se==null?void 0:Se.name)==="AbortError"||O.current!==ae)return;E(je=>je.slice(0,-2)),L($),Re(`内置智能体发送失败:${Se instanceof Error?Se.message:String(Se)}`)}finally{O.current===ae&&(O.current=null,x(!1))}}function ll(){eo(),Re(""),ft(!1),$e(kC()),F("agent"),rl(),G(!1);const $=a&&X.length===0&&ue.length>0?a:"";ze.current="",o(""),Te(null),He([]),d(!1),h([]),ne(Di()),nl(ue),ee([]),$&&sl($)}async function F5($){var K;try{(K=oe.current.get($))==null||K.abort(),await Y1(n,Z,$),await K1(n,Z,$);const ae=be.current.get($);ae!==void 0&&window.clearTimeout(ae),be.current.delete($),Q(ge=>{if(!ge.has($))return ge;const Me=new Set(ge);return Me.delete($),Me}),U(ge=>{const{[$]:Me,...Se}=ge;return Se}),$===a&&ll(),await sh(n)}catch(ae){Re(String(ae))}}async function ih($){if(p&&eo(),$!==a&&(ze.current=$,Re(""),d(!1),h([]),F("agent"),rl(),ne(Di()),Te(null),He([]),o($),D[$]===void 0)){Un(!0);try{const K=await _m(n,Z,$);j($,Iz(K.events??[],K.state))}catch(K){Re(String(K))}finally{Un(!1)}}}async function x_($=!0){if(a)return a;c.current||(c.current=vm(n,Z));const K=c.current;try{const ae=await K;$&&o(ae);const ge=Date.now()/1e3,Me={id:ae,lastUpdateTime:ge,events:[]};return i(Se=>[Me,...Se.filter(je=>je.id!==ae)]),ae}finally{c.current===K&&(c.current=null)}}async function w_($){if(!n||!Z||!a||!Ee)return!1;Et(!0),Re("");try{const K=await QL(n,Z,a,$,Ee.revision);return Te(K),!0}catch(K){return Re(String(K)),!1}finally{Et(!1)}}async function v_($){if(!(!n||!Z||!a||!Ee)){Et(!0),Re("");try{const K=await ZL(n,Z,a,$,Ee.revision);Te(K)}catch(K){Re(String(K))}finally{Et(!1)}}}async function U5($){Re("");let K;try{K=await x_()}catch(ge){Re(String(ge));return}const ae=Array.from($).map(ge=>({file:ge,attachment:{id:Dye(),mimeType:Pye(ge),name:ge.name,sizeBytes:ge.size,status:"uploading"}}));ee(ge=>[...ge,...ae.map(Me=>Me.attachment)]),await Promise.all(ae.map(async({file:ge,attachment:Me})=>{try{const Se=await VL(n,Z,K,ge);if(rt.current.delete(Me.id)){Se.uri&&await kp(n,Se.uri);return}ee(je=>je.map(Ge=>Ge.id===Me.id?Se:Ge))}catch(Se){if(rt.current.delete(Me.id))return;const je=Se instanceof Error?Se.message:String(Se);ee(Ge=>Ge.map(De=>De.id===Me.id?{...De,status:"error",error:je}:De)),Re(je)}}))}async function __($,K=[],ae=Di()){if(!$.trim()&&K.length===0||xr||cs||!n||!Z)return;Re("");const ge=[];(ae.skills.length>0||ae.targetAgent)&&ge.push({kind:"invocation",value:ae}),K.length&&ge.push({kind:"attachment",files:K.map(De=>({id:De.id,mimeType:De.mimeType,data:De.data,uri:De.uri,name:De.name,sizeBytes:De.sizeBytes}))}),$.trim()&&ge.push({kind:"text",text:$});const Me=[{role:"user",blocks:ge,meta:{ts:Date.now()/1e3}},{role:"assistant",blocks:[]}],Se=!a;Se&&(h(Me),d(!0));let je;try{je=await x_(!Se)}catch(De){Se&&(h([]),d(!1),L($),ne(ae)),Re(String(De));return}j(je,De=>Se?Me:[...De,...Me]),Se&&(ze.current=je,o(je),h([]),d(!1));const Ge=new AbortController;oe.current.set(je,Ge),Oe(je,!0),Ye(je),ze.current=je,nn(De=>({...De,[je]:""})),Zn(De=>({...De,[je]:new Set})),Jn(De=>({...De,[je]:[]}));try{let De=zs(),At="",Ze=0,ht=Date.now()/1e3,an="",Wr="";for await(const mn of Yd({appName:n,userId:Z,sessionId:je,text:$,attachments:K,invocation:ae,signal:Ge.signal,sessionCapabilities:Ee!==null})){if(Ge.signal.aborted)break;const Ii=mn.error??mn.errorMessage??mn.error_message;if(typeof Ii=="string"&&Ii){ze.current===je&&Re(Ii);break}q(je,mn);const Oi=mn.author&&mn.author!=="user"?mn.author:"";Oi&&Oi!==At&&(At=Oi,De=zs()),De=Ec(De,mn);const ii=mn.usageMetadata??mn.usage_metadata;ii!=null&&ii.totalTokenCount&&(Ze=ii.totalTokenCount),mn.timestamp&&(ht=mn.timestamp),mn.id&&(an=mn.id);const jn=mn.invocationId??mn.invocation_id;jn&&(Wr=jn);const ds=De.blocks,ai={author:At||void 0,tokens:Ze||void 0,ts:ht,eventId:an||void 0,invocationId:Wr||void 0};j(je,Ri=>{var Li;const er=Ri.slice(),oa=er[er.length-1];return(oa==null?void 0:oa.role)==="assistant"&&(!((Li=oa.meta)!=null&&Li.author)||oa.meta.author===At)?er[er.length-1]={...oa,blocks:ds,meta:ai}:er.push({role:"assistant",blocks:ds,meta:ai}),er})}sh(n)}catch(De){(De==null?void 0:De.name)!=="AbortError"&&!Ge.signal.aborted&&ze.current===je&&Re(String(De))}finally{oe.current.get(je)===Ge&&oe.current.delete(je),Oe(je,!1),tt(je),nn(De=>({...De,[je]:""})),Jn(De=>({...De,[je]:[]}))}}function $5($,K){var Me,Se;const ae=((Me=$==null?void 0:$.event)==null?void 0:Me.name)??K.id,ge=((Se=$==null?void 0:$.event)==null?void 0:Se.context)??{};__(`[ui-action] ${ae}: ${JSON.stringify(ge)}`)}async function H5($){var De,At,Ze;if(!$.authUri)throw new Error("事件中没有授权地址。");if(!n||!Z||!a)throw new Error("会话尚未就绪。");const K=a,ae=await Rye($.authUri),ge=Lye($.authConfig,ae),Me=ht=>ht.map(an=>an.kind==="auth"&&!an.done?{...an,done:!0}:an);j(K,ht=>{const an=ht.slice(),Wr=an[an.length-1];return(Wr==null?void 0:Wr.role)==="assistant"&&(an[an.length-1]={...Wr,blocks:Me(Wr.blocks)}),an});const Se=M[M.length-1],je=Me(Se&&Se.role==="assistant"?Se.blocks:[]),Ge=new AbortController;oe.current.set(K,Ge),Oe(K,!0),Ye(K);try{let ht=zs(),an=((De=Se==null?void 0:Se.meta)==null?void 0:De.author)??"",Wr=je,mn=0,Ii=Date.now()/1e3,Oi=((At=Se==null?void 0:Se.meta)==null?void 0:At.eventId)??"",ii=((Ze=Se==null?void 0:Se.meta)==null?void 0:Ze.invocationId)??"";for await(const jn of Yd({appName:n,userId:Z,sessionId:a,text:"",functionResponses:[{id:$.callId,name:"adk_request_credential",response:ge}],signal:Ge.signal,sessionCapabilities:Ee!==null})){if(Ge.signal.aborted)break;q(K,jn);const ds=jn.author&&jn.author!=="user"?jn.author:"";ds&&ds!==an&&(an=ds,Wr=[],ht=zs()),ht=Ec(ht,jn);const ai=jn.usageMetadata??jn.usage_metadata;ai!=null&&ai.totalTokenCount&&(mn=ai.totalTokenCount),jn.timestamp&&(Ii=jn.timestamp),jn.id&&(Oi=jn.id);const Ri=jn.invocationId??jn.invocation_id;Ri&&(ii=Ri);const er=[...Wr,...ht.blocks];j(K,oa=>{var C_,I_,O_,R_,L_;const Li=oa.slice(),Kn=Li[Li.length-1],A_={author:an||((C_=Kn==null?void 0:Kn.meta)==null?void 0:C_.author),tokens:mn||((I_=Kn==null?void 0:Kn.meta)==null?void 0:I_.tokens),ts:Ii,eventId:Oi||((O_=Kn==null?void 0:Kn.meta)==null?void 0:O_.eventId),invocationId:ii||((R_=Kn==null?void 0:Kn.meta)==null?void 0:R_.invocationId)};return(Kn==null?void 0:Kn.role)==="assistant"&&(!((L_=Kn.meta)!=null&&L_.author)||Kn.meta.author===an)?Li[Li.length-1]={...Kn,blocks:er,meta:A_}:Li.push({role:"assistant",blocks:er,meta:A_}),Li})}sh(n)}catch(ht){(ht==null?void 0:ht.name)!=="AbortError"&&!Ge.signal.aborted&&ze.current===K&&Re(String(ht))}finally{oe.current.get(K)===Ge&&oe.current.delete(K),Oe(K,!1),tt(K),nn(ht=>({...ht,[K]:""})),Jn(ht=>({...ht,[K]:[]}))}}if(It)return l.jsxs("div",{className:"boot boot-error",children:[l.jsx("p",{children:It}),l.jsx("button",{type:"button",onClick:T0,children:"重试"})]});if(nt===null)return l.jsx("div",{className:"boot"});if(nt==="unauthenticated")return l.jsx(oye,{branding:Tn,onUsername:R5});if(!Ve)return l.jsx("div",{className:"boot"});const si=Ve.capabilities.createAgents,k_=Ve.capabilities.manageAgents,Ls=si?pe:null,ah=si&&iu,oh=si&&lr,A0=p5,N_=xM(e,w0),ou=N_.filter($=>$.runtimeId&&(m_===null||m_.has($.runtimeId))).map($=>{var K;return{...$,canDelete:$.runtimeId?((K=y5[$.runtimeId])==null?void 0:K.canDelete)===!0:!1}}),z5=(()=>{if(ou.length===0)return ou;const $=new Map(h_.map((K,ae)=>[K,ae]));return[...ou].sort((K,ae)=>{const ge=$.get(K.id),Me=$.get(ae.id);return ge!=null&&Me!=null?ge-Me:ge!=null?-1:Me!=null?1:ou.indexOf(K)-ou.indexOf(ae)})})(),C0=$=>{var K;return((K=N_.find(ae=>ae.id===$))==null?void 0:K.label)??$},Yr=w0.find($=>$.runtimeId&&$.apps.some(K=>Bo($.id,K)===n)),I0=Yr&&Yr.runtimeId?{runtimeId:Yr.runtimeId,name:Yr.name,region:Yr.region??"cn-beijing"}:void 0,S_=async($,K)=>{var je,Ge;const ae=(je=$.meta)==null?void 0:je.eventId,ge=a;if(!ae||!ge||!I0)return;const Me=(Ge=$.meta)==null?void 0:Ge.feedback,Se={...Me,rating:K,syncStatus:"syncing",updatedAt:Date.now()/1e3};j(ge,De=>De.map(At=>{var Ze;return((Ze=At.meta)==null?void 0:Ze.eventId)===ae?{...At,meta:{...At.meta,feedback:Se}}:At})),Pt(De=>new Set(De).add(ae));try{const De=await zL({appName:n,userId:Z,sessionId:ge,eventId:ae,rating:K});j(ge,At=>At.map(Ze=>{var ht;return((ht=Ze.meta)==null?void 0:ht.eventId)===ae?{...Ze,meta:{...Ze.meta,feedback:De}}:Ze})),i(At=>At.map(Ze=>Ze.id===ge?{...Ze,state:{...Ze.state??{},[`veadk_feedback:${ae}`]:De}}:Ze))}catch(De){j(ge,At=>At.map(Ze=>{var ht;return((ht=Ze.meta)==null?void 0:ht.eventId)===ae?{...Ze,meta:{...Ze.meta,feedback:Me}}:Ze})),ze.current===ge&&Re(De instanceof Error?De.message:String(De))}finally{Pt(De=>{const At=new Set(De);return At.delete(ae),At})}},T_=$=>{il(ps()),ze.current="",o(""),r($)};return l.jsxs("div",{className:"layout",children:[l.jsx(Xz,{branding:Tn,access:Ve,features:ut,sessions:s,currentSessionId:a,streamingSids:St,onNewChat:()=>{ve(null),Ct(!1),sn(!1),zn(!1),Rs(!1),Vn(!1),ll()},onSearch:()=>{p&&eo(),ve(null),Ct(!1),sn(!1),zn(!1),Vn(!1),Rs(!0),Re("")},onQuickCreate:()=>{if(!si){Re("当前账号没有添加 Agent 的权限。");return}p&&eo(),ze.current="",o(""),Ct(!1),sn(!1),Rs(!1),Vn(!1),ve(null),wr(null),zn(!0),Re("")},onSkillCenter:()=>{p&&eo(),ve(null),sn(!1),zn(!1),Rs(!1),Vn(!1),Ct(!0),Re("")},onAddAgent:()=>{if(!si){Re("当前账号没有添加 Agent 的权限。");return}p&&eo(),ze.current="",ve(null),Ct(!1),Rs(!1),Vn(!1),o(""),zn(!1),sn(!0),Re("")},onManageAgents:()=>{p&&eo(),ze.current="",o(""),ve(null),Ct(!1),sn(!1),zn(!1),Rs(!1),Vn(!0),Re(""),b_()},onPickSession:$=>{ve(null),Ct(!1),sn(!1),zn(!1),Rs(!1),Vn(!1),Re(""),ih($)},onDeleteSession:F5,userInfo:_e,version:os,onLogout:L5}),(()=>{const $=l.jsxs("div",{className:`composer-slot${p?" sandbox-composer-wrap":""}`,children:[p&&l.jsx(J0e,{onExit:ll}),l.jsx(fpe,{sessionId:p?p.id:a,sessionInitializing:!p&&u,appName:n,agentName:p?"AgentKit 沙箱":n?C0(n):"Agent",value:T,onChange:L,onSubmit:()=>{if(!p&&R==="skill-create"){const Me=T.trim();if(!Me||ie)return;const Se={id:`pending-${Date.now()}`,prompt:Me,status:"provisioning",candidates:Wv.map((Ge,De)=>({id:`pending-${De}`,model:Ge,modelLabel:Ge,status:"queued",stage:"provisioning",files:[],activities:[{id:"provisioning",kind:"status",text:"正在拉起 Sandbox",status:"running"}]}))};G(!0);const je=++re.current;Re(""),P(Se),L(""),A0e(Me,Ge=>{re.current===je&&P(Ge)}).then(Ge=>{re.current===je&&P(Ge)}).catch(Ge=>{re.current===je&&(P(null),L(Me),Re(Ge instanceof Error?Ge.message:String(Ge)))}).finally(()=>{re.current===je&&G(!1)});return}const K=T;if(L(""),p){B5(K);return}const ae=ue,ge=le;ee([]),ne(Di()),__(K,ae,ge),Ab(ae)},disabled:p?!1:!Z||R==="temporary"||R==="agent"&&!n,busy:p?g:R==="skill-create"?ie:xr,showMeta:M.length>0&&!p,attachments:p?[]:ue,skills:p?[]:Xf,agents:p?[]:Qf,invocation:p?Di():le,capabilitiesLoading:!p&&te,allowAttachments:!p,onInvocationChange:ne,onAddFiles:U5,onRemoveAttachment:Zf,newChatMode:p?"agent":R,newChatLayout:!p&&M.length===0&&W===null,showModeSelector:!p&&M.length===0&&W===null,temporaryEnabled:I.temporaryEnabled,skillCreateEnabled:I.skillCreateEnabled,onModeChange:K=>{if(!(K==="temporary"&&!I.temporaryEnabled||K==="skill-create"&&!I.skillCreateEnabled)){if(K==="temporary"){F(K),j5();return}if(F(K),Re(""),K==="skill-create"){ne(Di());const ae=a&&X.length===0&&ue.length>0?a:"";nl(ue),ee([]),ae&&(ze.current="",o(""),sl(ae))}}}})]});return l.jsxs("section",{className:"main-shell",children:[l.jsx(dV,{appName:n,onAppChange:T_,agentLabel:C0,agentsSource:Ft,localApps:e,currentRuntime:I0,runtimeScope:Ve.capabilities.runtimeScope,title:ah?"添加 Agent":oh?"添加 AgentKit 智能体":A0?"智能体":void 0,titleLeading:M.length>0&&!p&&R==="agent"&&!ah&&!oh&&!In&&!E0&&!A0&&Ls===null&&n?l.jsx("button",{ref:xt,type:"button",className:"agent-info-trigger","aria-label":"查看 Agent 信息",title:"Agent 信息","aria-expanded":Xe,onClick:()=>ft(!0),children:l.jsx(xc,{})}):void 0,crumbs:In?[{label:"技能中心"},{label:"AgentKit Skill 空间"}]:E0||oh||ah||!Ls?void 0:Ls==="menu"?[{label:xye,onClick:()=>{ve(null),wr(null),zn(!0)}},{label:"从 0 快速创建"}]:[{label:"从 0 快速创建",onClick:()=>th(!0)},{label:wye[Ls]}],rightContent:l.jsxs(l.Fragment,{children:[Ve.role==="admin"&&l.jsx(x0e,{}),l.jsx(jye,{tasks:si?Qe:[],onCancel:pn})]})}),l.jsxs("main",{className:`main${p?" is-sandbox-session":""}`,children:[Tt&&l.jsx("div",{className:"error",children:Tt}),En&&l.jsxs("div",{className:"session-loading",children:[l.jsx(Rt,{className:"icon spin"})," 加载会话…"]}),A0?l.jsx(vhe,{agents:z5,drafts:f_,agentOrder:h_,selectedAgentId:n,agentInfo:me,agentInfoAgentId:n,loadingAgentInfo:te,canCreate:si,canUpdate:si||k_,loadingAgents:m5,agentsError:g5,deploymentTasks:Qe,focusedDeploymentTaskId:b5,focusedAgentId:E5,onRetryAgents:()=>void b_(),onAgentOrderChange:_5,onDeleteAgents:k5,onDeleteDrafts:v5,onSelectAgent:T_,onCreateAgent:()=>{if(!si){Re("当前账号没有添加 Agent 的权限。");return}Vn(!1),zn(!0),ve(null),wr(null),ri(null),Os(""),us.current=null,Ai(""),Ci(""),Re("")},onUpdateAgent:K=>{if(!k_&&!si){Re("当前账号没有管理 Agent 的权限。");return}if(!(Yr!=null&&Yr.runtimeId)){Re("仅支持更新已部署的云端智能体。");return}Vn(!1),wr(K);const ae=`runtime-${Yr.runtimeId}`;Os(ae),us.current=f_.find(ge=>ge.id===ae)??null,Ai(""),Ci(""),ri({runtimeId:Yr.runtimeId,name:Yr.name,region:Yr.region??"cn-beijing",currentVersion:Yr.currentVersion}),ve("custom"),Re("")},onEditDraft:K=>{Vn(!1),wr(K.draft),Os(K.id),us.current=K,ri(K.deploymentTarget??null),Ai(""),Ci(""),ve("custom"),Re("")}}):ah?l.jsx(G4,{title:"您想以哪种方式添加 Agent 来运行?",sub:"选择最适合你的方式,下一步即可开始",cards:[{key:"scratch",icon:Sye,title:"从 0 快速创建",desc:"用智能 / 自定义 / 模板 / 工作流的方式从零创建一个 Agent。",onClick:()=>{zn(!1),wr(null),ve("menu")}},{key:"package",icon:wH,title:"从代码包添加和部署",desc:"上传 Agent 项目压缩包,查看代码并直接部署到 AgentKit Runtime。",onClick:()=>{zn(!1),wr(null),ve("package")}}]}):E0?l.jsx(zz,{userId:Z,appId:n,agentInfo:me,capabilitiesLoading:te,agentLabel:C0,onOpenSession:M5}):oh?l.jsx(dre,{onAdded:K=>{il(ps()),sn(!1),r(K)},onCancel:()=>sn(!1)}):In?l.jsx(ure,{}):Ls!==null&&!Mn?l.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:[l.jsx("div",{style:{fontSize:18,fontWeight:600},children:"需要配置火山引擎 AK/SK"}),l.jsxs("div",{style:{maxWidth:420,lineHeight:1.6},children:["智能体工作台需要 Volcengine 凭据才能使用。请在运行环境中设置"," ",l.jsx("code",{children:"VOLCENGINE_ACCESS_KEY"})," 与"," ",l.jsx("code",{children:"VOLCENGINE_SECRET_KEY"})," 后重试。"]})]}):Ls==="menu"?l.jsx(Lme,{onSelect:K=>{wr(null),ri(null),Ai(""),Ci(""),Os(K==="custom"?`draft-${Date.now().toString(36)}`:""),us.current=null,ve(K)},onImport:K=>{wr(K),ri(null),Ai(""),Ci(""),Os(`draft-${Date.now().toString(36)}`),us.current=null,ve("custom")}}):Ls==="intelligent"?l.jsx(sge,{userId:Z,onBack:()=>ve("menu"),onCreate:rh,onAgentAdded:N0,onDeploymentTaskChange:rn}):Ls==="custom"?l.jsx(Gge,{initialDraft:h5??void 0,onBack:()=>ve("menu"),onCreate:rh,onAgentAdded:N0,features:ut,onDeploymentTaskChange:rn,deploymentTarget:al??void 0,onDraftChange:(K,ae)=>{Lr&&(ae?w5(Lr,K,al??void 0):y_(Lr))},onDiscard:Lr?()=>{y_(Lr),Os(""),us.current=null,wr(null),ri(null),Ai(""),Ci(n),ve(null),zn(!1),Vn(!0),Re("")}:void 0,onDeploymentStarted:N5,onDeploymentComplete:S5},Lr||"custom"):Ls==="template"?l.jsx(Qge,{onBack:()=>ve("menu"),onCreate:rh}):Ls==="workflow"?l.jsx(i0e,{onBack:()=>ve("menu"),onCreate:rh}):Ls==="package"?l.jsx(u0e,{onBack:()=>{ve(null),zn(!0)},onAgentAdded:N0,onDeploymentTaskChange:rn}):M.length===0&&W?l.jsx(z0e,{initialJob:W}):M.length===0?l.jsxs("div",{className:"welcome",children:[l.jsx(ta,{as:"h1",className:"welcome-title",duration:4.8,spread:22,children:p?"让灵感在临时空间里自由生长":R==="skill-create"?"想创建一个什么 Skill?":fe}),$]}):l.jsxs(l.Fragment,{children:[l.jsx("div",{className:`transcript${Ga?" is-streaming":""}`,ref:au,onScroll:T5,onWheel:A5,onTouchMove:C5,children:M.map((K,ae)=>{var mn,Ii,Oi,ii,jn;const ge=ae===M.length-1;if(K.role==="user"){const ds=K.blocks.map(er=>er.kind==="text"?er.text:"").join(""),ai=K.blocks.flatMap(er=>er.kind==="attachment"?er.files:[]),Ri=K.blocks.find(er=>er.kind==="invocation");return l.jsxs($t.div,{className:"turn turn--user",initial:{opacity:0,y:8},animate:{opacity:1,y:0},transition:{duration:.2,ease:"easeOut"},children:[(Ri==null?void 0:Ri.kind)==="invocation"&&l.jsx(zv,{value:Ri.value}),ai.length>0&&l.jsx(Kv,{appName:n,items:ai}),ds&&l.jsx("div",{className:"bubble",children:l.jsx(Mf,{text:ds})}),l.jsxs("div",{className:"turn-actions turn-actions--right",children:[((mn=K.meta)==null?void 0:mn.ts)&&l.jsx("span",{className:"meta-text",children:f5(K.meta.ts)}),l.jsx(vC,{text:ds})]})]},ae)}const Me=((Ii=K.meta)==null?void 0:Ii.author)??"",Se=Me&&Hn?JE(Hn,Me):void 0,je=!!(Me&&Qa.length>0&&!Qa.includes(Me)),Ge=(Se==null?void 0:Se.name)||Me,De=(Se==null?void 0:Se.description)||(je?"正在执行主 Agent 移交的任务。":"");if(K.blocks.length>0&&K.blocks.every(ds=>ds.kind==="agent-transfer"))return null;const At=K.blocks.length===0,Ze=((ii=(Oi=K.meta)==null?void 0:Oi.feedback)==null?void 0:ii.rating)??null,ht=((jn=K.meta)==null?void 0:jn.eventId)??"",an=kt.has(ht),Wr=!!(I0&&ht&&wC(K));return l.jsxs($t.div,{className:`turn turn--assistant${je?" turn--subagent":""}`,initial:{opacity:0,y:8},animate:{opacity:1,y:0},transition:{duration:.2,ease:"easeOut"},children:[je&&l.jsxs(l.Fragment,{children:[l.jsxs("div",{className:"subagent-run-label",children:[l.jsxs("span",{className:"subagent-run-handoff",children:[l.jsx(yH,{}),l.jsx("span",{children:"智能体移交"})]}),l.jsx("span",{className:"subagent-run-title",children:Ge})]}),l.jsx("p",{className:"subagent-run-description",title:De,children:De})]}),At?ge&&Kr?l.jsx(Y4,{}):null:l.jsxs(l.Fragment,{children:[l.jsx(Yv,{appName:n,blocks:K.blocks,streaming:ge&&(Kr||Rr),onStreamFrame:ge?I5:void 0,onAction:$5,onAuth:H5}),!(ge&&Kr)&&!Iye(K)&&l.jsx("div",{className:"turn-empty",children:"本次没有返回可显示的内容。"}),!(ge&&Kr)&&!Oye(K)&&l.jsxs("div",{className:"turn-meta",children:[l.jsxs("div",{className:"turn-actions",children:[Wr&&l.jsxs(l.Fragment,{children:[l.jsx("button",{type:"button",className:`icon-btn feedback-btn${Ze==="good"?" feedback-btn--good":""}`,"aria-label":"赞","aria-pressed":Ze==="good","aria-busy":an,title:Ze==="good"?"取消点赞":"赞",disabled:an,onClick:()=>void S_(K,Ze==="good"?null:"good"),children:l.jsx(eye,{className:"icon",filled:Ze==="good"})}),l.jsx("button",{type:"button",className:`icon-btn feedback-btn${Ze==="bad"?" feedback-btn--bad":""}`,"aria-label":"踩","aria-pressed":Ze==="bad","aria-busy":an,title:Ze==="bad"?"取消点踩":"踩",disabled:an,onClick:()=>void S_(K,Ze==="bad"?null:"bad"),children:l.jsx(tye,{className:"icon",filled:Ze==="bad"})})]}),!p&&l.jsx("button",{className:"icon-btn",title:"Tracing 火焰图",onClick:()=>bn(!0),children:l.jsx(Tye,{})}),l.jsx(vC,{text:wC(K)})]}),K.meta&&l.jsx("span",{className:"meta-text",children:Aye(K.meta)})]})]})]},ae)})}),!p&&l.jsx(RM,{appName:n,info:me,loading:te,activeAgent:qa,seenAgents:Xa,execPath:Si,capabilities:Ee,capabilityLoading:Ke,capabilityMutating:Ue,builtinTools:it,onAddCapability:w_,onRemoveCapability:K=>void v_(K)}),l.jsx("div",{className:"conversation-composer-slot",children:$})]})]})]})})(),Bt&&a&&l.jsx(iye,{appName:n,sessionId:a,onClose:()=>bn(!1)}),Xe&&M.length>0&&l.jsx(CV,{appName:n,info:me,loading:te,activeAgent:qa,seenAgents:Xa,execPath:Si,capabilities:Ee,capabilityLoading:Ke,capabilityMutating:Ue,builtinTools:it,onAddCapability:w_,onRemoveCapability:$=>void v_($),onClose:vt,returnFocusRef:xt}),l.jsx(Z0e,{open:b,state:k,error:C,onCancel:D5,onConfirm:()=>void P5()}),l.jsx(lye,{open:fn,checking:J,error:Le,onLogin:()=>void O5()}),x5&&l.jsx("div",{className:"confirm-scrim",onClick:()=>th(!1),children:l.jsxs("div",{className:"confirm-box",onClick:$=>$.stopPropagation(),children:[l.jsx("div",{className:"confirm-title",children:"返回创建首页?"}),l.jsx("div",{className:"confirm-text",children:"返回后当前填写的内容将会丢失,确定要返回吗?"}),l.jsxs("div",{className:"confirm-actions",children:[l.jsx("button",{className:"confirm-btn",onClick:()=>th(!1),children:"取消"}),l.jsx("button",{className:"confirm-btn confirm-btn--danger",onClick:()=>{wr(null),ve("menu"),th(!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})()||Cb.createRoot(document.getElementById("root")).render(l.jsx(dt.StrictMode,{children:l.jsx(AF,{reducedMotion:"user",children:l.jsx(oH,{maskOpacity:.9,children:l.jsx(Bye,{})})})}));export{w as A,Bg as B,ts as C,zye as D,cd as E,Fo as F,w3 as G,Uye as R,yr as V,dt as a,kc as b,yT as c,Vye as d,qw as e,DW as f,Qd as g,_t as h,Jq as i,aX as j,BW as k,pf as l,aQ as m,$q as n,Hq as o,pQ as p,MX as q,jX as r,R3 as s,l as t,qe as u,Dt as v,yt as w,Hye as x,Qq as y,Ss as z}; diff --git a/veadk/webui/assets/index-CAXfcGsL.css b/veadk/webui/assets/index-CAXfcGsL.css new file mode 100644 index 00000000..8ab64c09 --- /dev/null +++ b/veadk/webui/assets/index-CAXfcGsL.css @@ -0,0 +1,10 @@ +.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}}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}.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))}.abc-root{--cw-workbench-toolbar-height: 64px;--cw-workspace-ink: 222 24% 13%;--cw-workspace-accent: 162 44% 32%;--cw-workspace-accent-soft: 156 34% 92%;--cw-workspace-warm: 42 28% 96%;flex:0 1 52%;min-width:460px;min-height:0;display:flex;flex-direction:column;overflow:hidden;border-right:0;background:#fff}.abc-canvas{flex:1;min-height:0;background:#fff}.abc-canvas .react-flow__pane{cursor:grab}.abc-canvas .react-flow__pane:active{cursor:grabbing}.abc-node{--abc-type-tone: 220 9% 24%;--abc-type-soft: 220 10% 97%;--abc-type-border: 220 9% 78%;position:relative;width:220px;height:88px;display:grid;grid-template-columns:38px minmax(0,1fr);align-items:center;gap:9px;padding:12px 14px;border:1px solid hsl(var(--abc-type-border));border-radius:13px;background:hsl(var(--panel));box-shadow:0 10px 30px hsl(var(--foreground) / .055);color:hsl(var(--foreground));transition:border-color .15s ease,box-shadow .15s ease,transform .15s ease}.abc-node:hover{border-color:hsl(var(--abc-type-tone) / .48);box-shadow:0 13px 34px hsl(var(--foreground) / .08)}.abc-node.is-selected{border-color:hsl(var(--abc-type-tone) / .86);box-shadow:0 0 0 3px hsl(var(--abc-type-tone) / .1),0 14px 38px hsl(var(--foreground) / .09)}.abc-node.is-llm{grid-template-columns:minmax(0,1fr);background:hsl(var(--panel))}.abc-node.is-a2a{--abc-type-tone: 213 18% 38%;--abc-type-soft: 214 20% 94%;--abc-type-border: 213 15% 72%;background:linear-gradient(145deg,hsl(var(--abc-type-soft)),hsl(var(--panel)) 58%)}.abc-canvas .react-flow__node-group{padding:0;border:0;border-radius:18px;background:transparent}.abc-group{--abc-type-tone: 213 40% 40%;--abc-type-soft: 214 45% 96%;--abc-type-border: 213 32% 62%;position:relative;width:100%;height:100%;box-sizing:border-box;overflow:hidden;border:1.5px solid hsl(var(--abc-type-border) / .72);border-radius:18px;background:linear-gradient(180deg,hsl(var(--abc-type-soft) / .88),transparent 88px),hsl(var(--panel) / .72);box-shadow:0 14px 42px hsl(var(--foreground) / .055);transition:border-color .15s ease,box-shadow .15s ease}.abc-group.is-selected{border-color:hsl(var(--abc-type-tone) / .86);box-shadow:0 0 0 4px hsl(var(--abc-type-tone) / .1),0 16px 46px hsl(var(--foreground) / .08)}.abc-group.is-parallel{--abc-type-tone: 40 43% 38%;--abc-type-soft: 43 52% 94%;--abc-type-border: 40 38% 58%;border-style:solid}.abc-group.is-sequential{--abc-type-tone: 213 40% 40%;--abc-type-soft: 214 45% 96%;--abc-type-border: 213 32% 62%}.abc-group.is-llm{--abc-type-tone: 220 9% 24%;--abc-type-soft: 220 10% 97%;--abc-type-border: 220 9% 66%}.abc-group.is-loop{--abc-type-tone: 151 34% 34%;--abc-type-soft: 148 32% 94%;--abc-type-border: 151 28% 55%}.abc-group-head{position:relative;height:64px;display:flex;align-items:center;justify-content:center;padding:10px 132px 10px 72px;border-bottom:1px solid hsl(var(--border) / .75)}.abc-group-head>span:first-child{min-width:0;display:flex;flex-direction:column;align-items:center;gap:2px;text-align:center}.abc-group-head strong{color:hsl(var(--abc-type-tone));font-size:13px;letter-spacing:-.02em}.abc-group-head small{overflow:hidden;color:hsl(var(--muted-foreground));font-size:9.5px;text-overflow:ellipsis;white-space:nowrap}.abc-group-head em{position:absolute;top:12px;right:22px;padding:3px 7px;border-radius:999px;background:hsl(var(--background) / .82);color:hsl(var(--muted-foreground));font-size:9px;font-style:normal;font-weight:600;white-space:nowrap}.abc-group-add{height:40px;display:flex;align-items:center;justify-content:center;gap:7px;border:1px dashed hsl(var(--abc-type-tone) / .42);border-radius:10px;background:hsl(var(--background) / .58);color:hsl(var(--muted-foreground));cursor:pointer;font:inherit;font-size:10px;font-weight:600;transition:border-color .15s ease,background-color .15s ease,color .15s ease}.abc-group-boundary-actions{position:absolute;top:64px;right:0;bottom:0;left:0;z-index:2;pointer-events:none}.abc-group-boundary-add{position:absolute;top:50%;width:28px;height:28px;display:inline-flex;align-items:center;justify-content:center;padding:0;border:1px solid hsl(var(--abc-type-tone) / .32);border-radius:50%;background:hsl(var(--background) / .94);box-shadow:0 6px 18px hsl(var(--foreground) / .08);color:hsl(var(--abc-type-tone));cursor:pointer;opacity:.72;pointer-events:auto;transform:translateY(-50%);transition:border-color .15s ease,background-color .15s ease,box-shadow .15s ease,opacity .15s ease}.abc-group-boundary-add.is-start{left:18px}.abc-group-boundary-add.is-end{right:18px}.abc-root.is-vertical .abc-group-boundary-actions{top:64px;right:0;bottom:0;left:0}.abc-root.is-vertical .abc-group-boundary-add{left:50%;transform:translate(-50%)}.abc-root.is-vertical .abc-group-boundary-add.is-start{top:18px}.abc-root.is-vertical .abc-group-boundary-add.is-end{top:auto;right:auto;bottom:18px}.abc-group-boundary-add:hover{border-color:hsl(var(--abc-type-tone) / .64);background:hsl(var(--abc-type-soft) / .92);box-shadow:0 8px 22px hsl(var(--foreground) / .1);opacity:1}.abc-group-boundary-add:focus-visible{outline:2px solid hsl(var(--abc-type-tone) / .5);outline-offset:2px;opacity:1}.abc-group-boundary-add svg{width:14px;height:14px}.abc-group-add-empty,.abc-group-add-bottom{position:absolute;right:24px;bottom:24px;left:24px}.abc-group-add:hover{border-color:hsl(var(--abc-type-tone) / .72);background:hsl(var(--abc-type-soft) / .86);color:hsl(var(--abc-type-tone))}.abc-group-add:focus-visible{outline:2px solid hsl(var(--abc-type-tone) / .5);outline-offset:2px}.abc-group-add svg{width:14px;height:14px}.abc-node.is-contained-in-parallel .abc-handle{opacity:0}.abc-node-icon{width:38px;height:38px;display:inline-flex;align-items:center;justify-content:center;border-radius:10px;background:hsl(var(--abc-type-soft));color:hsl(var(--abc-type-tone))}.abc-node-icon svg{width:17px;height:17px}.abc-node-copy{min-width:0;display:flex;flex-direction:column;gap:2px;padding-right:18px}.abc-node-delete{position:absolute;z-index:3;top:7px;right:7px;width:24px;height:24px;display:inline-flex;align-items:center;justify-content:center;padding:0;border:1px solid hsl(var(--border));border-radius:7px;background:hsl(var(--panel) / .96);box-shadow:0 4px 12px hsl(var(--foreground) / .08);color:hsl(var(--muted-foreground));cursor:pointer;opacity:0;pointer-events:none;transform:translateY(-2px) scale(.92);transition:opacity .12s ease,transform .12s ease,border-color .12s ease,color .12s ease}.abc-node:hover>.abc-node-delete,.abc-node:focus-within>.abc-node-delete,.abc-group:hover>.abc-node-delete,.abc-group:focus-within>.abc-node-delete,.abc-node-delete:focus-visible{opacity:1;pointer-events:auto;transform:translateY(0) scale(1)}.abc-node-delete:hover{border-color:hsl(var(--destructive) / .32);color:hsl(var(--destructive))}.abc-node-delete:focus-visible{outline:2px solid hsl(var(--destructive) / .34);outline-offset:2px}.abc-node-delete svg{width:12px;height:12px}.abc-group>.abc-node-delete{top:19px;right:12px}.abc-group>.abc-node-delete+.abc-handle{z-index:4}.abc-group:has(>.abc-node-delete) .abc-group-head em{right:48px}.abc-loop-handle{left:50%!important;opacity:0;pointer-events:none}.abc-node-meta{display:flex;align-items:center;justify-content:space-between;gap:8px;color:hsl(var(--abc-type-tone));font-size:9px;font-weight:700;letter-spacing:.04em}.abc-node-meta small{color:hsl(var(--muted-foreground));font-size:8.5px;font-weight:550;letter-spacing:0}.abc-node-copy>strong{overflow:hidden;font-size:13px;letter-spacing:-.015em;text-overflow:ellipsis;white-space:nowrap}.abc-node-copy>small{display:-webkit-box;overflow:hidden;color:hsl(var(--muted-foreground));font-size:9.5px;line-height:1.35;-webkit-box-orient:vertical;-webkit-line-clamp:2}.abc-terminal{width:96px;height:34px;display:flex;align-items:center;justify-content:center;border:1px solid hsl(var(--border) / .82);border-radius:999px;background:hsl(var(--secondary) / .68);box-shadow:none;color:hsl(var(--foreground) / .76);font-size:10.5px;font-weight:650;letter-spacing:.03em}.abc-handle{width:7px!important;height:7px!important;border:2px solid hsl(var(--background))!important;background:#585e6a!important}.abc-group.is-sequential>.abc-handle{background:#3d628f!important}.abc-group.is-parallel>.abc-handle{background:#8b6f37!important}.abc-group.is-loop>.abc-handle,.abc-node.is-contained-in-loop .abc-loop-handle{background:#397458!important}.abc-canvas .react-flow__edge-path{transition:stroke-width .12s ease}.abc-canvas .react-flow__edge:hover .react-flow__edge-path{stroke-width:2.2}.abc-edge-tools{position:absolute;z-index:1002;display:inline-flex;align-items:center;justify-content:center;gap:3px;padding:0;border-radius:999px;pointer-events:all}.abc-canvas .react-flow__edgelabel-renderer{z-index:1002}.abc-edge-hover-path{fill:none;stroke:transparent;stroke-width:22px;pointer-events:stroke}.abc-edge-label{position:absolute;bottom:calc(100% + 1px);left:50%;padding:2px 5px;border-radius:5px;background:hsl(var(--background) / .92);color:hsl(var(--muted-foreground));font-size:10px;font-weight:600;transform:translate(-50%);white-space:nowrap}.abc-edge-add{width:24px;height:24px;display:inline-flex;align-items:center;justify-content:center;padding:0;border:1px solid hsl(var(--cw-workspace-accent) / .28);border-radius:50%;background:hsl(var(--background));box-shadow:0 4px 12px hsl(var(--foreground) / .1);color:hsl(var(--cw-workspace-accent));cursor:pointer;opacity:0;transform:scale(.82);transition:opacity .14s ease,transform .14s ease,border-color .14s ease}.abc-edge-tools.is-visible .abc-edge-add,.abc-edge-tools:hover .abc-edge-add,.abc-edge-add:focus-visible{border-color:hsl(var(--cw-workspace-accent) / .68);opacity:1;transform:scale(1)}.abc-edge-add:focus-visible{outline:2px solid hsl(var(--cw-workspace-accent) / .5);outline-offset:2px}.abc-edge-add svg{width:11px;height:11px}@media (hover: none){.abc-edge-add{opacity:.88;transform:scale(1)}.abc-node-delete{opacity:1;pointer-events:auto;transform:none}}@media (prefers-reduced-motion: reduce){.abc-node-delete,.abc-edge-add{transition:none}}.abc-canvas .react-flow__controls{overflow:hidden;border:1px solid hsl(var(--border));border-radius:9px;box-shadow:0 8px 24px hsl(var(--foreground) / .08)}.abc-canvas .react-flow__controls-button{border-bottom-color:hsl(var(--border));background:hsl(var(--panel));color:hsl(var(--foreground))}.abc-minimap{width:168px!important;height:104px!important;overflow:hidden;border:1px solid hsl(var(--border));border-radius:9px;background:hsl(var(--panel))!important;box-shadow:0 8px 24px hsl(var(--foreground) / .06)}.abc-minimap-node .abc-minimap-shell,.abc-minimap-node .abc-minimap-icon-mark,.abc-minimap-node .abc-minimap-group-divider{vector-effect:non-scaling-stroke}.abc-minimap-node-agent .abc-minimap-shell{fill:hsl(var(--panel));stroke:#585e6ab8;stroke-width:1.4px}.abc-minimap-node-agent.is-a2a .abc-minimap-shell{fill:#f0f5fa;stroke:#4788aec7}.abc-minimap-agent-icon{fill:#edeff3}.abc-minimap-node-agent.is-a2a .abc-minimap-agent-icon{fill:#dae9f1}.abc-minimap-icon-mark{fill:none;stroke:#4f5f72;stroke-width:1.25px}.abc-minimap-icon-eye{fill:#4f5f72}.abc-minimap-copy-line{fill:hsl(var(--muted-foreground) / .34)}.abc-minimap-copy-line.is-primary{fill:hsl(var(--foreground) / .7)}.abc-minimap-node-terminal .abc-minimap-shell{fill:hsl(var(--cw-workspace-ink));stroke:hsl(var(--panel));stroke-width:1.5px;vector-effect:non-scaling-stroke}.abc-minimap-terminal-dot{fill:hsl(var(--panel) / .82)}.abc-minimap-node-group .abc-minimap-shell{fill:hsl(var(--panel) / .32);stroke:#3d628fc7;stroke-width:1.5px}.abc-minimap-node-group.is-parallel .abc-minimap-shell{stroke:#8b6f37d1}.abc-minimap-node-group.is-sequential .abc-minimap-shell{stroke:#3d628fd1}.abc-minimap-node-group.is-llm .abc-minimap-shell{stroke:#585e6ac7}.abc-minimap-node-group.is-loop .abc-minimap-shell{stroke:#397458d6}.abc-minimap-group-divider{stroke:hsl(var(--border));stroke-width:1px}.abc-minimap-group-title{fill:hsl(var(--muted-foreground) / .42)}.abc-minimap-node.is-selected .abc-minimap-shell{stroke-width:2.5px}.abc-minimap-node-agent.is-selected .abc-minimap-shell{stroke:#2e3138}.abc-minimap-node-group.is-sequential.is-selected .abc-minimap-shell{stroke:#314e72}.abc-minimap-node-group.is-parallel.is-selected .abc-minimap-shell{stroke:#6d572c}.abc-minimap-node-group.is-loop.is-selected .abc-minimap-shell{stroke:#2d5c46}@media (max-width: 1080px){.abc-root{min-width:360px}}@media (max-width: 860px){.abc-root{flex:none;width:100%;min-width:0;height:480px;border-right:0;border-bottom:0}.abc-minimap{display:none}}@media (max-width: 520px){.abc-root{height:430px}}.aw-root{flex:1;min-width:0;min-height:0;display:flex;flex-direction:column;overflow:hidden;background:hsl(var(--background));color:hsl(var(--foreground))}.aw-agent-head h2,.aw-eval-head h2,.aw-section-head h3{margin:0;color:hsl(var(--foreground));letter-spacing:-.025em}.aw-agent-head p,.aw-eval-head p,.aw-section-head p{margin:4px 0 0;color:hsl(var(--muted-foreground));font-size:12.5px;line-height:1.5}.aw-view-tabs,.aw-agent-title-row,.aw-card-head,.aw-section-head,.aw-case-filters,.aw-eval-head{display:flex;align-items:center}.aw-view-tabs{flex:0 0 auto;gap:26px;padding:0 24px;border-bottom:1px solid hsl(var(--border))}.aw-view-tabs button,.aw-case-filters button{border:0;background:transparent;color:hsl(var(--muted-foreground));cursor:pointer;font:inherit;transition:background .16s ease,box-shadow .16s ease,color .16s ease}.aw-view-tabs button{position:relative;min-height:44px;padding:0;font-size:14px;font-weight:580}.aw-view-tabs button.is-active{color:hsl(var(--foreground))}.aw-view-tabs button.is-active:after{content:"";position:absolute;right:0;bottom:0;left:0;height:2px;border-radius:999px;background:hsl(var(--foreground))}.aw-run{display:inline-flex;align-items:center;justify-content:center;gap:7px;border:0;background:hsl(var(--foreground));color:hsl(var(--background));cursor:pointer;font:inherit;font-size:12.5px;font-weight:650;transition:opacity .16s ease,transform .16s ease}.aw-run:not(:disabled):hover{transform:translateY(-1px)}.aw-root button:focus-visible,.aw-root input:focus-visible,.aw-root textarea:focus-visible,.aw-root select:focus-visible{outline:2px solid hsl(var(--ring) / .55);outline-offset:2px}.aw-run svg{width:15px;height:15px}.aw-run:disabled,.aw-create-card:disabled{cursor:default;opacity:.42}.aw-workspace-frame{flex:1;min-height:0;position:relative}.aw-workspace{width:100%;height:100%;min-height:0;display:grid;grid-template-columns:304px minmax(0,1fr)}.aw-sidebar{min-width:0;min-height:0;display:flex;flex-direction:column;padding:18px 12px 22px 24px}.aw-search{height:40px;min-height:40px;flex:0 0 40px;box-sizing:border-box;display:flex;align-items:center;gap:9px;padding:0 12px;border:1px solid hsl(var(--foreground) / .12);border-radius:10px;background:transparent;transition:border-color .16s ease,background-color .16s ease}.aw-search:focus-within{border-color:hsl(var(--foreground) / .16);background:hsl(var(--secondary) / .42);box-shadow:none}.aw-search svg{width:15px;height:15px;color:hsl(var(--muted-foreground))}.aw-search input{width:100%;min-width:0;border:0;outline:0;background:transparent;color:hsl(var(--foreground));font:inherit;font-size:12.5px;line-height:1}.aw-search input::placeholder{color:hsl(var(--muted-foreground) / .82)}.aw-search input:focus,.aw-search input:focus-visible,.aw-case-search input:focus,.aw-case-search input:focus-visible{outline:none!important;box-shadow:none}.aw-agent-list{flex:1 1 auto;min-height:0;display:flex;flex-direction:column;gap:10px;margin-top:14px;overflow-y:auto}.aw-delete-error{margin-top:8px;padding:8px 10px;border-radius:8px;background:hsl(var(--destructive) / .08);color:hsl(var(--destructive));font-size:12px;line-height:1.45}.aw-agent-item,.aw-agent-check{width:100%;min-height:72px;box-sizing:border-box;display:flex;align-items:center;gap:9px;padding:13px 14px;border:1px solid hsl(var(--foreground) / .1);border-radius:14px;background:transparent;color:hsl(var(--foreground));cursor:pointer;font:inherit;text-align:left;transition:background .16s ease,border-color .16s ease}.aw-agent-item:hover,.aw-agent-check:hover{border-color:hsl(var(--foreground) / .18);background:hsl(var(--secondary) / .42)}.aw-agent-item.is-active{border-color:hsl(var(--foreground) / .42);background:hsl(var(--secondary) / .28)}.aw-agent-item[draggable=true]{cursor:grab}.aw-agent-item[draggable=true]:active{cursor:grabbing}.aw-agent-item.is-dragging{opacity:.46}.aw-agent-item.is-drop-target{border-color:hsl(var(--foreground) / .46);background:hsl(var(--secondary) / .54)}.aw-agent-item.is-drop-before{box-shadow:inset 0 2px hsl(var(--foreground) / .44)}.aw-agent-item.is-drop-after{box-shadow:inset 0 -2px hsl(var(--foreground) / .44)}.aw-agent-copy{min-width:0;display:flex;flex:1;flex-direction:column;gap:6px}.aw-agent-name-row{min-width:0;display:flex;align-items:center;gap:8px}.aw-agent-name-row>strong{min-width:0;flex:1}.aw-version-badge{flex:0 0 auto;padding:2px 6px;border:1px solid hsl(var(--border));border-radius:999px;background:hsl(var(--secondary) / .5);color:hsl(var(--muted-foreground));font-size:10px;font-weight:650;line-height:1.2}.aw-draft-badge{flex:0 0 auto;padding:2px 7px;border-radius:999px;background:#f0ebe0;color:#675332;font-size:10px;font-weight:680;line-height:1.2}.aw-draft-badge.is-deploying{background:#e4eaf2;color:#2d5080}.aw-draft-badge.is-error{background:#dc28281f;color:hsl(var(--destructive))}.aw-draft-badge.is-muted{background:hsl(var(--muted));color:hsl(var(--muted-foreground))}.aw-agent-copy strong,.aw-agent-copy small{overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.aw-agent-copy strong{font-size:13px;font-weight:650}.aw-agent-copy small{color:hsl(var(--muted-foreground));font-size:11px}.aw-agent-item>svg{width:14px;height:14px;color:hsl(var(--muted-foreground));opacity:0;transition:opacity .14s ease,transform .14s ease}.aw-agent-item:hover>svg,.aw-agent-item.is-active>svg{opacity:1}.aw-agent-item:hover>svg{transform:translate(2px)}.aw-agent-check{position:relative}.aw-agent-check>input{position:absolute;width:1px;height:1px;opacity:0}.aw-check-mark{width:17px;height:17px;flex:0 0 17px;display:inline-flex;align-items:center;justify-content:center;border:1px solid hsl(var(--foreground) / .22);border-radius:5px;background:hsl(var(--background));color:transparent}.aw-check-mark svg{width:11px;height:11px}.aw-agent-check:has(input:checked) .aw-check-mark{border-color:hsl(var(--foreground));background:hsl(var(--foreground));color:hsl(var(--background))}.aw-agent-check:has(input:focus-visible){outline:2px solid hsl(var(--ring) / .42);outline-offset:-2px}.aw-list-empty{min-height:0;flex:1 1 auto;display:flex;align-items:center;justify-content:center;padding:28px 12px;color:hsl(var(--muted-foreground));font-size:12px;text-align:center}.aw-list-error{display:flex;flex-direction:column;align-items:center;gap:10px}.aw-list-error button{min-height:30px;padding:0 12px;border:1px solid hsl(var(--border));border-radius:999px;background:transparent;color:hsl(var(--foreground));cursor:pointer;font:inherit;font-size:11.5px}.aw-create-card{width:100%;min-height:48px;flex:0 0 auto;display:inline-flex;align-items:center;justify-content:center;gap:8px;margin-top:12px;border:1px dashed hsl(var(--foreground) / .28);border-radius:14px;background:transparent;color:hsl(var(--muted-foreground));cursor:pointer;font:inherit;font-size:12.5px;font-weight:600;transition:border-color .16s ease,color .16s ease}.aw-create-card:hover:not(:disabled){border-color:hsl(var(--foreground) / .5);color:hsl(var(--foreground))}.aw-create-card svg{width:15px;height:15px}.aw-list-count{flex:0 0 auto;padding-top:10px;color:hsl(var(--muted-foreground));font-size:10.5px;text-align:center}.aw-main{position:relative;min-width:0;min-height:0;display:flex;flex-direction:column;overflow:hidden;background:hsl(var(--background))}.aw-empty-selection{align-items:center;justify-content:center}.aw-empty-selection p{margin:0;color:hsl(var(--muted-foreground));font-size:13px}.aw-agent-head{flex:0 0 auto;min-height:72px;box-sizing:border-box;display:flex;align-items:center;justify-content:space-between;gap:18px;padding:14px 24px}.aw-agent-head>div{min-width:0;display:flex;flex-direction:column;justify-content:center}.aw-head-delete.studio-update-action{border:1px solid hsl(var(--destructive) / .34);background:#ffffffc2;color:hsl(var(--destructive));-webkit-backdrop-filter:blur(7px);backdrop-filter:blur(7px)}.aw-head-delete.studio-update-action:hover:not(:disabled){border:1px solid hsl(var(--destructive));background:hsl(var(--destructive));color:hsl(var(--destructive-foreground))}.aw-head-delete svg{width:14px;height:14px}.aw-agent-title-row{gap:8px}.aw-agent-head h2,.aw-eval-head h2{overflow:hidden;font-size:18px;font-weight:720;text-overflow:ellipsis;white-space:nowrap}.aw-agent-title-row>span,.aw-eval-head>div>span{padding:2px 7px;border-radius:999px;background:hsl(var(--secondary));color:hsl(var(--muted-foreground));font-size:10.5px}.aw-agent-head p{max-width:720px;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.aw-update{align-self:center}.aw-agent-tabs{flex:0 0 auto;display:flex;gap:24px;margin:0 24px;padding:0;border-bottom:1px solid hsl(var(--border))}.aw-agent-tabs button{position:relative;min-height:42px;padding:0;border:0;background:transparent;color:hsl(var(--muted-foreground));cursor:pointer;font:inherit;font-size:12.5px;font-weight:580}.aw-agent-tabs button.is-active{color:hsl(var(--foreground))}.aw-agent-tabs button.is-active:after{content:"";position:absolute;right:0;bottom:-1px;left:0;height:2px;border-radius:2px 2px 0 0;background:hsl(var(--foreground))}.aw-agent-tabs button:disabled{cursor:default}.aw-content{flex:1;min-height:0;overflow-y:auto;margin-top:12px;padding:0 24px 80px}.aw-basic-stack{display:flex;flex-direction:column;gap:16px}.aw-canvas-card,.aw-details-card{min-width:0;border:1px solid hsl(var(--border));border-radius:14px;background:hsl(var(--panel))}.aw-canvas-card,.aw-details-card{overflow:hidden}.aw-deploy-progress-card{width:100%;min-width:0;box-sizing:border-box;padding:24px 26px 26px;border:1px solid hsl(var(--border));border-radius:18px;background:hsl(var(--panel))}.aw-deployment-focus{min-height:0;display:flex;align-items:center;justify-content:center;overflow-y:auto;padding:32px}.aw-deployment-focus .aw-deploy-progress-card{max-width:720px;margin:auto}.aw-deploy-progress-head,.aw-deploy-progress-head>div,.aw-deploy-progress-icon{display:flex;align-items:center}.aw-deploy-progress-head{justify-content:space-between;gap:20px}.aw-deploy-progress-head>div{min-width:0;gap:12px}.aw-deploy-progress-head>div>div{min-width:0}.aw-deploy-progress-icon{width:34px;height:34px;flex:0 0 34px;justify-content:center;border-radius:50%;background:#eaeff5;color:#295189}.aw-deploy-progress-icon svg{width:17px;height:17px}.aw-deploy-progress-card.is-success .aw-deploy-progress-icon{background:#e8f2ee;color:#2d7656}.aw-deploy-progress-card.is-error .aw-deploy-progress-icon,.aw-deploy-progress-card.is-cancelled .aw-deploy-progress-icon{background:#f5ecea;color:#8d3d34}.aw-deploy-progress-head h3{margin:0;font-size:14px;font-weight:700}.aw-deploy-progress-head p{margin:3px 0 0;color:hsl(var(--muted-foreground));font-size:12px;line-height:1.45;overflow-wrap:anywhere}.aw-deploy-progress-head>strong{flex:0 0 auto;color:hsl(var(--muted-foreground));font-size:12px;font-weight:650}.aw-deploy-progress-track{height:5px;margin-top:18px;overflow:hidden;border-radius:999px;background:hsl(var(--secondary))}.aw-deploy-progress-track span{display:block;height:100%;border-radius:inherit;background:#295189;transition:width .32s cubic-bezier(.22,1,.36,1)}.aw-deploy-progress-card.is-success .aw-deploy-progress-track span{background:#2d7656}.aw-deploy-progress-card.is-error .aw-deploy-progress-track span,.aw-deploy-progress-card.is-cancelled .aw-deploy-progress-track span{background:#8d3d34}.aw-deploy-steps{margin:22px 0 0;padding:0;list-style:none}.aw-deploy-steps li{position:relative;min-width:0;display:grid;grid-template-columns:28px minmax(0,1fr);gap:12px;padding:0 0 18px}.aw-deploy-steps li:last-child{padding-bottom:0}.aw-deploy-steps li:not(:last-child):after{content:"";position:absolute;top:28px;bottom:0;left:13px;width:2px;border-radius:999px;background:hsl(var(--border))}.aw-deploy-steps li.is-done:not(:last-child):after{background:#9dcdb8}.aw-deploy-step-marker{position:relative;z-index:1;width:28px;height:28px;display:inline-flex;align-items:center;justify-content:center;box-sizing:border-box;border:1px solid hsl(var(--border));border-radius:50%;background:hsl(var(--panel));color:hsl(var(--muted-foreground));font-size:10.5px;font-weight:680}.aw-deploy-step-marker svg{width:14px;height:14px}.aw-deploy-steps li.is-done .aw-deploy-step-marker{border-color:#b3dbca;background:#e8f2ee;color:#2d7656}.aw-deploy-steps li.is-active .aw-deploy-step-marker{border-color:#9eb3d1;background:#eaeff5;color:#295189}.aw-deploy-steps li.is-failed .aw-deploy-step-marker{border-color:#dcbfbc;background:#f5ecea;color:#8d3d34}.aw-deploy-step-copy{min-width:0;padding-top:2px}.aw-deploy-step-copy strong{display:block;color:hsl(var(--muted-foreground));font-size:12.5px;font-weight:620;line-height:1.4}.aw-deploy-step-copy p{min-width:0;margin:3px 0 0;color:hsl(var(--muted-foreground));font-size:11.5px;line-height:1.55;overflow-wrap:anywhere;word-break:break-word}.aw-deploy-steps li.is-done .aw-deploy-step-copy strong,.aw-deploy-steps li.is-active .aw-deploy-step-copy strong,.aw-deploy-steps li.is-failed .aw-deploy-step-copy strong{color:hsl(var(--foreground))}.aw-deploy-steps li.is-active .aw-deploy-step-copy p{color:hsl(var(--foreground) / .78)}.aw-card-head{justify-content:space-between;gap:12px;min-height:48px;padding:0 16px}.aw-card-head strong{font-size:13px;font-weight:680}.aw-card-head span{color:hsl(var(--muted-foreground));font-size:10.5px}.aw-canvas{height:220px;min-height:0;border-top:1px solid hsl(var(--border))}.aw-canvas .abc-root{width:100%;height:100%;min-width:0;min-height:0;border:0;background:#f9f8f5}.aw-canvas .abc-canvas{flex:1;min-height:0}.aw-canvas .react-flow__controls{transform:scale(.86);transform-origin:bottom left}.aw-facts{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));margin:0;padding:4px 16px 14px}.aw-facts>div{min-height:39px;display:grid;grid-template-columns:minmax(88px,.72fr) minmax(0,1.28fr);align-items:center;gap:12px;border-top:1px solid hsl(var(--border) / .72)}.aw-facts>div:nth-child(2n){padding-left:20px}.aw-facts>div:nth-child(odd){padding-right:20px}.aw-facts dt{color:hsl(var(--muted-foreground));font-size:11.5px}.aw-facts dd{min-width:0;margin:0;overflow:hidden;color:hsl(var(--foreground));font-size:12px;font-weight:600;text-align:right;text-overflow:ellipsis;white-space:nowrap}.aw-status-dot{width:6px;height:6px;display:inline-block;margin-right:6px;border-radius:50%;background:#358d67}.aw-section-head{justify-content:space-between;gap:18px;margin-bottom:16px}.aw-section-head h3{font-size:16px;font-weight:700}.aw-case-filters{width:fit-content;gap:3px;margin-bottom:14px;padding:3px;border-radius:8px;background:hsl(var(--secondary) / .62)}.aw-case-search{width:100%;height:38px;box-sizing:border-box;display:flex;align-items:center;gap:9px;margin-bottom:14px;padding:0 12px;border:1px solid hsl(var(--border));border-radius:10px;background:transparent;transition:border-color .16s ease,box-shadow .16s ease}.aw-case-search:focus-within{border-color:hsl(var(--foreground) / .32);box-shadow:0 0 0 3px hsl(var(--foreground) / .045)}.aw-case-search svg{width:15px;height:15px;color:hsl(var(--muted-foreground))}.aw-case-search input{width:100%;min-width:0;border:0;outline:0;background:transparent;color:hsl(var(--foreground));font:inherit;font-size:12px}.aw-case-search input::placeholder{color:hsl(var(--muted-foreground) / .8)}.aw-case-filters button{min-height:28px;padding:0 10px;border-radius:6px;font-size:11.5px}.aw-case-filters button.is-active{background:hsl(var(--background));color:hsl(var(--foreground));box-shadow:0 1px 2px hsl(var(--foreground) / .07)}.aw-case-table{overflow:hidden;border:1px solid hsl(var(--border));border-radius:12px}.aw-case-row{min-height:62px;display:grid;grid-template-columns:minmax(180px,.9fr) minmax(240px,1.25fr) 90px;align-items:center;gap:14px;padding:8px 14px;border-top:1px solid hsl(var(--border));font-size:12px}.aw-case-row:first-child{border-top:0}.aw-case-row-head{min-height:38px;background:hsl(var(--secondary) / .38);color:hsl(var(--muted-foreground));font-size:10.5px;font-weight:600}.aw-case-row strong,.aw-case-row p{min-width:0;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.aw-case-row strong{font-weight:600}.aw-case-row p{margin:0;color:hsl(var(--muted-foreground))}.aw-case-tag{width:fit-content;padding:3px 7px;border-radius:999px;font-size:10px;font-weight:650}.aw-case-tag{background:hsl(var(--secondary));color:hsl(var(--muted-foreground));font-weight:540}.aw-case-empty{min-height:116px;display:flex;align-items:center;justify-content:center;border-top:1px solid hsl(var(--border));color:hsl(var(--muted-foreground));font-size:12px}.aw-option-panel,.aw-deployment-panel{width:100%;box-sizing:border-box;margin:0}.aw-settings-card{padding:18px;border:1px solid hsl(var(--border));border-radius:14px}.aw-option-content{position:relative;overflow:hidden;border-radius:11px}.aw-option-list{display:flex;flex-direction:column;gap:10px}.aw-option-glass{position:absolute;top:0;right:0;bottom:0;left:0;z-index:1;display:flex;align-items:center;justify-content:center;background:linear-gradient(135deg,hsl(var(--background) / .68),hsl(var(--background) / .5));-webkit-backdrop-filter:blur(10px) saturate(88%);backdrop-filter:blur(10px) saturate(88%);color:hsl(var(--foreground) / .72);font-size:12.5px;font-weight:600;letter-spacing:.08em}.aw-option-list>label{min-height:66px;display:flex;align-items:center;gap:12px;padding:0 16px;border:1px solid hsl(var(--border));border-radius:11px;color:hsl(var(--muted-foreground));opacity:.68}.aw-option-list input{width:16px;height:16px}.aw-option-list label>span{min-width:0;display:flex;flex-direction:column;gap:4px}.aw-option-list strong{color:hsl(var(--foreground));font-size:12.5px}.aw-option-list small{font-size:11.5px;line-height:1.45}.aw-readonly-config{margin:0;display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:10px}.aw-readonly-config>div{min-width:0;padding:12px 14px;border-radius:10px;background:hsl(var(--secondary) / .42)}.aw-readonly-config dt{color:hsl(var(--muted-foreground));font-size:11px}.aw-readonly-config dd{margin:5px 0 0;color:hsl(var(--foreground));font-size:12px;font-weight:600}.aw-basic-actions{position:absolute;z-index:8;bottom:20px;left:50%;display:flex;align-items:center;justify-content:center;gap:10px;padding:0;border:0;border-radius:10px;background:transparent;box-shadow:none;transform:translate(-50%)}.aw-eval-head{flex:0 0 auto;min-height:72px;box-sizing:border-box;justify-content:space-between;gap:20px;padding:14px 24px}.aw-evaluation-glass{position:absolute;z-index:12;top:0;right:0;bottom:0;left:0;display:flex;align-items:center;justify-content:center;background:hsl(var(--background) / .44);color:hsl(var(--foreground));-webkit-backdrop-filter:blur(9px) saturate(118%);backdrop-filter:blur(9px) saturate(118%);transition:background .18s ease,backdrop-filter .18s ease}.aw-evaluation-glass:hover{background:hsl(var(--background) / .52);-webkit-backdrop-filter:blur(11px) saturate(125%);backdrop-filter:blur(11px) saturate(125%)}.aw-evaluation-glass span{padding:8px 13px;border:1px solid hsl(var(--border) / .82);border-radius:999px;background:hsl(var(--background) / .7);box-shadow:0 8px 24px hsl(var(--foreground) / .07);font-size:12.5px;font-weight:620;-webkit-backdrop-filter:blur(14px);backdrop-filter:blur(14px)}.aw-eval-head>div{min-width:0;display:flex;flex-direction:column;justify-content:center}.aw-run{min-height:38px;padding:0 14px;border-radius:9px}.aw-eval-setup{width:min(900px,100%);margin:0 auto;display:flex;flex-direction:column;gap:14px}.aw-eval-block{min-width:0;overflow:hidden;border:1px solid hsl(var(--border));border-radius:14px}.aw-eval-agent-grid{max-height:230px;display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:8px;overflow-y:auto;padding:0 16px 16px}.aw-eval-agent-grid>label{min-height:52px;display:flex;align-items:center;gap:10px;padding:0 12px;border:1px solid hsl(var(--border) / .82);border-radius:10px;cursor:pointer}.aw-eval-agent-grid input,.aw-metric-list input{width:15px;height:15px;accent-color:hsl(var(--foreground))}.aw-eval-agent-grid label>span{min-width:0;display:flex;flex-direction:column;gap:3px}.aw-eval-agent-grid strong,.aw-eval-agent-grid small{overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.aw-eval-agent-grid strong{font-size:12px;font-weight:620}.aw-eval-agent-grid small{color:hsl(var(--muted-foreground));font-size:10.5px}.aw-eval-setting-grid{display:grid;grid-template-columns:minmax(0,1.18fr) minmax(260px,.82fr);gap:14px}.aw-eval-fields{display:flex;flex-direction:column;gap:13px;padding:0 16px 16px}.aw-eval-fields label{min-height:36px;display:grid;grid-template-columns:72px minmax(0,1fr) auto;align-items:center;gap:10px}.aw-eval-fields label>span,.aw-eval-fields label>small{color:hsl(var(--muted-foreground));font-size:11px}.aw-eval-fields select{width:100%;height:34px;padding:0 10px;border:1px solid hsl(var(--border));border-radius:8px;background:hsl(var(--background));color:hsl(var(--foreground));font:inherit;font-size:11.5px}.aw-metric-list{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:8px;padding:0 16px 16px}.aw-metric-list label{min-height:40px;display:flex;align-items:center;gap:8px;padding:0 10px;border:1px solid hsl(var(--border) / .82);border-radius:9px;cursor:pointer;font-size:11.5px}.aw-eval-history{width:min(820px,100%);margin:0 auto}.aw-history-list{display:flex;flex-direction:column;gap:9px}.aw-history-list>button{width:100%;min-height:68px;display:grid;grid-template-columns:minmax(0,1fr) auto auto 16px;align-items:center;gap:16px;padding:10px 14px;border:1px solid hsl(var(--border));border-radius:11px;background:transparent;color:hsl(var(--foreground));cursor:pointer;font:inherit;text-align:left}.aw-history-list>button:hover{border-color:hsl(var(--foreground) / .2)}.aw-history-list>button>span:first-child,.aw-history-score{display:flex;flex-direction:column;gap:4px}.aw-history-list strong{font-size:12px}.aw-history-list small{color:hsl(var(--muted-foreground));font-size:10.5px}.aw-history-score{align-items:flex-end}.aw-history-score strong{font-size:17px}.aw-complete{display:inline-flex;align-items:center;gap:5px;padding:4px 8px;border-radius:999px;background:#3c866617;color:#28674c;font-size:10.5px;font-weight:620}.aw-complete svg{width:12px;height:12px}.aw-results-empty{min-height:210px;display:flex;align-items:center;justify-content:center;flex-direction:column;gap:7px;border:1px dashed hsl(var(--border));border-radius:10px;color:hsl(var(--muted-foreground));text-align:center}.aw-results-empty strong{color:hsl(var(--foreground));font-size:12.5px}.aw-results-empty span{font-size:11.5px}@media (max-width: 980px){.aw-workspace{grid-template-columns:260px minmax(0,1fr)}.aw-eval-setting-grid{grid-template-columns:minmax(0,1fr)}.aw-case-row{grid-template-columns:minmax(160px,.8fr) minmax(200px,1.2fr) 80px}}@media (max-width: 720px){.aw-view-tabs{padding-inline:16px}.aw-workspace{grid-template-columns:minmax(0,1fr);overflow-y:auto}.aw-sidebar{height:340px;max-height:340px;box-sizing:border-box;padding:18px 16px}.aw-agent-list{min-height:128px}.aw-main{min-height:620px;overflow:visible}.aw-agent-tabs{gap:18px;margin-inline:16px;overflow-x:auto}.aw-agent-head,.aw-eval-head{padding-inline:16px}.aw-content{overflow:visible;padding-inline:16px}.aw-facts{grid-template-columns:minmax(0,1fr)}.aw-facts>div:nth-child(n){padding-right:0;padding-left:0}.aw-eval-agent-grid,.aw-metric-list,.aw-readonly-config{grid-template-columns:minmax(0,1fr)}}@media (prefers-reduced-motion: reduce){.aw-root *,.aw-root *:before,.aw-root *:after{scroll-behavior:auto!important;transition-duration:.01ms!important}}.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[data-tool-tone=skill]{--builtin-tool-accent: 154 50% 34%}.builtin-tool-head[data-tool-tone=sandbox]{--builtin-tool-accent: 32 67% 42%}.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:14.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 svg.new-chat-mode__temporary-icon{stroke-width:1.3}.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:43;top:calc(100% + 7px);left: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;min-width:0;align-items:center;gap:7px;font-size:13px;line-height:1.3}.new-chat-mode__label-text{min-width:0;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.new-chat-mode__beta{flex:0 0 auto;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))}.new-chat-mode__nested-chevron{width:14px;height:14px;color:hsl(var(--muted-foreground))}.new-chat-mode__submenu{position:absolute;z-index:44;top:calc(100% + 7px);left:294px;width:248px;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__submenu-option{display:grid;grid-template-columns:28px minmax(0,1fr);align-items:center;gap:9px;width:100%;padding:9px 8px;border:0;border-radius:9px;background:transparent;color:hsl(var(--foreground));font:inherit;text-align:left;cursor:pointer}.new-chat-mode__submenu-option:hover:not(:disabled){background:hsl(var(--accent))}.new-chat-mode__submenu-option:disabled{cursor:not-allowed;opacity:.42}.new-chat-mode__builtin-icon{width:24px;height:24px;border-radius:6px;object-fit:contain}@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}}.layout{--pp-sidebar-width: 236px}.layout:has(.sidebar.is-collapsed){--pp-sidebar-width: 56px}.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{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-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-publish-content-width: min(760px, max(680px, calc(100% - 48px) ));overflow-y:auto}.pp-root.is-deploy .pp-body{flex:0 0 auto;min-height:100%;display:grid;grid-template-rows:auto auto;overflow:visible}.pp-root.is-deploy.has-primary-pane .pp-body{display:flex;justify-content:center;background:hsl(var(--secondary) / .18)}.pp-root.is-deploy.has-primary-pane .pp-config{width:min(760px,100%);background:transparent}.pp-root.is-deploy.has-primary-pane .pp-config-head,.pp-root.is-deploy.has-primary-pane .pp-config-actions{border:0;background:transparent}.pp-root.is-deploy.has-primary-pane .pp-config-actions{position:relative;justify-content:center;padding:12px 18px 18px;transform:none}.pp-root.is-deploy.has-primary-pane .pp-deploy-hint{position:absolute;left:18px}.pp-root.is-deploy .pp-files-area{display:none}.pp-release-overview{min-width:0;min-height:0;border-bottom:0;background:transparent}.pp-release-preview{width:var(--pp-publish-content-width);min-height:300px;box-sizing:border-box;min-height:0;display:grid;grid-template-columns:minmax(320px,.9fr) minmax(300px,1.1fr);gap:24px;margin:0 auto;padding:28px 0 12px}.pp-flow-thumbnail{position:relative;min-width:0;min-height:0;overflow:hidden;border:1px solid hsl(var(--border));border-radius:14px;background:transparent;box-shadow:none}.pp-flow-thumbnail .abc-root,.pp-flow-dialog-canvas .abc-root{width:100%;height:100%;min-width:0;min-height:0;flex:1 1 auto;border:0;background:transparent}.pp-flow-thumbnail .abc-canvas,.pp-flow-dialog-canvas .abc-canvas{flex:1;min-height:0;background:transparent}.pp-flow-thumbnail .react-flow__pane{cursor:grab}.pp-flow-thumbnail .react-flow__pane:active{cursor:grabbing}.pp-flow-thumbnail .react-flow__controls{display:none}.pp-flow-expand{position:absolute;z-index:5;right:10px;bottom:10px;width:32px;height:32px;display:inline-flex;align-items:center;justify-content:center;padding:0;border:0;background:transparent;color:hsl(var(--muted-foreground));cursor:pointer;font:inherit}.pp-flow-expand:hover{background:transparent;color:hsl(var(--foreground))}.pp-flow-expand:focus-visible{outline:2px solid hsl(var(--primary) / .72);outline-offset:2px}.pp-flow-expand svg{width:17px;height:17px}.pp-release-info{height:100%;min-width:0;display:flex;flex-direction:column;justify-content:flex-start}.pp-release-info-main{min-width:0}.pp-release-info h2{margin:0;color:hsl(var(--foreground));font-size:18px;font-weight:700;letter-spacing:-.02em}.pp-release-description{display:-webkit-box;margin:6px 0 0;color:hsl(var(--muted-foreground));font-size:13px;overflow:hidden;line-height:1.5;-webkit-box-orient:vertical;-webkit-line-clamp:2}.pp-release-facts{display:flex;flex-direction:column;gap:10px;margin:12px 0 0}.pp-release-facts>div{min-width:0}.pp-release-facts dt{color:hsl(var(--muted-foreground));font-size:13px}.pp-release-facts dd{margin:5px 0 0;overflow:hidden;color:hsl(var(--foreground));font-size:13px;font-weight:650;text-overflow:ellipsis;white-space:nowrap}.pp-release-facts .pp-release-fact-long{display:-webkit-box;overflow:hidden;line-height:1.45;text-overflow:clip;white-space:pre-wrap;-webkit-box-orient:vertical;-webkit-line-clamp:2}.pp-release-facts .pp-release-prompt{-webkit-line-clamp:3}.pp-artifact-actions{display:flex;flex-wrap:wrap;gap:8px;margin-top:18px;padding-top:12px}.pp-artifact-actions .pp-secondary,.pp-artifact-actions .code-browser-trigger{min-height:34px;padding-inline:12px;border:0;border-radius:7px;background:hsl(var(--secondary) / .58);box-shadow:none;color:hsl(var(--foreground));font-size:13px}.pp-artifact-actions .pp-secondary:hover,.pp-artifact-actions .code-browser-trigger:hover{background:hsl(var(--secondary))}.pp-flow-backdrop{--cw-workspace-ink: 222 24% 13%;position:fixed;z-index:1000;top:0;right:0;bottom:0;left:0;display:flex;align-items:center;justify-content:center;padding:32px;background:hsl(var(--foreground) / .36);-webkit-backdrop-filter:blur(3px);backdrop-filter:blur(3px)}.pp-flow-dialog{width:min(1120px,92vw);height:min(720px,86vh);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 80px hsl(var(--foreground) / .22)}.pp-flow-dialog>header{flex:0 0 62px;display:flex;align-items:center;justify-content:space-between;gap:18px;padding:0 18px 0 22px;border-bottom:1px solid hsl(var(--border))}.pp-flow-dialog>header>div{display:flex;flex-direction:column;gap:3px}.pp-flow-dialog>header strong{font-size:15px;font-weight:680}.pp-flow-dialog>header span{color:hsl(var(--muted-foreground));font-size:10.5px}.pp-flow-dialog>header button{width:34px;height:34px;display:inline-flex;align-items:center;justify-content:center;border:0;border-radius:7px;background:transparent;color:hsl(var(--muted-foreground));cursor:pointer}.pp-flow-dialog>header button:hover{background:hsl(var(--secondary));color:hsl(var(--foreground))}.pp-flow-dialog>header svg{width:17px;height:17px}.pp-flow-dialog-canvas{flex:1;min-height:0;background:transparent}.pp-config{position:relative;min-width:0;width:auto;min-height:0;display:flex;flex-direction:column;background:hsl(var(--panel))}.pp-config-head{width:var(--pp-publish-content-width);flex:0 0 48px;height:48px;box-sizing:border-box;display:flex;align-items:center;margin:0 auto;padding:0;border-bottom:0}.pp-config-title{color:hsl(var(--foreground));font-size:18px;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{width:var(--pp-publish-content-width);flex:0 0 auto;min-height:0;box-sizing:border-box;display:block;margin:0 auto;overflow:visible;padding:0 0 88px}.pp-config-actions{position:fixed;z-index:40;left:calc((100vw + var(--pp-sidebar-width, 0px)) / 2);bottom:max(20px,env(safe-area-inset-bottom));display:flex;align-items:center;justify-content:center;padding:0;border:0;background:transparent;transform:translate(-50%)}.pp-config-section{width:100%;min-width:0;margin:0;padding:12px 0 20px}.pp-env-section,.pp-progress-section,.pp-deploy-result,.pp-config-scroll>.pp-error{width:100%;margin-inline:0}.pp-config-label{margin-bottom:10px;color:hsl(var(--foreground));font-size:15px;font-weight:650;letter-spacing:-.01em}.pp-config-note{margin:-4px 0 10px;color:hsl(var(--muted-foreground));font-size:12.5px;line-height:1.5}.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-channel-fields input{height:30px;padding-inline:8px;font-size:11.5px}.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-card{position:relative;width:clamp(154px,33.333%,236px);max-width:100%;height:112px;perspective:1200px;transition:height .18s ease}.pp-channel-card.is-flipped{height:176px}.pp-channel-card-inner{width:100%;height:100%;position:relative;transform-style:preserve-3d;transition:transform .42s cubic-bezier(.22,1,.36,1)}.pp-channel-card.is-flipped .pp-channel-card-inner{transform:rotateY(180deg)}.pp-channel-card-face{position:absolute;top:0;right:0;bottom:0;left:0;width:100%;height:100%;box-sizing:border-box;overflow:hidden;border:1px solid hsl(var(--border) / .72);border-radius:14px;background:hsl(var(--background));backface-visibility:hidden;-webkit-backface-visibility:hidden}.pp-channel-card-front{display:flex;flex-direction:row;align-items:center;justify-content:flex-start;gap:11px;padding:12px;color:hsl(var(--foreground));cursor:pointer;font:inherit;text-align:left;transition:border-color .18s ease,box-shadow .18s ease,transform .18s ease}.pp-channel-card-front:hover:not(:disabled){border-color:hsl(var(--foreground) / .22);box-shadow:0 12px 30px hsl(var(--foreground) / .07);transform:translateY(-1px)}.pp-channel-card-front:focus-visible,.pp-channel-remove:focus-visible{outline:2px solid hsl(var(--ring) / .58);outline-offset:2px}.pp-channel-card-front:disabled{cursor:default}.pp-channel-card-back{padding:10px;transform:rotateY(180deg)}.pp-channel-card-head{display:flex;align-items:center;justify-content:space-between;gap:8px}.pp-channel-card-head>strong{font-size:12.5px;font-weight:650}.pp-channel-logo{width:42px;height:42px;flex:0 0 42px;display:inline-flex;align-items:center;justify-content:center;border:1px solid hsl(var(--border) / .65);border-radius:12px;background:#fff;box-shadow:0 4px 14px hsl(var(--foreground) / .07)}.pp-channel-logo img{width:30px;height:30px;display:block}.pp-channel-card-copy{min-width:0;display:flex;flex:1;flex-direction:column;gap:3px}.pp-channel-card-copy strong{font-size:14px;font-weight:650}.pp-channel-card-copy small{display:-webkit-box;overflow:hidden;color:hsl(var(--muted-foreground));font-size:12.5px;line-height:1.45;-webkit-box-orient:vertical;-webkit-line-clamp:2}.pp-channel-remove{min-height:24px;padding:0 6px;border:1px solid hsl(var(--destructive) / .14);border-radius:7px;background:hsl(var(--destructive) / .07);color:#863232;cursor:pointer;font:inherit;font-size:10.5px;white-space:nowrap}.pp-channel-remove:hover:not(:disabled){background:hsl(var(--destructive) / .12);color:#782626}.pp-channel-fields{display:flex;flex-direction:column;gap:6px;margin-top:7px}.pp-channel-fields label{min-width:0;display:flex;flex-direction:column;gap:3px;color:hsl(var(--muted-foreground));font-size:11px}.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:9px;font-weight:500}.pp-network-layout{width:min(100%,560px);display:grid;grid-template-columns:minmax(132px,.36fr) minmax(0,.64fr);align-items:start;gap:24px}.pp-network-region{position:relative;display:flex;flex-direction:column;gap:7px;margin-bottom:12px;color:hsl(var(--muted-foreground));font-size:12.5px}.pp-region-trigger{width:100%;height:36px;display:flex;align-items:center;justify-content:space-between;gap:12px;padding:0 11px;border:1px solid hsl(var(--border));border-radius:7px;background:hsl(var(--background));color:hsl(var(--foreground));font:inherit;font-size:13px;cursor:pointer;transition:border-color .12s ease,background-color .12s ease}.pp-region-trigger:hover,.pp-region-trigger[aria-expanded=true]{border-color:hsl(var(--foreground) / .22);background:hsl(var(--foreground) / .025)}.pp-region-trigger:focus-visible{outline:none;border-color:hsl(var(--ring));box-shadow:0 0 0 3px hsl(var(--ring) / .12)}.pp-region-chevron{width:15px;height:15px;color:hsl(var(--muted-foreground));transition:transform .15s ease}.pp-region-chevron.is-open{transform:rotate(180deg)}.pp-region-menu{position:absolute;top:calc(100% + 6px);right:0;left:0;z-index:31;padding:5px;border:1px solid hsl(var(--border));border-radius:10px;background:hsl(var(--panel));box-shadow:0 12px 28px hsl(var(--foreground) / .12)}.pp-region-option{width:100%;height:36px;display:flex;align-items:center;justify-content:space-between;padding:0 9px;border:0;border-radius:7px;background:transparent;color:hsl(var(--foreground));font:inherit;font-size:13px;text-align:left;cursor:pointer}.pp-region-option:hover,.pp-region-option:focus-visible,.pp-region-option.is-selected{outline:none;background:hsl(var(--foreground) / .055)}.pp-region-option.is-selected{font-weight:600}.pp-region-option svg{width:15px;height:15px;color:hsl(var(--primary))}.pp-network-modes{display:flex;flex-direction:column;gap:9px}.pp-network-option{min-height:28px;display:flex;align-items:center;gap:9px;color:hsl(var(--muted-foreground));font-size:12.5px;font-weight:560;cursor:pointer}.pp-network-option:has(input:checked){color:hsl(var(--foreground))}.pp-network-option:has(input:disabled){cursor:default;opacity:.58}.pp-network-option input{width:15px;height:15px;margin:0;accent-color:hsl(var(--foreground))}.pp-network-fields{display:flex;flex-direction:column;gap:12px;min-width:0}.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{width:100%;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:40px;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 (prefers-reduced-motion: reduce){.pp-channel-card-inner,.pp-channel-card-front,.pp-config-actions .pp-deploy{transition:none}}@media (max-width: 1120px){.pp-release-preview{grid-template-columns:minmax(320px,.9fr) minmax(300px,1.1fr)}.pp-sidebar{flex-basis:190px;width:190px}}@media (max-width: 860px){.layout{--pp-sidebar-width: 204px}.layout:has(.sidebar.is-collapsed){--pp-sidebar-width: 56px}.pp-root.is-deploy{--pp-publish-content-width: min(88%, calc(100% - 36px) )}.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-release-overview{flex:0 0 auto;min-height:460px;border-right:0;border-bottom:0}.pp-release-preview{min-width:0;grid-template-columns:minmax(0,1fr);grid-template-rows:220px auto}.pp-release-info{min-height:200px}.pp-files-area{min-height:520px}.pp-config{width:100%;min-height:680px;border-top:0;border-left:0}.pp-config-scroll{padding-inline:0;padding-bottom:84px}.pp-config-actions{bottom:max(14px,env(safe-area-inset-bottom))}.pp-flow-backdrop{padding:12px}}@media (max-width: 520px){.pp-network-layout{grid-template-columns:minmax(0,1fr);gap:16px}.pp-env-section{width:100%}}.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-workspace-gutter: 12px;--cw-workbench-toolbar-height: 64px;--cw-workspace-ink: 222 24% 13%;--cw-workspace-accent: 162 44% 32%;--cw-workspace-accent-soft: 156 34% 92%;--cw-workspace-warm: 42 28% 96%;flex:1;min-height:0;display:flex;flex-direction:column;height:100%;color:hsl(var(--foreground));background:#fff}.cw-workspace-header{position:relative;z-index:12;flex:0 0 auto;min-height:56px;display:grid;grid-template-columns:minmax(180px,1fr) auto minmax(180px,1fr);align-items:center;gap:16px;margin:8px var(--cw-workspace-gutter) 0;padding:6px 14px;border:0;border-radius:16px;background:#f6f6f8d1;box-shadow:none;-webkit-backdrop-filter:blur(7px);backdrop-filter:blur(7px)}.cw-workspace-identity{min-width:0}.cw-workspace-identity>strong{min-width:0;overflow:hidden;color:hsl(var(--cw-workspace-ink));font-size:15px;font-weight:700;letter-spacing:-.025em;text-overflow:ellipsis;white-space:nowrap}.cw-workspace-actions{grid-column:3;justify-self:end}.cw-discard-edit{padding:7px 10px;border:0;border-radius:8px;background:transparent;color:hsl(var(--muted-foreground));cursor:pointer;font:inherit;font-size:12.5px;font-weight:560;transition:background-color .15s ease,color .15s ease}.cw-discard-edit:hover:not(:disabled){background:hsl(var(--destructive) / .08);color:hsl(var(--destructive))}.cw-discard-edit:focus-visible{outline:2px solid hsl(var(--destructive) / .22);outline-offset:2px}.cw-discard-edit:disabled{cursor:wait;opacity:.48}.cw-workspace-stepper{grid-column:2;width:max-content;max-width:100%;display:flex;align-items:center;justify-content:center;gap:12px}.cw-workspace-stepper button{position:relative;z-index:1;min-width:124px;display:flex;flex-direction:row;align-items:center;justify-content:center;min-height:36px;padding:0 14px;border:0;border-radius:10px;background:#ededf1c7;color:#474747;cursor:pointer;font:inherit;text-align:center;transition:background-color .18s cubic-bezier(.22,1,.36,1),color .15s ease,box-shadow .18s ease}.cw-workspace-stepper button:not(:last-child):after{content:none}.cw-workspace-stepper button:hover:not(:disabled),.cw-workspace-stepper button.is-complete{color:hsl(var(--cw-workspace-ink))}.cw-workspace-stepper button:hover:not(:disabled){background:#e4e4e9d6}.cw-workspace-stepper button.is-active{background:#dadae0db;color:#1a1a1a;box-shadow:none}.cw-workspace-stepper button:focus-visible{outline:none}.cw-workspace-stepper button:focus-visible .cw-workspace-step-marker{outline:2px solid hsl(var(--cw-workspace-ink) / .28);outline-offset:3px}.cw-workspace-stepper button:disabled{cursor:wait;opacity:.62}.cw-workspace-step-marker{width:20px;height:20px;flex:0 0 20px;display:inline-flex;align-items:center;justify-content:center;border:0;border-radius:50%;background:hsl(var(--foreground) / .06);color:hsl(var(--muted-foreground));box-shadow:none;font-size:10.5px;font-weight:650;transition:border-color .15s ease,background-color .15s ease,color .15s ease}.cw-workspace-stepper button:hover:not(:disabled) .cw-workspace-step-marker{background:hsl(var(--foreground) / .1)}.cw-workspace-stepper button.is-active .cw-workspace-step-marker,.cw-workspace-stepper button.is-complete .cw-workspace-step-marker{border:0}.cw-workspace-stepper button.is-active .cw-workspace-step-marker{background:#ffffff80;color:#2e2e2e}.cw-workspace-stepper button.is-complete .cw-workspace-step-marker{background:#ffffff94;color:#2e2e2e}.cw-workspace-step-marker .cw-i{width:13px;height:13px}.cw-workspace-stepper button>strong{font-size:14px;font-weight:650}@media (prefers-reduced-motion: reduce){.cw-workspace-stepper button,.cw-workspace-step-marker{transition:none}}.cw-workspace-main{flex:1;min-width:0;min-height:0;display:flex;overflow:hidden;background:#fff}.cw-build-workspace{flex:1;min-width:0;min-height:0;display:flex;flex-direction:column}.cw-ai-compose{position:relative;z-index:3;flex:0 0 auto;margin:8px var(--cw-workspace-gutter) 0;overflow:hidden;padding:14px;border:0;border-radius:20px;background:radial-gradient(ellipse at 12% 10%,rgba(225,217,255,.72),transparent 43%),radial-gradient(ellipse at 88% 88%,rgba(238,223,255,.58),transparent 42%),radial-gradient(ellipse at 54% 36%,rgba(245,239,255,.82),transparent 56%),#f8f6fcbd}.cw-ai-compose:before,.cw-ai-compose:after{position:absolute;top:-85%;right:-20%;bottom:-85%;left:-20%;content:"";pointer-events:none;opacity:0;filter:blur(22px);will-change:transform,opacity}.cw-ai-compose:before{background:radial-gradient(circle at 30% 50%,rgba(176,154,255,.62),transparent 30%),radial-gradient(circle at 66% 42%,rgba(226,178,255,.52),transparent 29%)}.cw-ai-compose:after{background:radial-gradient(circle at 38% 58%,rgba(153,214,255,.42),transparent 24%),radial-gradient(circle at 74% 48%,rgba(200,181,255,.58),transparent 31%)}.cw-ai-compose.is-generating:before{opacity:.62;animation:cw-ai-banner-smoke-a 7s ease-in-out infinite alternate}.cw-ai-compose.is-generating:after{opacity:.54;animation:cw-ai-banner-smoke-b 8.5s ease-in-out infinite alternate}.cw-ai-compose-entry{position:relative;z-index:1;min-width:0}.cw-ai-compose-form{min-width:0;display:grid;grid-template-columns:minmax(0,1fr) auto;align-items:end;gap:10px;padding:6px 7px 6px 16px;border-radius:16px;background:#ffffffeb;box-shadow:0 10px 28px #41306412,0 1px 3px #4130640a;-webkit-backdrop-filter:blur(12px);backdrop-filter:blur(12px);transition:background-color .22s ease,box-shadow .22s ease}.cw-ai-compose.is-generating .cw-ai-compose-form{background:#ebebf0e6;box-shadow:0 10px 28px #4130640d,inset 0 0 0 1px #544c640a}.cw-ai-compose-note{margin:7px 12px 0;color:hsl(var(--muted-foreground) / .76);font-size:11px;line-height:16px}.cw-ai-compose-success{min-height:54px;display:flex;align-items:center;justify-content:center;gap:10px;padding:6px 8px 6px 14px;border-radius:16px;background:#ffffffeb;box-shadow:0 10px 28px #23694312,0 1px 3px #2369430a;-webkit-backdrop-filter:blur(12px);backdrop-filter:blur(12px)}.cw-ai-compose-success strong{color:#256a46;font-size:14px;font-weight:650}.cw-ai-success-check{position:relative;width:28px;height:28px;flex:0 0 28px;border-radius:50%;background:#30a665;box-shadow:0 6px 16px #30a66533;animation:cw-ai-success-pop .36s cubic-bezier(.22,1,.36,1) both}.cw-ai-success-check:after{position:absolute;top:6px;left:9px;width:6px;height:10px;border:solid #fff;border-width:0 2px 2px 0;content:"";transform:rotate(45deg)}.cw-ai-regenerate{height:28px;margin-left:2px;padding:0 12px;border:0;border-radius:10px;background:#e6f4ec;color:#246644;cursor:pointer;font:inherit;font-size:12px;font-weight:620;transition:background-color .15s ease,transform .15s ease}.cw-ai-regenerate:hover{background:#d8eee2;transform:translateY(-1px)}.cw-ai-compose-form input{min-width:0;height:42px;padding:10px 0;border:0;border-radius:0;outline:none;background:transparent;color:hsl(var(--foreground));font:inherit;font-size:14px;line-height:22px}.cw-ai-compose-form input::placeholder{color:hsl(var(--muted-foreground) / .72)}.cw-ai-compose.is-generating .cw-ai-compose-form input{color:hsl(var(--muted-foreground) / .78);cursor:wait}.cw-ai-compose-form button{height:38px;display:inline-flex;align-items:center;justify-content:center;gap:6px;padding:0 16px;border:0;border-radius:12px;background:#2a2833;color:#fff;cursor:pointer;font:inherit;font-size:12px;font-weight:650;white-space:nowrap;transition:transform .15s ease,opacity .15s ease,background-color .15s ease}.cw-ai-compose-form button:hover:not(:disabled){background:#3c364a;transform:translateY(-1px)}.cw-ai-compose-form button:disabled{cursor:not-allowed;opacity:.34}.cw-ai-compose.is-generating .cw-ai-compose-form button:disabled{width:42px;padding:0;border-radius:50%;background:transparent;box-shadow:0 0 18px #8665ff33,0 0 30px #4dbfff1f;opacity:1;overflow:hidden;animation:cw-ai-orb-button 2.4s ease-in-out infinite}.cw-ai-compose-form button .cw-i{width:14px;height:14px}.cw-ai-orb{position:relative;width:34px;height:34px;display:block;border-radius:50%;background:radial-gradient(circle at 48% 48%,#fff 0 4%,transparent 13%),conic-gradient(from 20deg,#8ae6ff,#6c61ff 22%,#e47cff 46%,#7c5cff 68%,#74dcff 88%,#8ae6ff);filter:saturate(1.2);animation:cw-ai-orb-spin 2.15s linear infinite}.cw-ai-orb:before,.cw-ai-orb:after,.cw-ai-orb>span{position:absolute;border-radius:50%;content:""}.cw-ai-orb:before{top:3px;right:3px;bottom:3px;left:3px;background:radial-gradient(circle at 68% 28%,rgba(255,255,255,.94),transparent 18%),radial-gradient(circle at 35% 70%,rgba(106,226,255,.9),transparent 28%),radial-gradient(circle at 50% 50%,rgba(202,112,255,.92),rgba(83,57,206,.42) 58%,transparent 76%);filter:blur(2px);animation:cw-ai-smoke-drift 1.65s ease-in-out infinite alternate}.cw-ai-orb:after{top:-3px;right:-3px;bottom:-3px;left:-3px;border:1px solid rgba(185,227,255,.55);filter:blur(1px);animation:cw-ai-smoke-ring 2s ease-out infinite}.cw-ai-orb>span{top:8px;right:8px;bottom:8px;left:8px;background:#ffffffe0;box-shadow:0 0 8px #fff,0 0 13px #9de7ff;filter:blur(2px);animation:cw-ai-core-pulse 1.15s ease-in-out infinite alternate}@keyframes cw-ai-orb-button{0%,to{transform:scale(.96)}50%{transform:scale(1.04)}}@keyframes cw-ai-orb-spin{to{transform:rotate(360deg)}}@keyframes cw-ai-smoke-drift{0%{transform:translate(-1px,1px) scale(.92) rotate(-12deg)}to{transform:translate(1px,-1px) scale(1.08) rotate(16deg)}}@keyframes cw-ai-smoke-ring{0%{opacity:.72;transform:scale(.78)}to{opacity:0;transform:scale(1.16)}}@keyframes cw-ai-core-pulse{0%{opacity:.6;transform:scale(.72)}to{opacity:1;transform:scale(1.08)}}@keyframes cw-ai-banner-smoke-a{0%{transform:translate3d(-9%,6%,0) rotate(-5deg) scale(.88)}to{transform:translate3d(8%,-5%,0) rotate(7deg) scale(1.08)}}@keyframes cw-ai-banner-smoke-b{0%{transform:translate3d(8%,-7%,0) rotate(6deg) scale(1.06)}to{transform:translate3d(-7%,6%,0) rotate(-8deg) scale(.9)}}@keyframes cw-ai-success-pop{0%{opacity:0;transform:scale(.55)}to{opacity:1;transform:scale(1)}}@media (prefers-reduced-motion: reduce){.cw-ai-compose.is-generating .cw-ai-compose-form button:disabled,.cw-ai-orb,.cw-ai-orb:before,.cw-ai-orb:after,.cw-ai-orb>span,.cw-ai-compose.is-generating:before,.cw-ai-compose.is-generating:after{animation-duration:6s}.cw-ai-success-check{animation:none}}.cw-ai-error-dialog{width:460px;font-family:inherit}.cw-ai-error-message{max-height:min(320px,50vh);margin:10px 0 18px;overflow:auto;color:hsl(var(--foreground) / .78);font-family:inherit;font-size:13px;line-height:1.65;overflow-wrap:anywhere;white-space:pre-wrap}.cw-ai-error-close{border-color:transparent;background:hsl(var(--foreground));color:hsl(var(--background))}.cw-ai-error-close:hover{background:hsl(var(--foreground) / .86)}.cw-workspace-alert{position:absolute;z-index:30;top:94px;right:18px;max-width:min(420px,calc(100% - 36px));padding:10px 13px;border:1px solid hsl(var(--destructive) / .2);border-radius:9px;background:hsl(var(--background));box-shadow:0 12px 36px hsl(var(--foreground) / .12);color:hsl(var(--destructive));font-size:12.5px}.cw-editor{flex:1;width:100%;min-height:0;display:flex;align-items:stretch}.cw-editor>.abc-root{flex-basis:42%;min-width:380px}.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{position:relative;flex:1 1 58%;width:auto;max-width:780px;min-width:0;min-height:0;display:flex;flex-direction:column}.cw-detail-scroll{flex:1;min-height:0;overflow-y:auto;scrollbar-gutter:stable both-edges;padding:24px 16px 96px}.cw-build-next{position:absolute;right:auto;bottom:20px;left:50%;z-index:8;transform:translate(-50%)}.cw-build-next.studio-update-action{background:#111;color:#fff}.cw-build-next.studio-update-action:not(:disabled):hover{background:#29292b;box-shadow:0 7px 18px #00000029;transform:translate(-50%)}.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-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-start{display:inline-flex;align-items:center;justify-content:center;gap:6px;min-height:30px;padding:6px 10px;border:none;border-radius:8px;background:#111;box-shadow:none;color:#fff;font:inherit;font-size:12px;font-weight:600;cursor:pointer;transition:background-color .18s cubic-bezier(.22,1,.36,1),box-shadow .18s ease,transform .15s ease}.cw-debug-start:hover:not(:disabled){background:#29292b;box-shadow:0 7px 18px #00000029}.cw-debug-start:active:not(:disabled){transform:translateY(0) scale(.98)}.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-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-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-validation-workspace{position:relative;flex:1;min-width:0;min-height:0;display:flex;background:hsl(var(--background))}.cw-optimization-panel{min-width:0;min-height:0;display:flex;flex-direction:column;padding:22px 16px 16px;border-right:1px solid hsl(var(--border));background:hsl(var(--cw-workspace-warm))}.cw-optimization-head{display:flex;flex-direction:column;gap:5px;padding:0 4px 18px}.cw-optimization-head>span{color:hsl(var(--cw-workspace-ink));font-size:16px;font-weight:700;letter-spacing:-.02em}.cw-optimization-head>small{color:hsl(var(--muted-foreground));font-size:11px;line-height:1.45}.cw-optimization-list{display:flex;flex-direction:column;gap:8px}.cw-optimization-option{position:relative;width:100%;display:flex;align-items:flex-start;gap:9px;padding:11px;border:1px solid hsl(var(--border) / .82);border-radius:11px;background:hsl(var(--panel) / .62);color:hsl(var(--foreground));cursor:pointer;transition:background-color .14s ease,border-color .14s ease,box-shadow .14s ease}.cw-optimization-option:hover{border-color:hsl(var(--cw-workspace-ink) / .24);background:hsl(var(--panel))}.cw-optimization-option.is-disabled{cursor:not-allowed;opacity:.62}.cw-optimization-option.is-disabled:hover{border-color:hsl(var(--border) / .82);background:hsl(var(--panel) / .62)}.cw-optimization-option:has(input:focus-visible){outline:2px solid hsl(var(--cw-workspace-ink) / .34);outline-offset:2px}.cw-optimization-option input{position:absolute;width:1px;height:1px;overflow:hidden;opacity:0;pointer-events:none}.cw-optimization-check{width:17px;height:17px;flex:0 0 17px;display:inline-flex;align-items:center;justify-content:center;margin-top:1px;border:1px solid hsl(var(--foreground) / .24);border-radius:5px;background:hsl(var(--panel));color:#fff}.cw-optimization-check .cw-i{width:11px;height:11px;stroke-width:2.4}.cw-optimization-copy{min-width:0;display:flex;flex-direction:column;gap:4px}.cw-optimization-copy strong{color:hsl(var(--cw-workspace-ink));font-size:12.5px;font-weight:650}.cw-optimization-copy small{color:hsl(var(--muted-foreground));font-size:10.5px;line-height:1.45}.cw-validation-content{flex:1;min-width:0;min-height:0;display:flex;overflow:hidden;background:#fff}.cw-ab-workspace{flex:1;min-width:0;min-height:0;display:grid;grid-template-rows:minmax(0,1fr) auto;overflow:hidden;background:#fff}.cw-ab-stage{position:relative;flex:1;min-width:0;min-height:0;overflow-x:hidden;overflow-y:auto;padding:8px var(--cw-workspace-gutter)}.cw-ab-grid{min-height:100%;display:grid;grid-template-columns:repeat(3,minmax(0,1fr));grid-auto-rows:minmax(420px,1fr);align-items:stretch;gap:12px}.cw-ab-add{min-height:420px;border:1px dashed hsl(var(--foreground) / .2);border-radius:16px;background:hsl(var(--background) / .5)}.cw-ab-card{min-width:0;min-height:420px;display:flex;flex-direction:column;perspective:1400px}.cw-ab-card-inner{position:relative;width:100%;min-height:420px;flex:1;transform-style:preserve-3d;transition:transform .44s cubic-bezier(.22,1,.36,1)}.cw-ab-card-inner.is-flipped{transform:rotateY(180deg)}.cw-ab-card-face{position:absolute;top:0;right:0;bottom:0;left:0;min-width:0;display:flex;flex-direction:column;overflow:hidden;border:1px dashed hsl(var(--foreground) / .2);border-radius:16px;background:hsl(var(--background));backface-visibility:hidden;-webkit-backface-visibility:hidden;transition:border-color .16s ease,background-color .16s ease}.cw-ab-card-back{transform:rotateY(180deg);overflow-x:hidden;overflow-y:auto}.cw-ab-card-head{min-height:54px;display:flex;align-items:center;justify-content:space-between;gap:10px;padding:9px 11px 9px 14px}.cw-ab-card-title{min-width:0;display:flex;flex-direction:column;gap:2px}.cw-ab-card-title strong{font-size:13.5px;font-weight:680}.cw-ab-card-title span{max-width:150px;overflow:hidden;color:hsl(var(--muted-foreground));font-size:10.5px;text-overflow:ellipsis;white-space:nowrap}.cw-ab-card-actions{flex:0 0 auto;display:flex;align-items:center;gap:4px}.cw-ab-config-trigger,.cw-ab-remove{min-height:28px;display:inline-flex;align-items:center;justify-content:center;gap:4px;padding:0 8px;border:0;border-radius:7px;background:hsl(var(--secondary) / .58);color:hsl(var(--muted-foreground));cursor:pointer;font:inherit;font-size:11px;font-weight:400}.cw-ab-config-trigger{background:#fdf1ce;color:#825917}.cw-ab-config-trigger:hover:not(:disabled){background:#fae7b2;color:#6f4811}.cw-ab-remove:hover{background:hsl(var(--secondary) / .62);color:hsl(var(--foreground))}.cw-ab-config-trigger:disabled,.cw-ab-remove:disabled{cursor:default;opacity:.45}.cw-ab-remove{width:28px;padding:0;background:transparent}.cw-ab-config-head{min-height:68px;display:flex;align-items:center;justify-content:space-between;gap:12px;padding:14px 16px 10px;background:hsl(var(--background) / .94)}.cw-ab-config-head>div{min-width:0;display:flex;flex-direction:column;gap:3px}.cw-ab-config-head strong{font-size:16px;font-weight:680}.cw-ab-config-head span{color:hsl(var(--muted-foreground));font-size:12px}.cw-ab-config-done{min-height:32px;padding:0 11px;border:0;border-radius:8px;background:hsl(var(--foreground));color:hsl(var(--background));cursor:pointer;font:inherit;font-size:12px;font-weight:650}.cw-ab-config-done-wrap{position:relative;flex:0 0 auto;display:inline-flex;border-radius:8px}.cw-ab-config-done:disabled{background:hsl(var(--secondary) / .82);color:hsl(var(--muted-foreground) / .68);cursor:not-allowed}.cw-ab-config-done-tip{position:absolute;z-index:8;right:0;bottom:calc(100% + 7px);width:max-content;max-width:190px;padding:6px 8px;border-radius:7px;background:hsl(var(--foreground));color:hsl(var(--background));font-size:11px;font-weight:400;line-height:1.4;opacity:0;pointer-events:none;transform:translateY(3px);transition:opacity .14s ease,transform .14s ease}.cw-ab-config-done-wrap.is-disabled:hover .cw-ab-config-done-tip,.cw-ab-config-done-wrap.is-disabled:focus-visible .cw-ab-config-done-tip{opacity:1;transform:translateY(0)}.cw-ab-config-done-wrap:focus-visible{outline:2px solid hsl(var(--foreground) / .18);outline-offset:2px}.cw-ab-config{flex:0 0 auto;display:grid;grid-template-columns:minmax(0,1fr);align-content:start;gap:12px;padding:12px 16px 16px;background:hsl(var(--secondary) / .16)}.cw-ab-config>label,.cw-ab-config fieldset{min-width:0;display:flex;flex-direction:column;gap:6px;margin:0;padding:0;border:0}.cw-ab-config>label>span,.cw-ab-config legend{color:hsl(var(--muted-foreground));font-size:13px;font-weight:650}.cw-ab-config legend{width:100%;display:flex;align-items:center;justify-content:space-between;gap:10px}.cw-ab-config legend em{padding:3px 7px;border-radius:999px;background:hsl(var(--secondary));color:hsl(var(--muted-foreground));font-size:10.5px;font-style:normal;font-weight:550}.cw-ab-config input[type=text],.cw-ab-config>label>input,.cw-ab-config>label>textarea{width:100%;min-height:40px;padding:8px 11px;border:1px solid hsl(var(--border));border-radius:8px;background:hsl(var(--background));color:hsl(var(--foreground));font:inherit;font-size:13px}.cw-ab-config>label>textarea{min-height:58px;max-height:132px;resize:vertical;line-height:1.55}.cw-ab-optimization-list{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:8px}.cw-ab-optimization-list label{display:inline-flex;align-items:center;gap:7px;padding:8px 9px;border-radius:8px;background:hsl(var(--background) / .82);color:hsl(var(--foreground));font-size:12.5px;cursor:not-allowed;opacity:.5}.cw-ab-optimization-list input{width:15px;height:15px;margin:0;accent-color:hsl(var(--foreground))}.cw-ab-config>p{margin:0;color:hsl(var(--muted-foreground));font-size:12.5px;line-height:1.5}.cw-ab-conversation{flex:1;min-height:0;overflow-y:auto;padding:14px}.cw-ab-empty{height:100%;min-height:210px;display:grid;place-items:center;color:hsl(var(--muted-foreground));font-size:12px}.cw-ab-launch{display:flex;flex-direction:column;align-items:center;justify-content:center;gap:9px;text-align:center}.cw-ab-launch-hint{color:hsl(var(--muted-foreground));font-size:10.5px}.cw-ab-starting{align-content:center;gap:8px}.cw-ab-starting .cw-i{width:18px;height:18px}.cw-ab-start{min-width:118px;min-height:32px;display:inline-flex;align-items:center;justify-content:center;gap:7px;padding:0 13px;border:0;border-radius:9px;background:hsl(var(--secondary) / .72);color:hsl(var(--foreground));cursor:pointer;font:inherit;font-size:11.5px;font-weight:580;transition:background-color .16s ease,box-shadow .16s ease}.cw-ab-start:hover:not(:disabled){background:hsl(var(--secondary));box-shadow:none}.cw-ab-start:disabled{background:hsl(var(--secondary) / .42);color:hsl(var(--muted-foreground) / .62);cursor:not-allowed}.cw-ab-start .cw-i{width:15px;height:15px}.cw-ab-deploy-footer{flex:0 0 auto;display:flex;justify-content:flex-end;padding:0 12px 12px}.cw-ab-deploy{min-height:32px;padding:0 13px;border:0;border-radius:8px;background:#111;color:#fff;cursor:pointer;font:inherit;font-size:11.5px;font-weight:620;transition:background-color .16s ease,box-shadow .16s ease}.cw-ab-deploy:hover:not(:disabled){background:#29292b;box-shadow:0 6px 16px #00000024}.cw-ab-deploy:disabled{cursor:not-allowed;opacity:.42}.cw-ab-add{display:flex;flex-direction:column;align-items:center;justify-content:center;gap:7px;color:hsl(var(--muted-foreground));cursor:pointer;font:inherit;transition:border-color .16s ease,background-color .16s ease,color .16s ease}.cw-ab-add:hover{border-color:hsl(var(--foreground) / .38);background:hsl(var(--secondary) / .24);color:hsl(var(--foreground))}.cw-ab-add .cw-i{width:22px;height:22px}.cw-ab-add strong{font-size:13px}.cw-ab-add span{font-size:10.5px}.cw-ab-composer{position:relative;z-index:2;min-width:0;padding:0 var(--cw-workspace-gutter) 18px;background:#fff}.cw-ab-composer .cw-debug-composerbox{width:min(100%,860px);min-height:48px;margin:0 auto;border-color:hsl(var(--foreground) / .14);border-radius:14px;background:hsl(var(--background) / .92);box-shadow:0 12px 32px hsl(var(--foreground) / .06);-webkit-backdrop-filter:blur(12px);backdrop-filter:blur(12px)}.cw-debug.is-standalone{flex:1;width:100%;min-width:0;border-left:0;background:transparent}.cw-debug.is-standalone .cw-debug-head{height:58px;padding-inline:22px;background:hsl(var(--panel) / .7)}.cw-debug.is-standalone .cw-debug-title{font-size:15px}.cw-debug.is-standalone .cw-debug-body{padding:22px clamp(18px,5vw,72px) 28px}.cw-debug.is-standalone .cw-debug-chat{width:min(100%,840px);margin:0 auto}.cw-debug.is-standalone .cw-debug-chat-empty{min-height:260px;border:1px dashed hsl(var(--border));border-radius:16px;background:hsl(var(--panel) / .56)}.cw-debug.is-standalone .cw-debug-composer{padding:12px 210px 20px clamp(18px,5vw,72px);background:transparent}.cw-debug.is-standalone .cw-debug-composerbox{width:min(100%,840px);min-height:48px;margin:0 auto;border-color:hsl(var(--foreground) / .14);border-radius:14px;box-shadow:0 12px 32px hsl(var(--foreground) / .06)}.cw-debug.is-standalone .cw-debug-overlay{background:hsl(var(--background) / .68)}.cw-debug.is-standalone .cw-debug-overlay-content{width:min(100%,390px);padding:28px;border-radius:16px}.cw-validation-prototype{flex:1;min-width:0;min-height:0;overflow-y:auto;padding:clamp(26px,4vw,56px)}.cw-validation-page-head{display:flex;align-items:flex-end;justify-content:space-between;gap:24px;margin:0 auto 28px;max-width:1040px}.cw-eyebrow{color:hsl(var(--cw-workspace-accent));font-family:ui-monospace,SFMono-Regular,Menlo,Monaco,Consolas,monospace;font-size:10px;font-weight:700;letter-spacing:.15em}.cw-validation-page-head h2{margin:5px 0 4px;color:hsl(var(--cw-workspace-ink));font-size:clamp(24px,3vw,34px);font-weight:720;letter-spacing:-.045em}.cw-validation-page-head p{margin:0;color:hsl(var(--muted-foreground));font-size:13px}.cw-prototype-action{min-height:40px;display:inline-flex;align-items:center;justify-content:center;gap:7px;padding:0 14px;border:1px solid hsl(var(--cw-workspace-ink));border-radius:8px;background:hsl(var(--cw-workspace-ink));color:hsl(var(--background));font:inherit;font-size:12px;font-weight:650}.cw-prototype-action:disabled{cursor:not-allowed;opacity:.72}.cw-dataset-summary,.cw-variant-grid,.cw-metric-board,.cw-prototype-table,.cw-run-list,.cw-prototype-note{width:min(100%,1040px);margin-inline:auto}.cw-dataset-summary{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));margin-bottom:14px;border:1px solid hsl(var(--border));border-radius:12px;background:hsl(var(--panel));box-shadow:0 10px 32px hsl(var(--foreground) / .035)}.cw-dataset-summary>div{display:flex;flex-direction:column;gap:4px;padding:17px 20px}.cw-dataset-summary>div+div{border-left:1px solid hsl(var(--border))}.cw-dataset-summary strong{color:hsl(var(--cw-workspace-ink));font-size:22px;letter-spacing:-.04em}.cw-dataset-summary span{color:hsl(var(--muted-foreground));font-size:10.5px}.cw-prototype-table{overflow:hidden;border:1px solid hsl(var(--border));border-radius:12px;background:hsl(var(--panel))}.cw-prototype-row{min-height:54px;display:grid;grid-template-columns:minmax(180px,1.3fr) minmax(100px,.7fr) minmax(170px,1fr) 82px;align-items:center;gap:16px;padding:10px 16px;border-top:1px solid hsl(var(--border));color:hsl(var(--muted-foreground));font-size:11.5px}.cw-prototype-row.is-head{min-height:38px;border-top:0;background:hsl(var(--secondary) / .42);color:hsl(var(--muted-foreground));font-size:10px;font-weight:650;letter-spacing:.04em;text-transform:uppercase}.cw-prototype-row>strong{color:hsl(var(--foreground));font-size:12px;font-weight:600}.cw-status-pill,.cw-run-status,.cw-run-kind{justify-self:start;padding:3px 7px;border-radius:999px;background:hsl(var(--secondary));color:hsl(var(--muted-foreground));font-size:10px;font-weight:600}.cw-variant-grid{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:14px;margin-bottom:14px}.cw-variant-card{position:relative;overflow:hidden;padding:20px;border:1px solid hsl(var(--border));border-radius:14px;background:hsl(var(--panel));box-shadow:0 12px 34px hsl(var(--foreground) / .04)}.cw-variant-card:before{content:"";position:absolute;top:0;left:0;width:100%;height:3px;background:hsl(var(--foreground) / .22)}.cw-variant-card.is-candidate:before{background:hsl(var(--cw-workspace-accent))}.cw-variant-head{display:flex;align-items:center;justify-content:space-between;margin-bottom:28px;color:hsl(var(--muted-foreground));font-size:10px;font-weight:650;letter-spacing:.06em;text-transform:uppercase}.cw-variant-head small{padding:3px 7px;border-radius:999px;background:hsl(var(--secondary));font-size:9.5px;letter-spacing:0;text-transform:none}.cw-variant-card>strong{color:hsl(var(--cw-workspace-ink));font-size:17px;letter-spacing:-.025em}.cw-variant-card>p{min-height:42px;margin:7px 0 22px;color:hsl(var(--muted-foreground));font-size:12px;line-height:1.6}.cw-variant-card dl{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:8px;margin:0}.cw-variant-card dl>div{padding:9px 10px;border-radius:8px;background:hsl(var(--secondary) / .5)}.cw-variant-card dt{color:hsl(var(--muted-foreground));font-size:9.5px}.cw-variant-card dd{margin:3px 0 0;color:hsl(var(--foreground));font-family:ui-monospace,SFMono-Regular,Menlo,Monaco,Consolas,monospace;font-size:10.5px}.cw-metric-board{overflow:hidden;border:1px solid hsl(var(--border));border-radius:12px;background:hsl(var(--panel))}.cw-metric-head,.cw-metric-row{display:grid;grid-template-columns:minmax(170px,1fr) 100px 100px 88px;align-items:center;gap:12px;padding:11px 16px}.cw-metric-head{grid-template-columns:auto auto minmax(0,1fr);min-height:48px;border-bottom:1px solid hsl(var(--border))}.cw-metric-head .cw-i{width:15px;color:hsl(var(--cw-workspace-accent))}.cw-metric-head strong{font-size:12px}.cw-metric-head span{justify-self:end;color:hsl(var(--muted-foreground));font-size:10.5px}.cw-metric-row{min-height:44px;color:hsl(var(--muted-foreground));font-size:11px}.cw-metric-row+.cw-metric-row{border-top:1px solid hsl(var(--border) / .7)}.cw-metric-row strong{color:hsl(var(--foreground));font-family:ui-monospace,SFMono-Regular,Menlo,Monaco,Consolas,monospace;font-size:11px}.cw-metric-row em{color:hsl(var(--cw-workspace-accent));font-size:10.5px;font-style:normal;font-weight:650}.cw-run-list{overflow:hidden;border:1px solid hsl(var(--border));border-radius:12px;background:hsl(var(--panel))}.cw-run-row{min-height:72px;display:grid;grid-template-columns:36px minmax(220px,1fr) 70px 110px 72px;align-items:center;gap:12px;padding:11px 16px}.cw-run-row+.cw-run-row{border-top:1px solid hsl(var(--border))}.cw-run-icon{width:32px;height:32px;display:inline-flex;align-items:center;justify-content:center;border-radius:9px;background:hsl(var(--cw-workspace-accent-soft));color:hsl(var(--cw-workspace-accent))}.cw-run-icon .cw-i{width:14px;height:14px}.cw-run-row>div{min-width:0}.cw-run-row strong{color:hsl(var(--foreground));font-size:12px}.cw-run-row p{margin:3px 0 0;overflow:hidden;color:hsl(var(--muted-foreground));font-size:10.5px;text-overflow:ellipsis;white-space:nowrap}.cw-run-row time{color:hsl(var(--muted-foreground));font-size:10.5px}.cw-run-status.is-running{background:hsl(var(--cw-workspace-accent-soft));color:hsl(var(--cw-workspace-accent))}.cw-prototype-note{display:flex;align-items:center;gap:7px;margin-top:14px;color:hsl(var(--muted-foreground));font-size:10.5px}.cw-prototype-note .cw-i{width:13px;height:13px}.cw-publish-loading{flex:1;display:flex;flex-direction:column;align-items:center;justify-content:center;gap:7px;color:hsl(var(--muted-foreground));font-size:12px}.cw-publish-loading .cw-i{width:22px;height:22px;margin-bottom:5px;color:hsl(var(--cw-workspace-accent))}.cw-publish-loading strong{color:hsl(var(--foreground));font-size:14px}.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:36px;min-height:36px;gap:8px;padding:0 10px 0 12px;border:1px solid hsl(var(--border));border-radius:6px;background-color:hsl(var(--background));color:hsl(var(--foreground));cursor:pointer;font:inherit;font-size:12px;font-weight:500;line-height:1.35;letter-spacing:0;transition:border-color .12s ease,box-shadow .12s ease,background-color .12s ease}.cw-a2a-space-trigger:hover:not(:disabled){border-color:hsl(var(--foreground) / .24);background-color:hsl(var(--muted) / .18)}.cw-a2a-space-trigger[aria-expanded=true]{border-color:hsl(var(--ring) / .42);background-color:hsl(var(--background));box-shadow:0 0 0 3px hsl(var(--ring) / .1)}.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>span.is-placeholder{color:hsl(var(--muted-foreground));font-weight:400}.cw-a2a-space-trigger-icon{width:18px;height:18px;flex-shrink:0;color:hsl(var(--muted-foreground));transition:transform .16s ease}.cw-a2a-space-trigger[aria-expanded=true] .cw-a2a-space-trigger-icon{transform:rotate(180deg)}.cw-a2a-space-menu{position:absolute;z-index:30;top:calc(100% + 6px);left:0;width:100%;overflow:hidden;padding:4px;border:1px solid hsl(var(--border));border-radius:6px;background:hsl(var(--background));color:hsl(var(--foreground));box-shadow:0 8px 24px hsl(var(--foreground) / .08);font-size:12px}.cw-picker-search{padding:4px 4px 6px;border-bottom:1px solid hsl(var(--border) / .72)}.cw-picker-search-input{width:100%;height:30px;padding:0 9px;border:1px solid hsl(var(--border));border-radius:5px;outline:none;background:hsl(var(--background));color:hsl(var(--foreground));font:inherit;font-size:12px}.cw-picker-search-input:focus{border-color:hsl(var(--ring) / .5);box-shadow:0 0 0 2px hsl(var(--ring) / .1)}.cw-picker-options{max-height:188px;overflow-y:auto;padding-top:4px;overscroll-behavior:contain}.cw-picker-empty{padding:14px 10px;color:hsl(var(--muted-foreground));text-align:center}.cw-a2a-space-option{display:flex;align-items:center;width:100%;min-height:34px;padding:8px 10px;border:0;border-radius:4px;background:transparent;color:hsl(var(--foreground));cursor:pointer;font:inherit;font-size:12px;font-weight:500;line-height:1.35;text-align:left;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.cw-a2a-space-option:hover,.cw-a2a-space-option:focus-visible{outline:none;background:hsl(var(--muted) / .5)}.cw-a2a-space-option.is-selected{background:hsl(var(--primary) / .08);color:hsl(var(--foreground))}.cw-a2a-space-refresh{flex-shrink:0;width:36px;height:36px;border:1px solid hsl(var(--border));border-radius:6px;background:hsl(var(--background));color:hsl(var(--foreground));transition:border-color .12s ease,background-color .12s ease}.cw-a2a-space-refresh:hover:not(:disabled){border-color:hsl(var(--foreground) / .24);background:hsl(var(--muted) / .4)}.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-viking-kb-picker{gap:6px}.cw-viking-kb-menu{padding:3px;box-shadow:0 6px 18px hsl(var(--foreground) / .06)}.cw-viking-kb-menu .cw-picker-options{max-height:min(112px,calc(100vh - 310px))}.cw-viking-kb-menu .cw-a2a-space-option{min-height:28px;padding:5px 9px;line-height:1.25}.cw-viking-kb-refresh{color:hsl(var(--foreground) / .72)}.cw-viking-kb-refresh:hover:not(:disabled){border-color:hsl(var(--foreground) / .28);background:hsl(var(--muted) / .45);color:hsl(var(--foreground))}.cw-viking-kb-refresh:disabled{color:hsl(var(--muted-foreground))}.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-tool-config{padding:14px;border:1px solid hsl(var(--border));border-radius:12px;background:hsl(var(--muted) / .28)}.cw-tool-config-head{display:flex;flex-direction:column;gap:3px}.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-agent-type-options{display:grid;grid-template-columns:repeat(auto-fit,minmax(150px,1fr));gap:8px}.cw-agent-type-option{position:relative;min-width:0;min-height:58px;display:flex;align-items:center;gap:10px;padding:10px 12px;border:1px solid hsl(var(--border) / .72);border-radius:10px;background:#fff;color:hsl(var(--foreground));cursor:pointer;transition:border-color .15s ease,background-color .15s ease}.cw-agent-type-option:hover{border-color:hsl(var(--foreground) / .2);background:hsl(var(--secondary) / .28)}.cw-agent-type-option.is-on{border-color:hsl(var(--foreground) / .3);background:hsl(var(--secondary) / .42)}.cw-agent-type-option.is-disabled{color:hsl(var(--muted-foreground) / .52);cursor:not-allowed}.cw-agent-type-radio{width:15px;height:15px;flex:0 0 15px;margin:0;accent-color:hsl(var(--foreground))}.cw-agent-type-copy{min-width:0;display:flex;flex-direction:column;gap:2px}.cw-agent-type-copy strong{font-size:13px;font-weight:650}.cw-agent-type-copy small{overflow:hidden;color:hsl(var(--muted-foreground));font-size:10.5px;line-height:1.35;text-overflow:ellipsis;white-space:nowrap}.cw-agent-type-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-agent-type-option.is-disabled:hover .cw-agent-type-disabled-hint,.cw-agent-type-option.is-disabled:focus .cw-agent-type-disabled-hint,.cw-agent-type-option.is-disabled:focus-visible .cw-agent-type-disabled-hint{opacity:1;transform:translateY(0)}.cw-agent-type-option:has(.cw-agent-type-radio:focus-visible){box-shadow:inset 0 0 0 2px hsl(var(--ring) / .45)}.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-workspace-header{grid-template-columns:minmax(160px,1fr) auto minmax(160px,1fr);gap:16px;padding-inline:16px}.cw-debug{width:280px}.cw-tree{width:208px}}@media (max-width: 1080px){.cw-workspace-header{grid-template-columns:minmax(140px,1fr) auto minmax(140px,1fr)}.cw-editor{flex-wrap:nowrap;overflow:hidden}.cw-tree{height:auto}.cw-detail{flex-basis:58%;width:auto;max-width:560px;height:auto;min-height:0}.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-root{--cw-workspace-gutter: 8px}.cw-workspace-header{min-height:108px;grid-template-columns:minmax(0,1fr);gap:8px;margin:8px var(--cw-workspace-gutter) 0;padding:9px 10px}.cw-workspace-stepper{grid-column:1;width:min(100%,340px);justify-self:center}.cw-workspace-actions{position:absolute;top:10px;right:12px;grid-column:1}.cw-validation-workspace{display:flex}.cw-ab-stage{padding:8px var(--cw-workspace-gutter)}.cw-ab-grid{grid-template-columns:repeat(3,minmax(0,1fr))}.cw-ab-composer{padding-inline:var(--cw-workspace-gutter)}.cw-editor{flex-direction:column;flex-wrap:nowrap;overflow-x:hidden;overflow-y:auto}.cw-editor>.abc-root{width:100%;min-width:0}.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-detail-scroll{padding:20px 12px 90px}.cw-build-next{bottom:14px}.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-workspace-stepper button{padding-inline:4px}.cw-optimization-list,.cw-ab-grid,.cw-ab-config{grid-template-columns:minmax(0,1fr)}.cw-ab-composer{padding-bottom:12px}.cw-dataset-summary>div+div{border-top:1px solid hsl(var(--border));border-left:0}}.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}}.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}}.package-create{flex:1;min-width:0;min-height:0;display:flex;color:hsl(var(--foreground))}.package-create-preview{height:100%}.package-create-preview>*{flex:1;min-width:0;min-height:0}.package-source-pane{padding:16px 18px 18px}.package-source-label{margin-bottom:10px;color:hsl(var(--foreground));font-size:15px;font-weight:650}.package-dropzone{min-height:152px;display:flex;flex-direction:column;align-items:center;justify-content:center;gap:7px;padding:20px;border:1px dashed hsl(var(--border));border-radius:12px;background:hsl(var(--secondary) / .16);text-align:center;cursor:pointer;transition:border-color .16s ease,background-color .16s ease}.package-dropzone:focus-visible{outline:2px solid hsl(var(--ring) / .55);outline-offset:3px}.package-dropzone.is-dragging{border-color:hsl(var(--primary) / .62);background:hsl(var(--primary) / .045)}.package-dropzone.is-ready{background:hsl(var(--background))}.package-dropzone>strong{max-width:100%;overflow:hidden;font-size:15px;font-weight:650;text-overflow:ellipsis;white-space:nowrap}.package-dropzone>span{max-width:420px;color:hsl(var(--muted-foreground));font-size:13px;line-height:1.6}.package-upload-actions{display:flex;align-items:center;justify-content:center;gap:8px;margin-top:5px}.package-upload-actions button{min-height:36px;padding:0 16px;border-radius:7px;font:inherit;font-size:13px;font-weight:600;cursor:pointer;transition:background-color .14s ease,border-color .14s ease,color .14s ease}.package-upload-secondary{border:1px solid hsl(var(--border));background:hsl(var(--background));color:hsl(var(--foreground))}.package-upload-secondary:hover:not(:disabled){border-color:hsl(var(--foreground) / .24);background:hsl(var(--secondary))}.package-upload-actions button:disabled{cursor:default;opacity:.45}.package-upload-actions button:focus-visible{outline:2px solid hsl(var(--ring) / .55);outline-offset:2px}.package-dropzone input{display:none}.package-create-error{flex:0 0 auto;margin-top:12px;padding:10px 12px;border:1px solid hsl(var(--destructive) / .2);border-radius:8px;background:hsl(var(--destructive) / .07);color:hsl(var(--destructive));font-size:13px;line-height:1.5}@media (max-width: 860px){.package-dropzone{min-height:140px}}@media (prefers-reduced-motion: reduce){.package-dropzone,.package-upload-actions button{transition:none}}.studio-update-trigger{display:inline-flex;align-items:center;justify-content:center;gap:7px;min-width:112px;min-height:32px;padding:0 10px;border:1px solid #1664ff;border-radius:8px;background:#1664ff;color:#fff;font:inherit;font-size:12px;font-weight:500;cursor:pointer;transition:border-color .14s ease,background-color .14s ease,color .14s ease}.studio-update-trigger.is-idle{gap:0;width:32px;min-width:32px;padding:0;overflow:hidden;white-space:nowrap;transition:width .18s ease,gap .18s ease,padding .18s ease,border-color .14s ease,background-color .14s ease,color .14s ease}.studio-update-trigger.is-idle:hover,.studio-update-trigger.is-idle:focus-visible{gap:7px;width:124px;padding:0 10px;border-color:#1664ff;background:#1664ff;color:#fff}.studio-update-trigger.is-idle>span{max-width:0;overflow:hidden;opacity:0;transform:translate(-4px);transition:max-width .18s ease,opacity .12s ease,transform .18s ease}.studio-update-trigger.is-idle:hover>span,.studio-update-trigger.is-idle:focus-visible>span{max-width:86px;opacity:1;transform:translate(0)}.studio-update-trigger.is-submitting{border-color:hsl(var(--border));background:hsl(var(--background));color:hsl(var(--foreground));cursor:pointer}.studio-update-trigger.is-error{border-color:hsl(var(--border));background:hsl(var(--background));color:hsl(var(--destructive))}.studio-update-trigger.is-published{border-color:hsl(var(--border));background:hsl(var(--background));color:hsl(var(--foreground))}.studio-update-icon{width:17px;height:17px;flex:0 0 17px}.studio-update-dialog{display:grid;grid-template-columns:30px minmax(0,1fr);column-gap:10px;width:500px}.studio-update-dialog>.studio-update-dialog-mark{grid-column:1;grid-row:1}.studio-update-dialog>.confirm-title{grid-column:2;grid-row:1;align-self:start;margin:5px 0 12px}.studio-update-dialog>:not(.studio-update-dialog-mark,.confirm-title){grid-column:1 / -1}.studio-update-field{position:relative;display:grid;gap:6px;margin-bottom:12px;color:hsl(var(--muted-foreground));font-size:12px}.studio-update-version-trigger{display:flex;align-items:center;justify-content:space-between;gap:8px;width:100%;height:36px;padding:0 10px 0 12px;border:1px solid hsl(var(--border));border-radius:8px;background:hsl(var(--background));color:hsl(var(--foreground));font:inherit;font-size:13px;font-variant-numeric:tabular-nums;font-weight:500;text-align:left;cursor:pointer;transition:border-color .12s ease,box-shadow .12s ease,background-color .12s ease}.studio-update-version-trigger:hover{border-color:hsl(var(--foreground) / .24);background:hsl(var(--muted) / .18)}.studio-update-version-trigger[aria-expanded=true]{border-color:hsl(var(--ring) / .42);background:hsl(var(--background));box-shadow:0 0 0 3px hsl(var(--ring) / .1)}.studio-update-version-trigger:focus-visible{outline:none;box-shadow:0 0 0 3px hsl(var(--ring) / .12)}.studio-update-version-trigger>svg{width:16px;height:16px;flex:0 0 16px;color:hsl(var(--muted-foreground));stroke:currentColor;stroke-width:1.6;stroke-linecap:round;stroke-linejoin:round;transition:transform .16s ease}.studio-update-version-trigger[aria-expanded=true]>svg{transform:rotate(180deg)}.studio-update-version-menu{position:absolute;z-index:50;top:calc(100% + 6px);left:0;width:100%;max-height:190px;padding:4px;overflow-y:auto;border:1px solid hsl(var(--border));border-radius:8px;background:hsl(var(--panel, var(--background)));box-shadow:0 12px 28px hsl(var(--foreground) / .1),0 2px 8px hsl(var(--foreground) / .05);overscroll-behavior:contain}.studio-update-version-option{display:flex;align-items:center;justify-content:space-between;gap:8px;width:100%;min-height:34px;padding:7px 9px;border:0;border-radius:6px;background:transparent;color:hsl(var(--foreground));font:inherit;font-size:12px;font-variant-numeric:tabular-nums;font-weight:500;text-align:left;cursor:pointer}.studio-update-version-option:hover,.studio-update-version-option:focus-visible{outline:none;background:hsl(var(--muted) / .5)}.studio-update-version-option.is-selected{background:hsl(var(--primary) / .08)}.studio-update-version-option>svg{width:15px;height:15px;flex:0 0 15px;color:hsl(var(--primary));stroke:currentColor;stroke-width:1.8;stroke-linecap:round;stroke-linejoin:round}.studio-update-dialog-mark{display:inline-grid;flex:0 0 30px;width:30px;height:30px;margin-bottom:12px;place-items:center;border-radius:8px;background:hsl(var(--secondary));color:hsl(var(--foreground))}.studio-update-dialog-mark svg{width:18px;height:18px}.studio-update-versions{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:10px 16px;margin:0 0 18px;padding:12px;border:1px solid hsl(var(--border));border-radius:9px;background:hsl(var(--canvas) / .5)}.studio-update-versions div:last-child{grid-column:1 / -1}.studio-update-versions dt{margin-bottom:3px;color:hsl(var(--muted-foreground));font-size:11px}.studio-update-versions dd{margin:0;overflow:hidden;color:hsl(var(--foreground));font-size:12px;font-variant-numeric:tabular-nums;text-overflow:ellipsis;white-space:nowrap}.studio-update-changelog{margin:0 0 18px;padding:12px;border:1px solid hsl(var(--border));border-radius:9px}.studio-update-changelog>div{margin-bottom:7px;color:hsl(var(--foreground));font-size:12px;font-weight:500}.studio-update-changelog ul{display:grid;gap:5px;max-height:min(180px,25vh);margin:0;padding:0 6px 0 18px;overflow-y:auto;overscroll-behavior:contain;scrollbar-gutter:stable}.studio-update-changelog li,.studio-update-changelog p{margin:0;color:hsl(var(--muted-foreground));font-size:12px;line-height:1.55}.studio-update-confirm{border-color:transparent;background:hsl(var(--primary));color:hsl(var(--primary-foreground))}.studio-update-confirm:hover{background:hsl(var(--primary) / .88)}.studio-update-error{margin-bottom:12px;color:hsl(var(--destructive))}.studio-update-error-panel{min-width:0}.studio-update-error-meta{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:10px;margin:0 0 12px}.studio-update-error-meta>div{min-width:0;padding:10px 12px;border:1px solid hsl(var(--border));border-radius:8px;background:hsl(var(--canvas) / .5)}.studio-update-error-meta dt{margin-bottom:3px;color:hsl(var(--muted-foreground));font-size:11px}.studio-update-error-meta dd{margin:0;overflow:hidden;color:hsl(var(--foreground));font-family:ui-monospace,SFMono-Regular,Menlo,Monaco,Consolas,monospace;font-size:11px;text-overflow:ellipsis;white-space:nowrap}.studio-update-log-header{display:flex;align-items:center;justify-content:space-between;gap:12px;padding:8px 10px;border:1px solid hsl(var(--border));border-bottom:0;border-radius:8px 8px 0 0;background:hsl(var(--muted) / .28);color:hsl(var(--foreground));font-size:11px;font-weight:500}.studio-update-log-header>span{display:inline-flex;align-items:center;gap:6px}.studio-update-log-header i{width:6px;height:6px;border-radius:50%;background:hsl(var(--muted-foreground))}.studio-update-log-header i.is-active{background:#1664ff;box-shadow:0 0 0 3px #1664ff1c}.studio-update-log-header i.is-complete{background:#29ae60}.studio-update-log-header i.is-error{background:hsl(var(--destructive))}.studio-update-log-header small{color:hsl(var(--muted-foreground));font-size:10px;font-weight:400}.studio-update-log-header button{padding:2px 0;border:0;background:transparent;color:hsl(var(--primary));font:inherit;cursor:pointer}.studio-update-log-header button:hover{text-decoration:underline;text-underline-offset:2px}.studio-update-log-header button:disabled{color:hsl(var(--muted-foreground));cursor:default;text-decoration:none}.studio-update-log-lines{min-height:92px;max-height:min(210px,29vh);padding:11px 12px;overflow-y:auto;border:1px solid hsl(var(--border));border-radius:0 0 8px 8px;background:hsl(var(--foreground) / .035);color:hsl(var(--foreground));font-family:inherit;font-size:11px;line-height:1.55;overflow-wrap:anywhere;overscroll-behavior:contain;scrollbar-gutter:stable}.studio-update-log-lines:focus-visible{outline:2px solid hsl(var(--ring) / .35);outline-offset:-2px}.studio-update-log-lines>div+div{margin-top:3px}.studio-update-log-lines p{margin:0;color:hsl(var(--muted-foreground))}.studio-update-console-link{display:inline-flex;align-items:center;gap:5px;margin-top:10px;color:hsl(var(--primary));font-size:11px;font-weight:500;text-decoration:none}.studio-update-console-link:hover{text-decoration:underline;text-underline-offset:2px}.studio-update-progress-summary{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:10px;margin:14px 0 18px}.studio-update-progress-summary>div{display:grid;gap:4px;padding:10px 12px;border:1px solid hsl(var(--border));border-radius:8px;background:hsl(var(--canvas) / .5)}.studio-update-progress-summary span{color:hsl(var(--muted-foreground));font-size:11px}.studio-update-progress-summary strong{overflow:hidden;color:hsl(var(--foreground));font-size:12px;font-variant-numeric:tabular-nums;font-weight:500;text-overflow:ellipsis;white-space:nowrap}.studio-update-progress{display:grid;gap:0;margin:0 0 14px;padding:0;list-style:none}.studio-update-progress li{position:relative;display:grid;grid-template-columns:18px minmax(0,1fr);gap:9px;min-height:38px;color:hsl(var(--muted-foreground));font-size:12px}.studio-update-progress li:not(:last-child):after{position:absolute;top:14px;bottom:-2px;left:5px;width:1px;background:hsl(var(--border));content:""}.studio-update-progress li.is-complete:not(:last-child):after{background:#1664ff}.studio-update-progress-dot{position:relative;z-index:1;width:11px;height:11px;margin-top:2px;border:2px solid hsl(var(--border));border-radius:50%;background:hsl(var(--background))}.studio-update-progress li.is-active,.studio-update-progress li.is-complete{color:hsl(var(--foreground))}.studio-update-progress li.is-active .studio-update-progress-dot{border-color:#1664ff;box-shadow:0 0 0 3px #1664ff1f}.studio-update-progress li.is-complete .studio-update-progress-dot{border-color:#1664ff;background:#1664ff}.studio-update-progress li>div{display:grid;gap:3px;min-width:0}.studio-update-progress small{color:hsl(var(--muted-foreground));font-size:11px}.studio-update-progress-note{margin:12px 0 18px;color:hsl(var(--muted-foreground));font-size:11px;line-height:1.55}@media (max-width: 720px){.studio-update-dialog{width:calc(100vw - 32px)}}.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}}.auth-expired-backdrop{position:fixed;top:0;right:0;bottom:0;left:0;z-index:140;display:grid;place-items:center;padding:20px;background:hsl(var(--foreground) / .22);backdrop-filter:blur(5px) saturate(.88);-webkit-backdrop-filter:blur(5px) saturate(.88)}.auth-expired-dialog{position:relative;width:min(400px,calc(100vw - 40px));overflow:hidden;border:1px solid hsl(var(--border));border-radius:16px;background:hsl(var(--panel));box-shadow:0 28px 80px hsl(var(--foreground) / .2),0 2px 8px hsl(var(--foreground) / .06);animation:auth-expired-enter .18s cubic-bezier(.22,1,.36,1) both}.auth-expired-mark{display:grid;width:32px;height:32px;margin:32px auto 0;place-items:center;color:hsl(var(--foreground))}.auth-expired-mark svg{width:21px;height:21px;stroke-width:1.8}.auth-expired-copy{padding:22px 32px 28px;text-align:center}.auth-expired-copy h2{margin:0;color:hsl(var(--foreground));font-size:19px;font-weight:650;letter-spacing:-.01em}.auth-expired-copy>p:last-child{margin:11px 0 0;color:hsl(var(--muted-foreground));font-size:13px;line-height:1.7}.auth-expired-copy .auth-expired-error{margin-top:10px;color:hsl(var(--destructive))}.auth-expired-actions{padding:0 16px 16px}.auth-expired-actions button{width:100%;height:38px;border:1px solid hsl(var(--foreground));border-radius:9px;background:hsl(var(--foreground));color:hsl(var(--background));font:inherit;font-size:13px;font-weight:650;cursor:pointer;transition:transform .12s ease,opacity .12s ease}.auth-expired-actions button:hover{opacity:.88}.auth-expired-actions button:active{transform:translateY(1px)}.auth-expired-actions button:focus-visible{outline:3px solid hsl(var(--ring) / .28);outline-offset:2px}.auth-expired-actions button:disabled{cursor:wait;opacity:.58}@keyframes auth-expired-enter{0%{opacity:0;transform:translateY(8px) scale(.985)}to{opacity:1;transform:translateY(0) scale(1)}}@media (prefers-reduced-motion: reduce){.auth-expired-dialog{animation: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;padding:0;border:0;background:transparent;color:inherit;cursor:pointer;font-weight:600;font-size:15px;letter-spacing:-.01em;font-family:inherit;text-align:left}.brand-title{overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.brand-logo,.brand-title,.brand{cursor:pointer}.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;height:36px;min-height:36px;padding:8px 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)}.new-chat--conversation>.icon{transform-origin:center}.new-chat--conversation:hover>.icon{animation:sidebar-plus-return .65s cubic-bezier(.22,1,.36,1) both}.sidebar-agent-face{overflow:visible}.sidebar-agent-face__eye{transform-box:fill-box;transform-origin:center}.new-chat--agents:hover .sidebar-agent-face__eye{animation:sidebar-agent-blink .76s ease-in-out both}@keyframes sidebar-plus-return{0%{transform:rotate(0)}48%{transform:rotate(48deg)}to{transform:rotate(0)}}@keyframes sidebar-agent-blink{0%,34%,48%,62%,to{transform:scaleY(1)}41%,55%{transform:scaleY(.08)}}@media (prefers-reduced-motion: reduce){.new-chat--conversation:hover>.icon,.new-chat--agents:hover .sidebar-agent-face__eye{animation:none}}.studio-update-action{min-width:104px;min-height:40px;display:inline-flex;align-items:center;justify-content:center;gap:7px;padding:0 17px;border:0;border-radius:999px;background:#111;color:#fff;box-shadow:none;-webkit-backdrop-filter:blur(7px);backdrop-filter:blur(7px);cursor:pointer;font:inherit;font-size:12.5px;font-weight:650;transition:background-color .24s cubic-bezier(.22,1,.36,1),color .18s ease,box-shadow .24s ease,backdrop-filter .24s ease}.studio-update-action:not(:disabled):hover{border:0;background:#29292b;color:#fff;box-shadow:0 7px 18px #00000029}.studio-update-action:focus-visible{outline:2px solid hsl(var(--ring) / .55);outline-offset:2px}.studio-update-action:disabled{cursor:default;opacity:.42}.sidebar.is-collapsed .new-chat{align-self:center;width:36px;height:36px;min-height:36px;gap:0;padding:9px;overflow:hidden;white-space:nowrap}.sidebar.is-collapsed .sidebar-nav-label,.sidebar.is-collapsed .sidebar-history{display:none}.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))}.agentsel--navbar{position:absolute;top:calc(100% + 7px);left:0;z-index:44;width:min(clamp(264px,26vw,288px),calc(100vw - 48px));height:min(640px,calc(100dvh - 74px));margin-left:0}.agentsel--navbar .agentsel-main{width:100%;flex-basis:auto}.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{position:relative;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}.transcript.is-streaming{overflow-anchor:none}.welcome{position:relative;flex:1;display:flex;flex-direction:column;align-items:center;justify-content:center;padding:0 16px clamp(96px,18vh,152px);gap:40px}.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}.transcript.is-streaming>.turn--assistant:last-child{min-height:max(0px,calc(100% - 180px))}.turn--subagent{isolation:isolate;position:relative;width:100%;max-width:768px;margin-top:34px;margin-bottom:48px;padding:30px 16px 14px;gap:10px;border:1px solid hsl(215 20% 88% / .82);border-radius:14px;background:#f9fafbad;box-shadow:inset 0 1px #fffc,0 14px 36px #33445b0f;backdrop-filter:blur(18px) saturate(115%);-webkit-backdrop-filter:blur(18px) saturate(115%)}.turn--subagent:before{position:absolute;z-index:-1;top:0;right:0;bottom:0;left:0;overflow:hidden;border-radius:inherit;background:radial-gradient(circle at 12% 8%,hsl(210 38% 92% / .55),transparent 38%),radial-gradient(circle at 88% 78%,hsl(220 22% 91% / .42),transparent 42%),linear-gradient(120deg,#ffffff8f,#f2f4f742);content:"";pointer-events:none}.transcript.is-streaming>.turn--subagent:last-child{min-height:0}.subagent-run-label{position:absolute;top:0;left:14px;display:inline-flex;min-height:36px;max-width:calc(100% - 28px);padding:4px 9px 4px 4px;align-items:center;gap:8px;border:1px solid hsl(215 18% 86%);border-radius:10px;background:hsl(var(--background));box-shadow:0 4px 12px #39496012;transform:translateY(-50%)}.subagent-run-handoff{display:inline-flex;height:26px;padding:0 8px 0 6px;flex:0 0 auto;align-items:center;gap:5px;border-radius:7px;background:#eff2f5;color:#606b7b;font-size:12px;font-weight:400;white-space:nowrap}.subagent-run-handoff svg{width:15px;height:15px;flex:0 0 15px}.subagent-run-title{min-width:0;overflow:hidden;color:hsl(var(--foreground));font-size:14.5px;font-weight:400;text-overflow:ellipsis;white-space:nowrap}.subagent-run-description{display:-webkit-box;margin:0;padding:0 2px 4px;overflow:hidden;color:#636c79;font-size:13.5px;line-height:1.6;-webkit-box-orient:vertical;-webkit-line-clamp:2}.turn--subagent .turn-meta{position:absolute;bottom:-38px;left:0;margin-top:0}@media (max-width: 700px){.turn--subagent{width:100%;padding:30px 10px 12px}.subagent-run-label{left:10px;max-width:calc(100% - 20px)}}.bubble{line-height:1.65;font-size:16px}.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:16px;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:14.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:14.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:0;padding:0;border-left:0;color:hsl(var(--muted-foreground));font-size:14px;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}.feedback-btn:hover,.feedback-btn--good,.feedback-btn--bad,.feedback-btn--good:hover,.feedback-btn--bad:hover{background:none;color:hsl(var(--foreground))}.feedback-btn[aria-busy=true]{opacity:1}.feedback-btn--good[aria-busy=true]:hover,.feedback-btn--bad[aria-busy=true]:hover{color:hsl(var(--foreground))}.feedback-btn .icon{width:18px;height:18px}.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--new-chat{position:relative}.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-color:hsl(var(--border) / .55);border-radius:16px;box-shadow:0 8px 32px #00000007,0 24px 72px 8px #00000005}.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;left:52px;bottom:10px;display:flex;align-items:center;min-height:36px}.composer--new-chat.composer--skill-mode .new-chat-mode{left:10px}.composer--new-chat .comp-send{position:absolute;right:10px;bottom:10px}.composer--new-chat .comp-send .icon{width:20px;height:20px}.prompt-suggestions{position:absolute;top:calc(100% + 18px);left:0;z-index:1;display:grid;width:100%;gap:3px}.prompt-suggestion{display:flex;align-items:center;gap:12px;width:100%;min-height:46px;padding:8px 14px;border:0;border-radius:12px;background:transparent;color:hsl(var(--muted-foreground));font:inherit;font-size:15px;line-height:1.5;text-align:left;cursor:pointer;opacity:0;transform:translateY(10px);animation:prompt-suggestion-enter .44s cubic-bezier(.22,1,.36,1) forwards;transition:background .14s ease,color .14s ease,transform .14s ease}.prompt-suggestion:nth-child(2){animation-delay:65ms}.prompt-suggestion:nth-child(3){animation-delay:.13s}.prompt-suggestion:hover{background:hsl(var(--foreground) / .025);color:hsl(var(--foreground))}.prompt-suggestion:focus-visible{outline:2px solid hsl(var(--primary) / .42);outline-offset:-2px}.prompt-suggestion:disabled{cursor:not-allowed;opacity:.5}.prompt-suggestion>svg{flex:0 0 auto;width:18px;height:18px;stroke:currentColor;stroke-linecap:round;stroke-linejoin:round;stroke-width:1.35;transform-origin:center;transition:transform .22s cubic-bezier(.22,1,.36,1)}.prompt-suggestion:nth-child(1):hover>svg{transform:rotate(-8deg) scale(1.06)}.prompt-suggestion:nth-child(2):hover>svg{transform:rotate(6deg) scale(1.07)}.prompt-suggestion:nth-child(3):hover>svg{transform:rotate(-5deg) scale(1.06)}@keyframes prompt-suggestion-enter{to{opacity:1;transform:translateY(0)}}@media (prefers-reduced-motion: reduce){.prompt-suggestion{opacity:1;transform:none;animation:none;transition:none}.prompt-suggestion>svg{transition:none}.prompt-suggestion:hover>svg{transform:none}}.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;container-type:inline-size}.navbar-default{min-width:0}.navbar-title-group{display:flex;align-items:center;min-width:0;gap:6px}.agent-info-trigger{display:inline-flex;width:30px;height:30px;flex:0 0 30px;align-items:center;justify-content:center;padding:0;border:0;border-radius:7px;background:transparent;color:hsl(var(--muted-foreground));cursor:pointer;transition:background .15s ease,color .15s ease}.agent-info-trigger:hover,.agent-info-trigger[aria-expanded=true]{background:hsl(var(--foreground) / .06);color:hsl(var(--foreground))}.agent-info-trigger:focus-visible{outline:2px solid hsl(var(--ring));outline-offset:1px}.agent-info-trigger svg{width:17px;height:17px}.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;min-width:0;max-width:33.333cqw}.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;max-width:100%}.agent-dd-trigger:hover{background:hsl(var(--foreground) / .05)}.agent-dd-current{min-width:0;max-width:100%;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)}@keyframes ddpop{0%{opacity:0;transform:translateY(-4px)}to{opacity:1;transform:translateY(0)}}.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-action{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-action+.account-action{margin-top:2px}.account-action:hover{background:hsl(var(--foreground) / .05)}.account-action .icon{width:16px;height:16px;color:hsl(var(--muted-foreground))}.system-info-dialog{width:360px;padding:0;overflow:hidden}.system-info-head{display:flex;align-items:center;justify-content:space-between;margin:0 20px;padding:20px 0 16px;border-bottom:1px solid hsl(var(--border))}.system-info-head h2{margin:0;font-size:17px;font-weight:650}.system-info-meta{margin:0;padding:18px 20px 20px}.system-info-meta div{display:flex;flex-direction:column;align-items:flex-start;gap:8px}.system-info-meta dt{color:hsl(var(--muted-foreground));font-size:13px}.system-info-meta dd{max-width:100%;margin:0;overflow-wrap:anywhere;font-family:inherit;font-size:13px;font-weight:400;font-variant-numeric:tabular-nums}.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:28px;bottom:18px;right:18px;display:flex;width:288px;min-height:0;overflow:hidden;padding:16px;flex-direction:column;background:hsl(var(--background));border:1px solid hsl(var(--border));border-radius:18px;box-shadow:0 8px 24px hsl(var(--foreground) / .035);z-index:2}.topo.is-loading{bottom:auto;min-height:88px;display:grid;place-items:center}.topo.is-drawer{position:static;width:auto;min-height:0;max-height:none;overflow:visible;padding:22px;background:transparent;border:0;border-radius:0;box-shadow:none}.topo.is-loading.is-drawer{min-height:112px}.topo-loading-label{font-size:12px;line-height:1.5}.topo-agent-card{flex:0 0 auto;min-width:0;padding:0 0 16px;border:0;border-bottom:1px solid hsl(var(--border) / .72);border-radius:0;background:transparent}.topo-agent-heading{display:flex;min-width:0;flex-direction:column;gap:4px}.topo-agent-heading h2{margin:0;overflow:hidden;color:hsl(var(--foreground));font-size:15px;font-weight:650;line-height:1.4;letter-spacing:-.01em;text-overflow:ellipsis;white-space:nowrap}.topo-agent-heading>span{overflow:hidden;color:hsl(var(--muted-foreground));font-size:11.5px;line-height:1.4;text-overflow:ellipsis;white-space:nowrap}.topo-description{display:-webkit-box;margin:12px 0 0;overflow:hidden;color:hsl(var(--muted-foreground));font-size:12px;line-height:1.6;overflow-wrap:anywhere;-webkit-box-orient:vertical;-webkit-line-clamp:3}.topo-module-stack{display:grid;grid-template-rows:minmax(124px,.95fr) minmax(142px,1.15fr) minmax(106px,.75fr);flex:1;min-width:0;min-height:0;gap:0}.topo-module-card{display:flex;min-width:0;min-height:0;padding:14px 0;flex-direction:column;border:0;border-radius:0;background:transparent}.topo-module-card+.topo-module-card{border-top:1px solid hsl(var(--border) / .72)}.topo-module-title{position:static;display:inline-flex;align-items:center;gap:6px;min-height:20px;margin-bottom:0;color:hsl(var(--muted-foreground));font-size:13px;font-weight:600;line-height:1;width:100%}.topo-module-label{display:inline-flex;align-items:center;height:20px;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.topo-section-count{display:inline-flex;align-items:center;justify-content:center;min-width:18px;height:18px;padding:0 5px;border-radius:999px;background:hsl(var(--muted) / .72);color:hsl(var(--muted-foreground));font-size:11px;font-weight:650;font-variant-numeric:tabular-nums;line-height:1;white-space:nowrap}.topo-remove-capability:disabled,.topo-capability-add-slot:disabled{cursor:not-allowed;opacity:.45}.topo-module-scroll{box-sizing:border-box;flex:1;min-height:24px;padding-top:9px;overflow-y:auto;overscroll-behavior:contain;scrollbar-color:hsl(var(--border)) transparent;scrollbar-width:thin}.topo-module-scroll::-webkit-scrollbar{width:4px}.topo-module-scroll::-webkit-scrollbar-track{background:transparent}.topo-module-scroll::-webkit-scrollbar-thumb{border-radius:999px;background:hsl(var(--border))}.topo-module-scroll:focus-visible{outline:2px solid hsl(var(--ring) / .45);outline-offset:3px;border-radius:5px}.topo-tools-scroll{max-height:104px}.topo-skills-scroll{max-height:152px}.topo-topology-scroll{max-height:184px}.topo-tool-list{display:flex;min-width:0;flex-direction:column}.topo-tool{position:relative;display:flex;align-items:center;gap:6px;min-width:0;padding:7px 2px 7px 14px;color:hsl(var(--foreground));font-size:12.5px;line-height:1.4}.topo-tool:before{content:"";position:absolute;top:13px;left:2px;width:5px;height:5px;border:1px solid hsl(var(--muted-foreground) / .7);border-radius:2px}.topo-tool:first-child{padding-top:0}.topo-tool:first-child:before{top:6px}.topo-tool:last-child{padding-bottom:1px}.topo-tool+.topo-tool{border-top:1px solid hsl(var(--border) / .72)}.topo-capability-title,.topo-skill-title{display:flex;align-items:center;min-width:0;gap:6px}.topo-capability-title{flex:1}.topo-capability-name{min-width:0;overflow:hidden;font-size:13px;text-overflow:ellipsis;white-space:nowrap}.topo-capability-copy{display:flex;min-width:0;flex-direction:column;gap:1px}.topo-capability-copy code{overflow:hidden;color:hsl(var(--muted-foreground));font-family:ui-monospace,SFMono-Regular,Menlo,Consolas,monospace;font-size:9.5px;font-weight:450;line-height:1.25;text-overflow:ellipsis;white-space:nowrap}.topo-capability-add-slot{display:flex;width:100%;min-height:34px;margin:0;padding:5px 10px;align-items:center;justify-content:center;gap:6px;border:1px dashed hsl(var(--border));border-radius:9px;background:hsl(var(--muted) / .18);color:hsl(var(--muted-foreground));font:inherit;font-size:11.5px;cursor:pointer;transition:border-color .15s ease,background .15s ease,color .15s ease}.topo-capability-add-dock{flex:0 0 auto;padding-top:6px;background:hsl(var(--background))}.topo-capability-add-slot>span:first-child{font-size:15px;line-height:1}.topo-capability-add-slot:hover:not(:disabled){border-color:hsl(var(--primary) / .55);background:hsl(var(--primary) / .055);color:hsl(var(--primary))}.topo-capability-add-slot:focus-visible{outline:2px solid hsl(var(--ring) / .38);outline-offset:2px}.topo-custom-badge{display:inline-flex;align-items:center;height:17px;padding:0 5px;flex-shrink:0;border-radius:5px;background:hsl(var(--primary) / .1);color:hsl(var(--primary));font-size:9.5px;font-weight:650;line-height:1}.topo-remove-capability{display:inline-flex;align-items:center;justify-content:center;width:20px;height:20px;margin-left:auto;padding:0;flex-shrink:0;border:0;border-radius:6px;background:transparent;color:hsl(var(--muted-foreground));font-size:15px;line-height:1;cursor:pointer}.topo-remove-capability:hover:not(:disabled){background:hsl(var(--destructive) / .1);color:hsl(var(--destructive))}.topo-skill-list{display:flex;min-width:0;flex-direction:column}.topo-skill{display:flex;min-width:0;flex-direction:column;gap:2px;padding:8px 0}.topo-skill:first-child{padding-top:0}.topo-skill:last-child{padding-bottom:1px}.topo-skill+.topo-skill{border-top:1px solid hsl(var(--border) / .72)}.topo-skill-name{min-width:0;overflow:hidden;color:hsl(var(--foreground));font-family:-apple-system,BlinkMacSystemFont,Segoe UI,sans-serif;font-size:13px;font-weight:500;line-height:1.45;text-overflow:ellipsis;white-space:nowrap}.topo-skill-title{width:100%}.topo-skill-description{display:-webkit-box;overflow:hidden;color:hsl(var(--muted-foreground));font-size:12px;line-height:1.45;overflow-wrap:anywhere;-webkit-box-orient:vertical;-webkit-line-clamp:2}.topo-empty{color:hsl(var(--muted-foreground));font-size:11.5px;line-height:1.5}.topo-topology{min-height:0}.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;min-height:34px;padding:6px 7px;border:0;border-radius:8px;background:hsl(var(--muted) / .5);font-size:12px;transition:background .15s ease,box-shadow .15s ease,opacity .15s ease}.topo-icon{width:14px;height:14px;flex-shrink:0;opacity:.78}.topo-name{flex:1;min-width:0;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;font-size:13px;font-weight:550}.topo-badge{flex-shrink:0;font-size:10.5px;padding:1px 5px;border-radius:5px;background:hsl(var(--muted));color:hsl(var(--muted-foreground))}.topo-node.is-active{background:hsl(var(--foreground) / .08);animation:topo-active-fade 1.8s ease-in-out infinite}.topo-node.is-active .topo-icon{opacity:1}.topo-node.is-onpath{background:hsl(var(--primary) / .04);box-shadow:inset 2px 0 hsl(var(--primary) / .4)}.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:5px;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-seg+.topo-path-seg:before{content:"";width:7px;height:1px;margin-right:5px;flex-shrink:0;background:hsl(var(--border))}.topo-path-name{color:hsl(var(--muted-foreground))}.topo-path-name.is-current{color:hsl(var(--primary));font-weight:600}@keyframes topo-active-fade{0%,to{background:hsl(var(--foreground) / .05)}50%{background:hsl(var(--foreground) / .14)}}@media (min-width: 1280px){.agent-info-trigger{display:none}.topo:not(.is-drawer) .topo-module-scroll{max-height:none}.main:has(>.topo)>.transcript{padding-right:322px}.main:has(>.topo)>.conversation-composer-slot{padding-right:322px;padding-left:16px}.conversation-composer-slot>.composer{margin-right:auto;margin-left:auto}}@media (max-width: 1279px){.topo{display:none}.topo.is-drawer{display:block}.topo.is-drawer .topo-module-stack{display:flex;flex-direction:column}}@media (prefers-reduced-motion: reduce){.topo-node{transition:none}.topo-node.is-active,.topo-remote{animation:none}}.session-capability-dialog-layer{position:fixed;top:0;right:0;bottom:0;left:0;z-index:110;display:grid;padding:24px;place-items:center}.session-capability-dialog-scrim{position:absolute;top:0;right:0;bottom:0;left:0;width:100%;height:100%;padding:0;border:0;background:#1013187a;-webkit-backdrop-filter:blur(3px);backdrop-filter:blur(3px)}.session-capability-dialog{position:relative;display:flex;width:min(560px,calc(100vw - 32px));max-height:min(720px,calc(100vh - 48px));flex-direction:column;overflow:hidden;border:1px solid hsl(var(--border));border-radius:16px;background:hsl(var(--background));box-shadow:0 24px 80px #0d121c40,0 2px 8px #0d121c1f;animation:session-capability-dialog-in .18s cubic-bezier(.22,1,.36,1)}.session-capability-dialog.is-wide{width:min(980px,calc(100vw - 48px));height:min(720px,calc(100dvh - 48px))}@keyframes session-capability-dialog-in{0%{opacity:0;transform:translateY(8px) scale(.985)}to{opacity:1;transform:translateY(0) scale(1)}}.session-capability-dialog-head{display:grid;min-height:76px;padding:16px 18px;grid-template-columns:38px minmax(0,1fr) 32px;align-items:center;gap:12px;border-bottom:1px solid hsl(var(--border))}.session-capability-dialog-head.is-iconless{grid-template-columns:minmax(0,1fr) 32px}.session-capability-dialog-mark{display:grid;width:38px;height:38px;border-radius:11px;background:hsl(var(--primary) / .09);color:hsl(var(--primary));place-items:center}.session-capability-dialog-mark svg{width:20px;height:20px}.session-capability-dialog-head h2{margin:0;color:hsl(var(--foreground));font-size:15px;font-weight:680;letter-spacing:-.01em}.session-capability-dialog-head p{margin:4px 0 0;color:hsl(var(--muted-foreground));font-size:11.5px;line-height:1.45}.session-capability-dialog-close{display:grid;width:32px;height:32px;padding:0;border:0;border-radius:8px;background:transparent;color:hsl(var(--muted-foreground));cursor:pointer;place-items:center}.session-capability-dialog-close:hover{background:hsl(var(--muted) / .7);color:hsl(var(--foreground))}.session-capability-dialog-close svg{width:18px;height:18px}.session-capability-search{display:flex;min-width:0;flex:0 0 40px;height:40px;padding:0 12px;align-items:center;gap:8px;border:1px solid hsl(var(--border));border-radius:6px;background:hsl(var(--background));color:hsl(var(--muted-foreground))}.session-capability-search:focus-within{border-color:hsl(var(--ring) / .65);box-shadow:0 0 0 3px hsl(var(--ring) / .1)}.session-capability-search svg{width:16px;height:16px;flex:0 0 auto}.session-capability-search input{width:100%;min-width:0;height:100%;padding:0;border:0;outline:0;background:transparent;color:hsl(var(--foreground));font:inherit;font-size:12px}.session-capability-search input::placeholder{color:hsl(var(--muted-foreground) / .8)}.session-tool-dialog-body{display:flex;min-height:0;padding:16px;flex-direction:column;gap:12px}.session-tool-picker{display:flex;min-height:120px;overflow-y:auto;flex-direction:column;gap:7px;overscroll-behavior:contain}.session-tool-option,.session-skill-option{display:flex;min-width:0;align-items:center;gap:10px;border:1px solid hsl(var(--border) / .85);border-radius:10px;background:hsl(var(--background))}.session-tool-option{min-height:72px;padding:10px 11px}.session-tool-option:hover,.session-skill-option:hover{border-color:hsl(var(--foreground) / .2);background:hsl(var(--muted) / .22)}.session-tool-option-icon{display:grid;width:32px;height:32px;flex:0 0 32px;border-radius:9px;background:hsl(var(--muted) / .75);color:hsl(var(--foreground) / .78);place-items:center}.session-tool-option-icon svg{width:17px;height:17px}.session-tool-option-copy,.session-skill-option-copy{display:flex;min-width:0;flex:1;flex-direction:column}.session-tool-option-copy{gap:2px}.session-tool-option-copy strong,.session-skill-option-copy strong{overflow:hidden;color:hsl(var(--foreground));font-size:12.5px;font-weight:620;text-overflow:ellipsis;white-space:nowrap}.session-skill-option-copy strong{font-family:-apple-system,BlinkMacSystemFont,Segoe UI,sans-serif}.session-tool-option-copy code{color:hsl(var(--muted-foreground));font-family:ui-monospace,SFMono-Regular,Menlo,Consolas,monospace;font-size:10px}.session-tool-option-copy>span,.session-skill-option-copy>span{display:-webkit-box;overflow:hidden;color:hsl(var(--muted-foreground));font-size:11px;line-height:1.35;-webkit-box-orient:vertical;-webkit-line-clamp:2}.session-tool-option>button,.session-skill-option>button{display:inline-flex;min-width:58px;height:30px;padding:0 10px;flex:0 0 auto;align-items:center;justify-content:center;gap:4px;border:0;border-radius:8px;background:hsl(var(--foreground));color:hsl(var(--background));font:inherit;font-size:11px;font-weight:600;cursor:pointer}.session-tool-option>button:disabled,.session-skill-option>button:disabled{opacity:.42;cursor:default}.session-skill-option>button svg{width:13px;height:13px}.session-skill-dialog-body{display:flex;min-height:0;flex:1;flex-direction:column}.session-skill-source-tabs{display:flex;min-height:48px;padding:0 18px;align-items:stretch;gap:24px;border-bottom:1px solid hsl(var(--border))}.session-skill-source-tabs button{position:relative;display:inline-flex;padding:0 2px;align-items:center;gap:7px;border:0;background:transparent;color:hsl(var(--muted-foreground));font:inherit;font-size:12.5px;font-weight:600;cursor:pointer}.session-skill-source-tabs button:after{content:"";position:absolute;right:0;bottom:-1px;left:0;height:2px;border-radius:2px 2px 0 0;background:transparent}.session-skill-source-tabs button:hover,.session-skill-source-tabs button.is-active{color:hsl(var(--foreground))}.session-skill-source-tabs button.is-active:after{background:hsl(var(--foreground))}.session-skill-source-tabs button>span{display:inline-flex;height:18px;padding:0 6px;align-items:center;border-radius:5px;background:hsl(var(--muted));color:hsl(var(--muted-foreground));font-size:9.5px;font-weight:600}.session-public-skill-browser{display:flex;min-height:0;height:min(548px,calc(100vh - 204px));flex:1;flex-direction:column}.session-public-skill-head{display:flex;min-height:68px;padding:13px 16px;align-items:center;gap:12px}.session-public-skill-head .session-capability-search{flex:1}.session-public-skill-head>span{flex:0 0 auto;color:hsl(var(--muted-foreground));font-size:10.5px}.session-public-skill-list{display:grid;min-height:0;padding:12px;overflow-y:auto;flex:1;grid-template-columns:repeat(2,minmax(0,1fr));align-content:start;gap:8px;overscroll-behavior:contain}.session-public-skill-list>.session-capability-empty,.session-public-skill-list>.session-capability-loading,.session-public-skill-list>.session-capability-error{grid-column:1 / -1}.session-public-skill-option{min-height:106px;padding:11px}.session-public-skill-option .session-skill-option-copy small{overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.session-skill-browser{display:grid;min-height:0;height:min(548px,calc(100vh - 204px));flex:1;grid-template-columns:minmax(260px,.8fr) minmax(360px,1.4fr)}.session-skill-spaces,.session-skill-results{display:flex;min-width:0;min-height:0;flex-direction:column}.session-skill-spaces{border-right:1px solid hsl(var(--border));background:hsl(var(--muted) / .16)}.session-skill-pane-head{display:flex;min-height:92px;padding:13px 14px;flex-direction:column;gap:10px}.session-skill-pane-head>div{display:flex;min-width:0;align-items:center;gap:7px}.session-skill-pane-head strong{overflow:hidden;color:hsl(var(--foreground));font-size:12.5px;font-weight:650;text-overflow:ellipsis;white-space:nowrap}.session-skill-pane-head>div>span{display:inline-flex;min-width:19px;height:18px;padding:0 5px;align-items:center;justify-content:center;border-radius:999px;background:hsl(var(--muted));color:hsl(var(--muted-foreground));font-size:10px}.session-skill-pane-list{display:flex;min-height:0;padding:10px;overflow-y:auto;flex:1;flex-direction:column;gap:7px;overscroll-behavior:contain}.session-skill-space{display:flex;width:100%;min-height:76px;padding:10px;align-items:flex-start;gap:9px;border:1px solid transparent;border-radius:10px;background:transparent;color:hsl(var(--foreground));font:inherit;text-align:left;cursor:pointer}.session-skill-space:hover{background:hsl(var(--background) / .72)}.session-skill-space.is-active{border-color:hsl(var(--primary) / .28);background:hsl(var(--background));box-shadow:0 1px 3px hsl(var(--foreground) / .06)}.session-skill-space>span:last-child{display:flex;min-width:0;flex:1;flex-direction:column;gap:3px}.session-skill-space strong,.session-skill-space small{overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.session-skill-space strong{font-size:12px;font-weight:620}.session-skill-space small{color:hsl(var(--muted-foreground));font-size:10.5px}.session-skill-space em{color:hsl(var(--muted-foreground));font-size:10px;font-style:normal}.session-skill-option{min-height:82px;padding:11px}.session-skill-option-copy{gap:4px}.session-skill-option-copy small{color:hsl(var(--muted-foreground) / .84);font-size:9.5px}.session-capability-empty,.session-capability-loading,.session-capability-error{display:flex;min-height:120px;align-items:center;justify-content:center;color:hsl(var(--muted-foreground));font-size:12px;text-align:center}.session-capability-error{color:hsl(var(--destructive))}@media (max-width: 720px){.session-capability-dialog-layer{padding:12px}.session-capability-dialog.is-wide{width:calc(100vw - 24px);height:calc(100dvh - 24px)}.session-skill-browser{height:min(620px,calc(100vh - 170px));grid-template-columns:1fr;grid-template-rows:minmax(180px,.75fr) minmax(260px,1.25fr)}.session-public-skill-browser{height:min(620px,calc(100vh - 170px))}.session-public-skill-list{grid-template-columns:1fr}.session-skill-spaces{border-right:0;border-bottom:1px solid hsl(var(--border))}}@media (prefers-reduced-motion: reduce){.session-capability-dialog{animation:none}}.drawer--agent-info{right:auto;left:0;width:min(400px,92vw);border-right:1px solid hsl(var(--border));border-left:0;box-shadow:12px 0 40px hsl(var(--foreground) / .14);animation:agent-info-slide-in .22s cubic-bezier(.22,1,.36,1)}.agent-info-drawer-body{flex:1;min-height:0;overflow-y:auto;overscroll-behavior:contain}@keyframes agent-info-slide-in{0%{transform:translate(-100%)}to{transform:translate(0)}}@media (prefers-reduced-motion: reduce){.drawer--agent-info,.agent-info-scrim{animation: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-DL82BF0-.css b/veadk/webui/assets/index-DL82BF0-.css deleted file mode 100644 index 91492351..00000000 --- a/veadk/webui/assets/index-DL82BF0-.css +++ /dev/null @@ -1,10 +0,0 @@ -.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}}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}.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))}.abc-root{--cw-workbench-toolbar-height: 64px;--cw-workspace-ink: 222 24% 13%;--cw-workspace-accent: 162 44% 32%;--cw-workspace-accent-soft: 156 34% 92%;--cw-workspace-warm: 42 28% 96%;flex:0 1 52%;min-width:460px;min-height:0;display:flex;flex-direction:column;overflow:hidden;border-right:0;background:#fff}.abc-canvas{flex:1;min-height:0;background:#fff}.abc-canvas .react-flow__pane{cursor:grab}.abc-canvas .react-flow__pane:active{cursor:grabbing}.abc-node{--abc-type-tone: 220 9% 24%;--abc-type-soft: 220 10% 97%;--abc-type-border: 220 9% 78%;position:relative;width:220px;height:88px;display:grid;grid-template-columns:38px minmax(0,1fr);align-items:center;gap:9px;padding:12px 14px;border:1px solid hsl(var(--abc-type-border));border-radius:13px;background:hsl(var(--panel));box-shadow:0 10px 30px hsl(var(--foreground) / .055);color:hsl(var(--foreground));transition:border-color .15s ease,box-shadow .15s ease,transform .15s ease}.abc-node:hover{border-color:hsl(var(--abc-type-tone) / .48);box-shadow:0 13px 34px hsl(var(--foreground) / .08)}.abc-node.is-selected{border-color:hsl(var(--abc-type-tone) / .86);box-shadow:0 0 0 3px hsl(var(--abc-type-tone) / .1),0 14px 38px hsl(var(--foreground) / .09)}.abc-node.is-llm{grid-template-columns:minmax(0,1fr);background:hsl(var(--panel))}.abc-node.is-a2a{--abc-type-tone: 213 18% 38%;--abc-type-soft: 214 20% 94%;--abc-type-border: 213 15% 72%;background:linear-gradient(145deg,hsl(var(--abc-type-soft)),hsl(var(--panel)) 58%)}.abc-canvas .react-flow__node-group{padding:0;border:0;border-radius:18px;background:transparent}.abc-group{--abc-type-tone: 213 40% 40%;--abc-type-soft: 214 45% 96%;--abc-type-border: 213 32% 62%;position:relative;width:100%;height:100%;box-sizing:border-box;overflow:hidden;border:1.5px solid hsl(var(--abc-type-border) / .72);border-radius:18px;background:linear-gradient(180deg,hsl(var(--abc-type-soft) / .88),transparent 88px),hsl(var(--panel) / .72);box-shadow:0 14px 42px hsl(var(--foreground) / .055);transition:border-color .15s ease,box-shadow .15s ease}.abc-group.is-selected{border-color:hsl(var(--abc-type-tone) / .86);box-shadow:0 0 0 4px hsl(var(--abc-type-tone) / .1),0 16px 46px hsl(var(--foreground) / .08)}.abc-group.is-parallel{--abc-type-tone: 40 43% 38%;--abc-type-soft: 43 52% 94%;--abc-type-border: 40 38% 58%;border-style:solid}.abc-group.is-sequential{--abc-type-tone: 213 40% 40%;--abc-type-soft: 214 45% 96%;--abc-type-border: 213 32% 62%}.abc-group.is-llm{--abc-type-tone: 220 9% 24%;--abc-type-soft: 220 10% 97%;--abc-type-border: 220 9% 66%}.abc-group.is-loop{--abc-type-tone: 151 34% 34%;--abc-type-soft: 148 32% 94%;--abc-type-border: 151 28% 55%}.abc-group-head{position:relative;height:64px;display:flex;align-items:center;justify-content:center;padding:10px 132px 10px 72px;border-bottom:1px solid hsl(var(--border) / .75)}.abc-group-head>span:first-child{min-width:0;display:flex;flex-direction:column;align-items:center;gap:2px;text-align:center}.abc-group-head strong{color:hsl(var(--abc-type-tone));font-size:13px;letter-spacing:-.02em}.abc-group-head small{overflow:hidden;color:hsl(var(--muted-foreground));font-size:9.5px;text-overflow:ellipsis;white-space:nowrap}.abc-group-head em{position:absolute;top:12px;right:22px;padding:3px 7px;border-radius:999px;background:hsl(var(--background) / .82);color:hsl(var(--muted-foreground));font-size:9px;font-style:normal;font-weight:600;white-space:nowrap}.abc-group-add{height:40px;display:flex;align-items:center;justify-content:center;gap:7px;border:1px dashed hsl(var(--abc-type-tone) / .42);border-radius:10px;background:hsl(var(--background) / .58);color:hsl(var(--muted-foreground));cursor:pointer;font:inherit;font-size:10px;font-weight:600;transition:border-color .15s ease,background-color .15s ease,color .15s ease}.abc-group-boundary-actions{position:absolute;top:64px;right:0;bottom:0;left:0;z-index:2;pointer-events:none}.abc-group-boundary-add{position:absolute;top:50%;width:28px;height:28px;display:inline-flex;align-items:center;justify-content:center;padding:0;border:1px solid hsl(var(--abc-type-tone) / .32);border-radius:50%;background:hsl(var(--background) / .94);box-shadow:0 6px 18px hsl(var(--foreground) / .08);color:hsl(var(--abc-type-tone));cursor:pointer;opacity:.72;pointer-events:auto;transform:translateY(-50%);transition:border-color .15s ease,background-color .15s ease,box-shadow .15s ease,opacity .15s ease}.abc-group-boundary-add.is-start{left:18px}.abc-group-boundary-add.is-end{right:18px}.abc-root.is-vertical .abc-group-boundary-actions{top:64px;right:0;bottom:0;left:0}.abc-root.is-vertical .abc-group-boundary-add{left:50%;transform:translate(-50%)}.abc-root.is-vertical .abc-group-boundary-add.is-start{top:18px}.abc-root.is-vertical .abc-group-boundary-add.is-end{top:auto;right:auto;bottom:18px}.abc-group-boundary-add:hover{border-color:hsl(var(--abc-type-tone) / .64);background:hsl(var(--abc-type-soft) / .92);box-shadow:0 8px 22px hsl(var(--foreground) / .1);opacity:1}.abc-group-boundary-add:focus-visible{outline:2px solid hsl(var(--abc-type-tone) / .5);outline-offset:2px;opacity:1}.abc-group-boundary-add svg{width:14px;height:14px}.abc-group-add-empty,.abc-group-add-bottom{position:absolute;right:24px;bottom:24px;left:24px}.abc-group-add:hover{border-color:hsl(var(--abc-type-tone) / .72);background:hsl(var(--abc-type-soft) / .86);color:hsl(var(--abc-type-tone))}.abc-group-add:focus-visible{outline:2px solid hsl(var(--abc-type-tone) / .5);outline-offset:2px}.abc-group-add svg{width:14px;height:14px}.abc-node.is-contained-in-parallel .abc-handle{opacity:0}.abc-node-icon{width:38px;height:38px;display:inline-flex;align-items:center;justify-content:center;border-radius:10px;background:hsl(var(--abc-type-soft));color:hsl(var(--abc-type-tone))}.abc-node-icon svg{width:17px;height:17px}.abc-node-copy{min-width:0;display:flex;flex-direction:column;gap:2px;padding-right:18px}.abc-node-delete{position:absolute;z-index:3;top:7px;right:7px;width:24px;height:24px;display:inline-flex;align-items:center;justify-content:center;padding:0;border:1px solid hsl(var(--border));border-radius:7px;background:hsl(var(--panel) / .96);box-shadow:0 4px 12px hsl(var(--foreground) / .08);color:hsl(var(--muted-foreground));cursor:pointer;opacity:0;pointer-events:none;transform:translateY(-2px) scale(.92);transition:opacity .12s ease,transform .12s ease,border-color .12s ease,color .12s ease}.abc-node:hover>.abc-node-delete,.abc-node:focus-within>.abc-node-delete,.abc-group:hover>.abc-node-delete,.abc-group:focus-within>.abc-node-delete,.abc-node-delete:focus-visible{opacity:1;pointer-events:auto;transform:translateY(0) scale(1)}.abc-node-delete:hover{border-color:hsl(var(--destructive) / .32);color:hsl(var(--destructive))}.abc-node-delete:focus-visible{outline:2px solid hsl(var(--destructive) / .34);outline-offset:2px}.abc-node-delete svg{width:12px;height:12px}.abc-group>.abc-node-delete{top:19px;right:12px}.abc-group>.abc-node-delete+.abc-handle{z-index:4}.abc-group:has(>.abc-node-delete) .abc-group-head em{right:48px}.abc-loop-handle{left:50%!important;opacity:0;pointer-events:none}.abc-node-meta{display:flex;align-items:center;justify-content:space-between;gap:8px;color:hsl(var(--abc-type-tone));font-size:9px;font-weight:700;letter-spacing:.04em}.abc-node-meta small{color:hsl(var(--muted-foreground));font-size:8.5px;font-weight:550;letter-spacing:0}.abc-node-copy>strong{overflow:hidden;font-size:13px;letter-spacing:-.015em;text-overflow:ellipsis;white-space:nowrap}.abc-node-copy>small{display:-webkit-box;overflow:hidden;color:hsl(var(--muted-foreground));font-size:9.5px;line-height:1.35;-webkit-box-orient:vertical;-webkit-line-clamp:2}.abc-terminal{width:96px;height:34px;display:flex;align-items:center;justify-content:center;border:1px solid hsl(var(--border) / .82);border-radius:999px;background:hsl(var(--secondary) / .68);box-shadow:none;color:hsl(var(--foreground) / .76);font-size:10.5px;font-weight:650;letter-spacing:.03em}.abc-handle{width:7px!important;height:7px!important;border:2px solid hsl(var(--background))!important;background:#585e6a!important}.abc-group.is-sequential>.abc-handle{background:#3d628f!important}.abc-group.is-parallel>.abc-handle{background:#8b6f37!important}.abc-group.is-loop>.abc-handle,.abc-node.is-contained-in-loop .abc-loop-handle{background:#397458!important}.abc-canvas .react-flow__edge-path{transition:stroke-width .12s ease}.abc-canvas .react-flow__edge:hover .react-flow__edge-path{stroke-width:2.2}.abc-edge-tools{position:absolute;z-index:1002;display:inline-flex;align-items:center;justify-content:center;gap:3px;padding:0;border-radius:999px;pointer-events:all}.abc-canvas .react-flow__edgelabel-renderer{z-index:1002}.abc-edge-hover-path{fill:none;stroke:transparent;stroke-width:22px;pointer-events:stroke}.abc-edge-label{position:absolute;bottom:calc(100% + 1px);left:50%;padding:2px 5px;border-radius:5px;background:hsl(var(--background) / .92);color:hsl(var(--muted-foreground));font-size:10px;font-weight:600;transform:translate(-50%);white-space:nowrap}.abc-edge-add{width:24px;height:24px;display:inline-flex;align-items:center;justify-content:center;padding:0;border:1px solid hsl(var(--cw-workspace-accent) / .28);border-radius:50%;background:hsl(var(--background));box-shadow:0 4px 12px hsl(var(--foreground) / .1);color:hsl(var(--cw-workspace-accent));cursor:pointer;opacity:0;transform:scale(.82);transition:opacity .14s ease,transform .14s ease,border-color .14s ease}.abc-edge-tools.is-visible .abc-edge-add,.abc-edge-tools:hover .abc-edge-add,.abc-edge-add:focus-visible{border-color:hsl(var(--cw-workspace-accent) / .68);opacity:1;transform:scale(1)}.abc-edge-add:focus-visible{outline:2px solid hsl(var(--cw-workspace-accent) / .5);outline-offset:2px}.abc-edge-add svg{width:11px;height:11px}@media (hover: none){.abc-edge-add{opacity:.88;transform:scale(1)}.abc-node-delete{opacity:1;pointer-events:auto;transform:none}}@media (prefers-reduced-motion: reduce){.abc-node-delete,.abc-edge-add{transition:none}}.abc-canvas .react-flow__controls{overflow:hidden;border:1px solid hsl(var(--border));border-radius:9px;box-shadow:0 8px 24px hsl(var(--foreground) / .08)}.abc-canvas .react-flow__controls-button{border-bottom-color:hsl(var(--border));background:hsl(var(--panel));color:hsl(var(--foreground))}.abc-minimap{width:168px!important;height:104px!important;overflow:hidden;border:1px solid hsl(var(--border));border-radius:9px;background:hsl(var(--panel))!important;box-shadow:0 8px 24px hsl(var(--foreground) / .06)}.abc-minimap-node .abc-minimap-shell,.abc-minimap-node .abc-minimap-icon-mark,.abc-minimap-node .abc-minimap-group-divider{vector-effect:non-scaling-stroke}.abc-minimap-node-agent .abc-minimap-shell{fill:hsl(var(--panel));stroke:#585e6ab8;stroke-width:1.4px}.abc-minimap-node-agent.is-a2a .abc-minimap-shell{fill:#f0f5fa;stroke:#4788aec7}.abc-minimap-agent-icon{fill:#edeff3}.abc-minimap-node-agent.is-a2a .abc-minimap-agent-icon{fill:#dae9f1}.abc-minimap-icon-mark{fill:none;stroke:#4f5f72;stroke-width:1.25px}.abc-minimap-icon-eye{fill:#4f5f72}.abc-minimap-copy-line{fill:hsl(var(--muted-foreground) / .34)}.abc-minimap-copy-line.is-primary{fill:hsl(var(--foreground) / .7)}.abc-minimap-node-terminal .abc-minimap-shell{fill:hsl(var(--cw-workspace-ink));stroke:hsl(var(--panel));stroke-width:1.5px;vector-effect:non-scaling-stroke}.abc-minimap-terminal-dot{fill:hsl(var(--panel) / .82)}.abc-minimap-node-group .abc-minimap-shell{fill:hsl(var(--panel) / .32);stroke:#3d628fc7;stroke-width:1.5px}.abc-minimap-node-group.is-parallel .abc-minimap-shell{stroke:#8b6f37d1}.abc-minimap-node-group.is-sequential .abc-minimap-shell{stroke:#3d628fd1}.abc-minimap-node-group.is-llm .abc-minimap-shell{stroke:#585e6ac7}.abc-minimap-node-group.is-loop .abc-minimap-shell{stroke:#397458d6}.abc-minimap-group-divider{stroke:hsl(var(--border));stroke-width:1px}.abc-minimap-group-title{fill:hsl(var(--muted-foreground) / .42)}.abc-minimap-node.is-selected .abc-minimap-shell{stroke-width:2.5px}.abc-minimap-node-agent.is-selected .abc-minimap-shell{stroke:#2e3138}.abc-minimap-node-group.is-sequential.is-selected .abc-minimap-shell{stroke:#314e72}.abc-minimap-node-group.is-parallel.is-selected .abc-minimap-shell{stroke:#6d572c}.abc-minimap-node-group.is-loop.is-selected .abc-minimap-shell{stroke:#2d5c46}@media (max-width: 1080px){.abc-root{min-width:360px}}@media (max-width: 860px){.abc-root{flex:none;width:100%;min-width:0;height:480px;border-right:0;border-bottom:0}.abc-minimap{display:none}}@media (max-width: 520px){.abc-root{height:430px}}.aw-root{flex:1;min-width:0;min-height:0;display:flex;flex-direction:column;overflow:hidden;background:hsl(var(--background));color:hsl(var(--foreground))}.aw-agent-head h2,.aw-eval-head h2,.aw-section-head h3{margin:0;color:hsl(var(--foreground));letter-spacing:-.025em}.aw-agent-head p,.aw-eval-head p,.aw-section-head p{margin:4px 0 0;color:hsl(var(--muted-foreground));font-size:12.5px;line-height:1.5}.aw-view-tabs,.aw-agent-title-row,.aw-card-head,.aw-section-head,.aw-case-filters,.aw-eval-head{display:flex;align-items:center}.aw-view-tabs{flex:0 0 auto;gap:26px;padding:0 24px;border-bottom:1px solid hsl(var(--border))}.aw-view-tabs button,.aw-case-filters button{border:0;background:transparent;color:hsl(var(--muted-foreground));cursor:pointer;font:inherit;transition:background .16s ease,box-shadow .16s ease,color .16s ease}.aw-view-tabs button{position:relative;min-height:44px;padding:0;font-size:14px;font-weight:580}.aw-view-tabs button.is-active{color:hsl(var(--foreground))}.aw-view-tabs button.is-active:after{content:"";position:absolute;right:0;bottom:0;left:0;height:2px;border-radius:999px;background:hsl(var(--foreground))}.aw-run{display:inline-flex;align-items:center;justify-content:center;gap:7px;border:0;background:hsl(var(--foreground));color:hsl(var(--background));cursor:pointer;font:inherit;font-size:12.5px;font-weight:650;transition:opacity .16s ease,transform .16s ease}.aw-run:not(:disabled):hover{transform:translateY(-1px)}.aw-root button:focus-visible,.aw-root input:focus-visible,.aw-root textarea:focus-visible,.aw-root select:focus-visible{outline:2px solid hsl(var(--ring) / .55);outline-offset:2px}.aw-run svg{width:15px;height:15px}.aw-run:disabled,.aw-create-card:disabled{cursor:default;opacity:.42}.aw-workspace-frame{flex:1;min-height:0;position:relative}.aw-workspace{width:100%;height:100%;min-height:0;display:grid;grid-template-columns:304px minmax(0,1fr)}.aw-sidebar{min-width:0;min-height:0;display:flex;flex-direction:column;padding:18px 12px 22px 24px}.aw-search{height:40px;min-height:40px;flex:0 0 40px;box-sizing:border-box;display:flex;align-items:center;gap:9px;padding:0 12px;border:1px solid hsl(var(--foreground) / .12);border-radius:10px;background:transparent;transition:border-color .16s ease,background-color .16s ease}.aw-search:focus-within{border-color:hsl(var(--foreground) / .16);background:hsl(var(--secondary) / .42);box-shadow:none}.aw-search svg{width:15px;height:15px;color:hsl(var(--muted-foreground))}.aw-search input{width:100%;min-width:0;border:0;outline:0;background:transparent;color:hsl(var(--foreground));font:inherit;font-size:12.5px;line-height:1}.aw-search input::placeholder{color:hsl(var(--muted-foreground) / .82)}.aw-search input:focus,.aw-search input:focus-visible,.aw-case-search input:focus,.aw-case-search input:focus-visible{outline:none!important;box-shadow:none}.aw-agent-list{flex:1 1 auto;min-height:0;display:flex;flex-direction:column;gap:10px;margin-top:14px;overflow-y:auto}.aw-delete-error{margin-top:8px;padding:8px 10px;border-radius:8px;background:hsl(var(--destructive) / .08);color:hsl(var(--destructive));font-size:12px;line-height:1.45}.aw-agent-item,.aw-agent-check{width:100%;min-height:72px;box-sizing:border-box;display:flex;align-items:center;gap:9px;padding:13px 14px;border:1px solid hsl(var(--foreground) / .1);border-radius:14px;background:transparent;color:hsl(var(--foreground));cursor:pointer;font:inherit;text-align:left;transition:background .16s ease,border-color .16s ease}.aw-agent-item:hover,.aw-agent-check:hover{border-color:hsl(var(--foreground) / .18);background:hsl(var(--secondary) / .42)}.aw-agent-item.is-active{border-color:hsl(var(--foreground) / .42);background:hsl(var(--secondary) / .28)}.aw-agent-item[draggable=true]{cursor:grab}.aw-agent-item[draggable=true]:active{cursor:grabbing}.aw-agent-item.is-dragging{opacity:.46}.aw-agent-item.is-drop-target{border-color:hsl(var(--foreground) / .46);background:hsl(var(--secondary) / .54)}.aw-agent-item.is-drop-before{box-shadow:inset 0 2px hsl(var(--foreground) / .44)}.aw-agent-item.is-drop-after{box-shadow:inset 0 -2px hsl(var(--foreground) / .44)}.aw-agent-copy{min-width:0;display:flex;flex:1;flex-direction:column;gap:6px}.aw-agent-name-row{min-width:0;display:flex;align-items:center;gap:8px}.aw-agent-name-row>strong{min-width:0;flex:1}.aw-version-badge{flex:0 0 auto;padding:2px 6px;border:1px solid hsl(var(--border));border-radius:999px;background:hsl(var(--secondary) / .5);color:hsl(var(--muted-foreground));font-size:10px;font-weight:650;line-height:1.2}.aw-draft-badge{flex:0 0 auto;padding:2px 7px;border-radius:999px;background:#f0ebe0;color:#675332;font-size:10px;font-weight:680;line-height:1.2}.aw-draft-badge.is-deploying{background:#e4eaf2;color:#2d5080}.aw-draft-badge.is-error{background:#dc28281f;color:hsl(var(--destructive))}.aw-draft-badge.is-muted{background:hsl(var(--muted));color:hsl(var(--muted-foreground))}.aw-agent-copy strong,.aw-agent-copy small{overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.aw-agent-copy strong{font-size:13px;font-weight:650}.aw-agent-copy small{color:hsl(var(--muted-foreground));font-size:11px}.aw-agent-item>svg{width:14px;height:14px;color:hsl(var(--muted-foreground));opacity:0;transition:opacity .14s ease,transform .14s ease}.aw-agent-item:hover>svg,.aw-agent-item.is-active>svg{opacity:1}.aw-agent-item:hover>svg{transform:translate(2px)}.aw-agent-check{position:relative}.aw-agent-check>input{position:absolute;width:1px;height:1px;opacity:0}.aw-check-mark{width:17px;height:17px;flex:0 0 17px;display:inline-flex;align-items:center;justify-content:center;border:1px solid hsl(var(--foreground) / .22);border-radius:5px;background:hsl(var(--background));color:transparent}.aw-check-mark svg{width:11px;height:11px}.aw-agent-check:has(input:checked) .aw-check-mark{border-color:hsl(var(--foreground));background:hsl(var(--foreground));color:hsl(var(--background))}.aw-agent-check:has(input:focus-visible){outline:2px solid hsl(var(--ring) / .42);outline-offset:-2px}.aw-list-empty{min-height:0;flex:1 1 auto;display:flex;align-items:center;justify-content:center;padding:28px 12px;color:hsl(var(--muted-foreground));font-size:12px;text-align:center}.aw-list-error{display:flex;flex-direction:column;align-items:center;gap:10px}.aw-list-error button{min-height:30px;padding:0 12px;border:1px solid hsl(var(--border));border-radius:999px;background:transparent;color:hsl(var(--foreground));cursor:pointer;font:inherit;font-size:11.5px}.aw-create-card{width:100%;min-height:48px;flex:0 0 auto;display:inline-flex;align-items:center;justify-content:center;gap:8px;margin-top:12px;border:1px dashed hsl(var(--foreground) / .28);border-radius:14px;background:transparent;color:hsl(var(--muted-foreground));cursor:pointer;font:inherit;font-size:12.5px;font-weight:600;transition:border-color .16s ease,color .16s ease}.aw-create-card:hover:not(:disabled){border-color:hsl(var(--foreground) / .5);color:hsl(var(--foreground))}.aw-create-card svg{width:15px;height:15px}.aw-list-count{flex:0 0 auto;padding-top:10px;color:hsl(var(--muted-foreground));font-size:10.5px;text-align:center}.aw-main{position:relative;min-width:0;min-height:0;display:flex;flex-direction:column;overflow:hidden;background:hsl(var(--background))}.aw-empty-selection{align-items:center;justify-content:center}.aw-empty-selection p{margin:0;color:hsl(var(--muted-foreground));font-size:13px}.aw-agent-head{flex:0 0 auto;min-height:72px;box-sizing:border-box;display:flex;align-items:center;justify-content:space-between;gap:18px;padding:14px 24px}.aw-agent-head>div{min-width:0;display:flex;flex-direction:column;justify-content:center}.aw-head-delete.studio-update-action{border:1px solid hsl(var(--destructive) / .34);background:#ffffffc2;color:hsl(var(--destructive));-webkit-backdrop-filter:blur(7px);backdrop-filter:blur(7px)}.aw-head-delete.studio-update-action:hover:not(:disabled){border:1px solid hsl(var(--destructive));background:hsl(var(--destructive));color:hsl(var(--destructive-foreground))}.aw-head-delete svg{width:14px;height:14px}.aw-agent-title-row{gap:8px}.aw-agent-head h2,.aw-eval-head h2{overflow:hidden;font-size:18px;font-weight:720;text-overflow:ellipsis;white-space:nowrap}.aw-agent-title-row>span,.aw-eval-head>div>span{padding:2px 7px;border-radius:999px;background:hsl(var(--secondary));color:hsl(var(--muted-foreground));font-size:10.5px}.aw-agent-head p{max-width:720px;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.aw-update{align-self:center}.aw-agent-tabs{flex:0 0 auto;display:flex;gap:24px;margin:0 24px;padding:0;border-bottom:1px solid hsl(var(--border))}.aw-agent-tabs button{position:relative;min-height:42px;padding:0;border:0;background:transparent;color:hsl(var(--muted-foreground));cursor:pointer;font:inherit;font-size:12.5px;font-weight:580}.aw-agent-tabs button.is-active{color:hsl(var(--foreground))}.aw-agent-tabs button.is-active:after{content:"";position:absolute;right:0;bottom:-1px;left:0;height:2px;border-radius:2px 2px 0 0;background:hsl(var(--foreground))}.aw-agent-tabs button:disabled{cursor:default}.aw-content{flex:1;min-height:0;overflow-y:auto;margin-top:12px;padding:0 24px 80px}.aw-basic-stack{display:flex;flex-direction:column;gap:16px}.aw-canvas-card,.aw-details-card{min-width:0;border:1px solid hsl(var(--border));border-radius:14px;background:hsl(var(--panel))}.aw-canvas-card,.aw-details-card{overflow:hidden}.aw-deploy-progress-card{width:100%;min-width:0;box-sizing:border-box;padding:24px 26px 26px;border:1px solid hsl(var(--border));border-radius:18px;background:hsl(var(--panel))}.aw-deployment-focus{min-height:0;display:flex;align-items:center;justify-content:center;overflow-y:auto;padding:32px}.aw-deployment-focus .aw-deploy-progress-card{max-width:720px;margin:auto}.aw-deploy-progress-head,.aw-deploy-progress-head>div,.aw-deploy-progress-icon{display:flex;align-items:center}.aw-deploy-progress-head{justify-content:space-between;gap:20px}.aw-deploy-progress-head>div{min-width:0;gap:12px}.aw-deploy-progress-head>div>div{min-width:0}.aw-deploy-progress-icon{width:34px;height:34px;flex:0 0 34px;justify-content:center;border-radius:50%;background:#eaeff5;color:#295189}.aw-deploy-progress-icon svg{width:17px;height:17px}.aw-deploy-progress-card.is-success .aw-deploy-progress-icon{background:#e8f2ee;color:#2d7656}.aw-deploy-progress-card.is-error .aw-deploy-progress-icon,.aw-deploy-progress-card.is-cancelled .aw-deploy-progress-icon{background:#f5ecea;color:#8d3d34}.aw-deploy-progress-head h3{margin:0;font-size:14px;font-weight:700}.aw-deploy-progress-head p{margin:3px 0 0;color:hsl(var(--muted-foreground));font-size:12px;line-height:1.45;overflow-wrap:anywhere}.aw-deploy-progress-head>strong{flex:0 0 auto;color:hsl(var(--muted-foreground));font-size:12px;font-weight:650}.aw-deploy-progress-track{height:5px;margin-top:18px;overflow:hidden;border-radius:999px;background:hsl(var(--secondary))}.aw-deploy-progress-track span{display:block;height:100%;border-radius:inherit;background:#295189;transition:width .32s cubic-bezier(.22,1,.36,1)}.aw-deploy-progress-card.is-success .aw-deploy-progress-track span{background:#2d7656}.aw-deploy-progress-card.is-error .aw-deploy-progress-track span,.aw-deploy-progress-card.is-cancelled .aw-deploy-progress-track span{background:#8d3d34}.aw-deploy-steps{margin:22px 0 0;padding:0;list-style:none}.aw-deploy-steps li{position:relative;min-width:0;display:grid;grid-template-columns:28px minmax(0,1fr);gap:12px;padding:0 0 18px}.aw-deploy-steps li:last-child{padding-bottom:0}.aw-deploy-steps li:not(:last-child):after{content:"";position:absolute;top:28px;bottom:0;left:13px;width:2px;border-radius:999px;background:hsl(var(--border))}.aw-deploy-steps li.is-done:not(:last-child):after{background:#9dcdb8}.aw-deploy-step-marker{position:relative;z-index:1;width:28px;height:28px;display:inline-flex;align-items:center;justify-content:center;box-sizing:border-box;border:1px solid hsl(var(--border));border-radius:50%;background:hsl(var(--panel));color:hsl(var(--muted-foreground));font-size:10.5px;font-weight:680}.aw-deploy-step-marker svg{width:14px;height:14px}.aw-deploy-steps li.is-done .aw-deploy-step-marker{border-color:#b3dbca;background:#e8f2ee;color:#2d7656}.aw-deploy-steps li.is-active .aw-deploy-step-marker{border-color:#9eb3d1;background:#eaeff5;color:#295189}.aw-deploy-steps li.is-failed .aw-deploy-step-marker{border-color:#dcbfbc;background:#f5ecea;color:#8d3d34}.aw-deploy-step-copy{min-width:0;padding-top:2px}.aw-deploy-step-copy strong{display:block;color:hsl(var(--muted-foreground));font-size:12.5px;font-weight:620;line-height:1.4}.aw-deploy-step-copy p{min-width:0;margin:3px 0 0;color:hsl(var(--muted-foreground));font-size:11.5px;line-height:1.55;overflow-wrap:anywhere;word-break:break-word}.aw-deploy-steps li.is-done .aw-deploy-step-copy strong,.aw-deploy-steps li.is-active .aw-deploy-step-copy strong,.aw-deploy-steps li.is-failed .aw-deploy-step-copy strong{color:hsl(var(--foreground))}.aw-deploy-steps li.is-active .aw-deploy-step-copy p{color:hsl(var(--foreground) / .78)}.aw-card-head{justify-content:space-between;gap:12px;min-height:48px;padding:0 16px}.aw-card-head strong{font-size:13px;font-weight:680}.aw-card-head span{color:hsl(var(--muted-foreground));font-size:10.5px}.aw-canvas{height:220px;min-height:0;border-top:1px solid hsl(var(--border))}.aw-canvas .abc-root{width:100%;height:100%;min-width:0;min-height:0;border:0;background:#f9f8f5}.aw-canvas .abc-canvas{flex:1;min-height:0}.aw-canvas .react-flow__controls{transform:scale(.86);transform-origin:bottom left}.aw-facts{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));margin:0;padding:4px 16px 14px}.aw-facts>div{min-height:39px;display:grid;grid-template-columns:minmax(88px,.72fr) minmax(0,1.28fr);align-items:center;gap:12px;border-top:1px solid hsl(var(--border) / .72)}.aw-facts>div:nth-child(2n){padding-left:20px}.aw-facts>div:nth-child(odd){padding-right:20px}.aw-facts dt{color:hsl(var(--muted-foreground));font-size:11.5px}.aw-facts dd{min-width:0;margin:0;overflow:hidden;color:hsl(var(--foreground));font-size:12px;font-weight:600;text-align:right;text-overflow:ellipsis;white-space:nowrap}.aw-status-dot{width:6px;height:6px;display:inline-block;margin-right:6px;border-radius:50%;background:#358d67}.aw-section-head{justify-content:space-between;gap:18px;margin-bottom:16px}.aw-section-head h3{font-size:16px;font-weight:700}.aw-case-filters{width:fit-content;gap:3px;margin-bottom:14px;padding:3px;border-radius:8px;background:hsl(var(--secondary) / .62)}.aw-case-search{width:100%;height:38px;box-sizing:border-box;display:flex;align-items:center;gap:9px;margin-bottom:14px;padding:0 12px;border:1px solid hsl(var(--border));border-radius:10px;background:transparent;transition:border-color .16s ease,box-shadow .16s ease}.aw-case-search:focus-within{border-color:hsl(var(--foreground) / .32);box-shadow:0 0 0 3px hsl(var(--foreground) / .045)}.aw-case-search svg{width:15px;height:15px;color:hsl(var(--muted-foreground))}.aw-case-search input{width:100%;min-width:0;border:0;outline:0;background:transparent;color:hsl(var(--foreground));font:inherit;font-size:12px}.aw-case-search input::placeholder{color:hsl(var(--muted-foreground) / .8)}.aw-case-filters button{min-height:28px;padding:0 10px;border-radius:6px;font-size:11.5px}.aw-case-filters button.is-active{background:hsl(var(--background));color:hsl(var(--foreground));box-shadow:0 1px 2px hsl(var(--foreground) / .07)}.aw-case-table{overflow:hidden;border:1px solid hsl(var(--border));border-radius:12px}.aw-case-row{min-height:62px;display:grid;grid-template-columns:minmax(180px,.9fr) minmax(240px,1.25fr) 90px;align-items:center;gap:14px;padding:8px 14px;border-top:1px solid hsl(var(--border));font-size:12px}.aw-case-row:first-child{border-top:0}.aw-case-row-head{min-height:38px;background:hsl(var(--secondary) / .38);color:hsl(var(--muted-foreground));font-size:10.5px;font-weight:600}.aw-case-row strong,.aw-case-row p{min-width:0;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.aw-case-row strong{font-weight:600}.aw-case-row p{margin:0;color:hsl(var(--muted-foreground))}.aw-case-tag{width:fit-content;padding:3px 7px;border-radius:999px;font-size:10px;font-weight:650}.aw-case-tag{background:hsl(var(--secondary));color:hsl(var(--muted-foreground));font-weight:540}.aw-case-empty{min-height:116px;display:flex;align-items:center;justify-content:center;border-top:1px solid hsl(var(--border));color:hsl(var(--muted-foreground));font-size:12px}.aw-option-panel,.aw-deployment-panel{width:100%;box-sizing:border-box;margin:0}.aw-settings-card{padding:18px;border:1px solid hsl(var(--border));border-radius:14px}.aw-option-content{position:relative;overflow:hidden;border-radius:11px}.aw-option-list{display:flex;flex-direction:column;gap:10px}.aw-option-glass{position:absolute;top:0;right:0;bottom:0;left:0;z-index:1;display:flex;align-items:center;justify-content:center;background:linear-gradient(135deg,hsl(var(--background) / .68),hsl(var(--background) / .5));-webkit-backdrop-filter:blur(10px) saturate(88%);backdrop-filter:blur(10px) saturate(88%);color:hsl(var(--foreground) / .72);font-size:12.5px;font-weight:600;letter-spacing:.08em}.aw-option-list>label{min-height:66px;display:flex;align-items:center;gap:12px;padding:0 16px;border:1px solid hsl(var(--border));border-radius:11px;color:hsl(var(--muted-foreground));opacity:.68}.aw-option-list input{width:16px;height:16px}.aw-option-list label>span{min-width:0;display:flex;flex-direction:column;gap:4px}.aw-option-list strong{color:hsl(var(--foreground));font-size:12.5px}.aw-option-list small{font-size:11.5px;line-height:1.45}.aw-readonly-config{margin:0;display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:10px}.aw-readonly-config>div{min-width:0;padding:12px 14px;border-radius:10px;background:hsl(var(--secondary) / .42)}.aw-readonly-config dt{color:hsl(var(--muted-foreground));font-size:11px}.aw-readonly-config dd{margin:5px 0 0;color:hsl(var(--foreground));font-size:12px;font-weight:600}.aw-basic-actions{position:absolute;z-index:8;bottom:20px;left:50%;display:flex;align-items:center;justify-content:center;gap:10px;padding:0;border:0;border-radius:10px;background:transparent;box-shadow:none;transform:translate(-50%)}.aw-eval-head{flex:0 0 auto;min-height:72px;box-sizing:border-box;justify-content:space-between;gap:20px;padding:14px 24px}.aw-evaluation-glass{position:absolute;z-index:12;top:0;right:0;bottom:0;left:0;display:flex;align-items:center;justify-content:center;background:hsl(var(--background) / .44);color:hsl(var(--foreground));-webkit-backdrop-filter:blur(9px) saturate(118%);backdrop-filter:blur(9px) saturate(118%);transition:background .18s ease,backdrop-filter .18s ease}.aw-evaluation-glass:hover{background:hsl(var(--background) / .52);-webkit-backdrop-filter:blur(11px) saturate(125%);backdrop-filter:blur(11px) saturate(125%)}.aw-evaluation-glass span{padding:8px 13px;border:1px solid hsl(var(--border) / .82);border-radius:999px;background:hsl(var(--background) / .7);box-shadow:0 8px 24px hsl(var(--foreground) / .07);font-size:12.5px;font-weight:620;-webkit-backdrop-filter:blur(14px);backdrop-filter:blur(14px)}.aw-eval-head>div{min-width:0;display:flex;flex-direction:column;justify-content:center}.aw-run{min-height:38px;padding:0 14px;border-radius:9px}.aw-eval-setup{width:min(900px,100%);margin:0 auto;display:flex;flex-direction:column;gap:14px}.aw-eval-block{min-width:0;overflow:hidden;border:1px solid hsl(var(--border));border-radius:14px}.aw-eval-agent-grid{max-height:230px;display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:8px;overflow-y:auto;padding:0 16px 16px}.aw-eval-agent-grid>label{min-height:52px;display:flex;align-items:center;gap:10px;padding:0 12px;border:1px solid hsl(var(--border) / .82);border-radius:10px;cursor:pointer}.aw-eval-agent-grid input,.aw-metric-list input{width:15px;height:15px;accent-color:hsl(var(--foreground))}.aw-eval-agent-grid label>span{min-width:0;display:flex;flex-direction:column;gap:3px}.aw-eval-agent-grid strong,.aw-eval-agent-grid small{overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.aw-eval-agent-grid strong{font-size:12px;font-weight:620}.aw-eval-agent-grid small{color:hsl(var(--muted-foreground));font-size:10.5px}.aw-eval-setting-grid{display:grid;grid-template-columns:minmax(0,1.18fr) minmax(260px,.82fr);gap:14px}.aw-eval-fields{display:flex;flex-direction:column;gap:13px;padding:0 16px 16px}.aw-eval-fields label{min-height:36px;display:grid;grid-template-columns:72px minmax(0,1fr) auto;align-items:center;gap:10px}.aw-eval-fields label>span,.aw-eval-fields label>small{color:hsl(var(--muted-foreground));font-size:11px}.aw-eval-fields select{width:100%;height:34px;padding:0 10px;border:1px solid hsl(var(--border));border-radius:8px;background:hsl(var(--background));color:hsl(var(--foreground));font:inherit;font-size:11.5px}.aw-metric-list{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:8px;padding:0 16px 16px}.aw-metric-list label{min-height:40px;display:flex;align-items:center;gap:8px;padding:0 10px;border:1px solid hsl(var(--border) / .82);border-radius:9px;cursor:pointer;font-size:11.5px}.aw-eval-history{width:min(820px,100%);margin:0 auto}.aw-history-list{display:flex;flex-direction:column;gap:9px}.aw-history-list>button{width:100%;min-height:68px;display:grid;grid-template-columns:minmax(0,1fr) auto auto 16px;align-items:center;gap:16px;padding:10px 14px;border:1px solid hsl(var(--border));border-radius:11px;background:transparent;color:hsl(var(--foreground));cursor:pointer;font:inherit;text-align:left}.aw-history-list>button:hover{border-color:hsl(var(--foreground) / .2)}.aw-history-list>button>span:first-child,.aw-history-score{display:flex;flex-direction:column;gap:4px}.aw-history-list strong{font-size:12px}.aw-history-list small{color:hsl(var(--muted-foreground));font-size:10.5px}.aw-history-score{align-items:flex-end}.aw-history-score strong{font-size:17px}.aw-complete{display:inline-flex;align-items:center;gap:5px;padding:4px 8px;border-radius:999px;background:#3c866617;color:#28674c;font-size:10.5px;font-weight:620}.aw-complete svg{width:12px;height:12px}.aw-results-empty{min-height:210px;display:flex;align-items:center;justify-content:center;flex-direction:column;gap:7px;border:1px dashed hsl(var(--border));border-radius:10px;color:hsl(var(--muted-foreground));text-align:center}.aw-results-empty strong{color:hsl(var(--foreground));font-size:12.5px}.aw-results-empty span{font-size:11.5px}@media (max-width: 980px){.aw-workspace{grid-template-columns:260px minmax(0,1fr)}.aw-eval-setting-grid{grid-template-columns:minmax(0,1fr)}.aw-case-row{grid-template-columns:minmax(160px,.8fr) minmax(200px,1.2fr) 80px}}@media (max-width: 720px){.aw-view-tabs{padding-inline:16px}.aw-workspace{grid-template-columns:minmax(0,1fr);overflow-y:auto}.aw-sidebar{height:340px;max-height:340px;box-sizing:border-box;padding:18px 16px}.aw-agent-list{min-height:128px}.aw-main{min-height:620px;overflow:visible}.aw-agent-tabs{gap:18px;margin-inline:16px;overflow-x:auto}.aw-agent-head,.aw-eval-head{padding-inline:16px}.aw-content{overflow:visible;padding-inline:16px}.aw-facts{grid-template-columns:minmax(0,1fr)}.aw-facts>div:nth-child(n){padding-right:0;padding-left:0}.aw-eval-agent-grid,.aw-metric-list,.aw-readonly-config{grid-template-columns:minmax(0,1fr)}}@media (prefers-reduced-motion: reduce){.aw-root *,.aw-root *:before,.aw-root *:after{scroll-behavior:auto!important;transition-duration:.01ms!important}}.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[data-tool-tone=skill]{--builtin-tool-accent: 154 50% 34%}.builtin-tool-head[data-tool-tone=sandbox]{--builtin-tool-accent: 32 67% 42%}.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:14.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 svg.new-chat-mode__temporary-icon{stroke-width:1.3}.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:43;top:calc(100% + 7px);left: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;min-width:0;align-items:center;gap:7px;font-size:13px;line-height:1.3}.new-chat-mode__label-text{min-width:0;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.new-chat-mode__beta{flex:0 0 auto;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))}.new-chat-mode__nested-chevron{width:14px;height:14px;color:hsl(var(--muted-foreground))}.new-chat-mode__submenu{position:absolute;z-index:44;top:calc(100% + 7px);left:294px;width:248px;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__submenu-option{display:grid;grid-template-columns:28px minmax(0,1fr);align-items:center;gap:9px;width:100%;padding:9px 8px;border:0;border-radius:9px;background:transparent;color:hsl(var(--foreground));font:inherit;text-align:left;cursor:pointer}.new-chat-mode__submenu-option:hover:not(:disabled){background:hsl(var(--accent))}.new-chat-mode__submenu-option:disabled{cursor:not-allowed;opacity:.42}.new-chat-mode__builtin-icon{width:24px;height:24px;border-radius:6px;object-fit:contain}@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}}.layout{--pp-sidebar-width: 236px}.layout:has(.sidebar.is-collapsed){--pp-sidebar-width: 56px}.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{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-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-publish-content-width: min(760px, max(680px, calc(100% - 48px) ));overflow-y:auto}.pp-root.is-deploy .pp-body{flex:0 0 auto;min-height:100%;display:grid;grid-template-rows:auto auto;overflow:visible}.pp-root.is-deploy.has-primary-pane .pp-body{display:flex;justify-content:center;background:hsl(var(--secondary) / .18)}.pp-root.is-deploy.has-primary-pane .pp-config{width:min(760px,100%);background:transparent}.pp-root.is-deploy.has-primary-pane .pp-config-head,.pp-root.is-deploy.has-primary-pane .pp-config-actions{border:0;background:transparent}.pp-root.is-deploy.has-primary-pane .pp-config-actions{position:relative;justify-content:center;padding:12px 18px 18px;transform:none}.pp-root.is-deploy.has-primary-pane .pp-deploy-hint{position:absolute;left:18px}.pp-root.is-deploy .pp-files-area{display:none}.pp-release-overview{min-width:0;min-height:0;border-bottom:0;background:transparent}.pp-release-preview{width:var(--pp-publish-content-width);min-height:300px;box-sizing:border-box;min-height:0;display:grid;grid-template-columns:minmax(320px,.9fr) minmax(300px,1.1fr);gap:24px;margin:0 auto;padding:28px 0 12px}.pp-flow-thumbnail{position:relative;min-width:0;min-height:0;overflow:hidden;border:1px solid hsl(var(--border));border-radius:14px;background:transparent;box-shadow:none}.pp-flow-thumbnail .abc-root,.pp-flow-dialog-canvas .abc-root{width:100%;height:100%;min-width:0;min-height:0;flex:1 1 auto;border:0;background:transparent}.pp-flow-thumbnail .abc-canvas,.pp-flow-dialog-canvas .abc-canvas{flex:1;min-height:0;background:transparent}.pp-flow-thumbnail .react-flow__pane{cursor:grab}.pp-flow-thumbnail .react-flow__pane:active{cursor:grabbing}.pp-flow-thumbnail .react-flow__controls{display:none}.pp-flow-expand{position:absolute;z-index:5;right:10px;bottom:10px;width:32px;height:32px;display:inline-flex;align-items:center;justify-content:center;padding:0;border:0;background:transparent;color:hsl(var(--muted-foreground));cursor:pointer;font:inherit}.pp-flow-expand:hover{background:transparent;color:hsl(var(--foreground))}.pp-flow-expand:focus-visible{outline:2px solid hsl(var(--primary) / .72);outline-offset:2px}.pp-flow-expand svg{width:17px;height:17px}.pp-release-info{height:100%;min-width:0;display:flex;flex-direction:column;justify-content:flex-start}.pp-release-info-main{min-width:0}.pp-release-info h2{margin:0;color:hsl(var(--foreground));font-size:18px;font-weight:700;letter-spacing:-.02em}.pp-release-description{display:-webkit-box;margin:6px 0 0;color:hsl(var(--muted-foreground));font-size:13px;overflow:hidden;line-height:1.5;-webkit-box-orient:vertical;-webkit-line-clamp:2}.pp-release-facts{display:flex;flex-direction:column;gap:10px;margin:12px 0 0}.pp-release-facts>div{min-width:0}.pp-release-facts dt{color:hsl(var(--muted-foreground));font-size:13px}.pp-release-facts dd{margin:5px 0 0;overflow:hidden;color:hsl(var(--foreground));font-size:13px;font-weight:650;text-overflow:ellipsis;white-space:nowrap}.pp-release-facts .pp-release-fact-long{display:-webkit-box;overflow:hidden;line-height:1.45;text-overflow:clip;white-space:pre-wrap;-webkit-box-orient:vertical;-webkit-line-clamp:2}.pp-release-facts .pp-release-prompt{-webkit-line-clamp:3}.pp-artifact-actions{display:flex;flex-wrap:wrap;gap:8px;margin-top:18px;padding-top:12px}.pp-artifact-actions .pp-secondary,.pp-artifact-actions .code-browser-trigger{min-height:34px;padding-inline:12px;border:0;border-radius:7px;background:hsl(var(--secondary) / .58);box-shadow:none;color:hsl(var(--foreground));font-size:13px}.pp-artifact-actions .pp-secondary:hover,.pp-artifact-actions .code-browser-trigger:hover{background:hsl(var(--secondary))}.pp-flow-backdrop{--cw-workspace-ink: 222 24% 13%;position:fixed;z-index:1000;top:0;right:0;bottom:0;left:0;display:flex;align-items:center;justify-content:center;padding:32px;background:hsl(var(--foreground) / .36);-webkit-backdrop-filter:blur(3px);backdrop-filter:blur(3px)}.pp-flow-dialog{width:min(1120px,92vw);height:min(720px,86vh);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 80px hsl(var(--foreground) / .22)}.pp-flow-dialog>header{flex:0 0 62px;display:flex;align-items:center;justify-content:space-between;gap:18px;padding:0 18px 0 22px;border-bottom:1px solid hsl(var(--border))}.pp-flow-dialog>header>div{display:flex;flex-direction:column;gap:3px}.pp-flow-dialog>header strong{font-size:15px;font-weight:680}.pp-flow-dialog>header span{color:hsl(var(--muted-foreground));font-size:10.5px}.pp-flow-dialog>header button{width:34px;height:34px;display:inline-flex;align-items:center;justify-content:center;border:0;border-radius:7px;background:transparent;color:hsl(var(--muted-foreground));cursor:pointer}.pp-flow-dialog>header button:hover{background:hsl(var(--secondary));color:hsl(var(--foreground))}.pp-flow-dialog>header svg{width:17px;height:17px}.pp-flow-dialog-canvas{flex:1;min-height:0;background:transparent}.pp-config{position:relative;min-width:0;width:auto;min-height:0;display:flex;flex-direction:column;background:hsl(var(--panel))}.pp-config-head{width:var(--pp-publish-content-width);flex:0 0 48px;height:48px;box-sizing:border-box;display:flex;align-items:center;margin:0 auto;padding:0;border-bottom:0}.pp-config-title{color:hsl(var(--foreground));font-size:18px;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{width:var(--pp-publish-content-width);flex:0 0 auto;min-height:0;box-sizing:border-box;display:block;margin:0 auto;overflow:visible;padding:0 0 88px}.pp-config-actions{position:fixed;z-index:40;left:calc((100vw + var(--pp-sidebar-width, 0px)) / 2);bottom:max(20px,env(safe-area-inset-bottom));display:flex;align-items:center;justify-content:center;padding:0;border:0;background:transparent;transform:translate(-50%)}.pp-config-section{width:100%;min-width:0;margin:0;padding:12px 0 20px}.pp-env-section,.pp-progress-section,.pp-deploy-result,.pp-config-scroll>.pp-error{width:100%;margin-inline:0}.pp-config-label{margin-bottom:10px;color:hsl(var(--foreground));font-size:15px;font-weight:650;letter-spacing:-.01em}.pp-config-note{margin:-4px 0 10px;color:hsl(var(--muted-foreground));font-size:12.5px;line-height:1.5}.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-channel-fields input{height:30px;padding-inline:8px;font-size:11.5px}.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-card{position:relative;width:clamp(154px,33.333%,236px);max-width:100%;height:112px;perspective:1200px;transition:height .18s ease}.pp-channel-card.is-flipped{height:176px}.pp-channel-card-inner{width:100%;height:100%;position:relative;transform-style:preserve-3d;transition:transform .42s cubic-bezier(.22,1,.36,1)}.pp-channel-card.is-flipped .pp-channel-card-inner{transform:rotateY(180deg)}.pp-channel-card-face{position:absolute;top:0;right:0;bottom:0;left:0;width:100%;height:100%;box-sizing:border-box;overflow:hidden;border:1px solid hsl(var(--border) / .72);border-radius:14px;background:hsl(var(--background));backface-visibility:hidden;-webkit-backface-visibility:hidden}.pp-channel-card-front{display:flex;flex-direction:row;align-items:center;justify-content:flex-start;gap:11px;padding:12px;color:hsl(var(--foreground));cursor:pointer;font:inherit;text-align:left;transition:border-color .18s ease,box-shadow .18s ease,transform .18s ease}.pp-channel-card-front:hover:not(:disabled){border-color:hsl(var(--foreground) / .22);box-shadow:0 12px 30px hsl(var(--foreground) / .07);transform:translateY(-1px)}.pp-channel-card-front:focus-visible,.pp-channel-remove:focus-visible{outline:2px solid hsl(var(--ring) / .58);outline-offset:2px}.pp-channel-card-front:disabled{cursor:default}.pp-channel-card-back{padding:10px;transform:rotateY(180deg)}.pp-channel-card-head{display:flex;align-items:center;justify-content:space-between;gap:8px}.pp-channel-card-head>strong{font-size:12.5px;font-weight:650}.pp-channel-logo{width:42px;height:42px;flex:0 0 42px;display:inline-flex;align-items:center;justify-content:center;border:1px solid hsl(var(--border) / .65);border-radius:12px;background:#fff;box-shadow:0 4px 14px hsl(var(--foreground) / .07)}.pp-channel-logo img{width:30px;height:30px;display:block}.pp-channel-card-copy{min-width:0;display:flex;flex:1;flex-direction:column;gap:3px}.pp-channel-card-copy strong{font-size:14px;font-weight:650}.pp-channel-card-copy small{display:-webkit-box;overflow:hidden;color:hsl(var(--muted-foreground));font-size:12.5px;line-height:1.45;-webkit-box-orient:vertical;-webkit-line-clamp:2}.pp-channel-remove{min-height:24px;padding:0 6px;border:1px solid hsl(var(--destructive) / .14);border-radius:7px;background:hsl(var(--destructive) / .07);color:#863232;cursor:pointer;font:inherit;font-size:10.5px;white-space:nowrap}.pp-channel-remove:hover:not(:disabled){background:hsl(var(--destructive) / .12);color:#782626}.pp-channel-fields{display:flex;flex-direction:column;gap:6px;margin-top:7px}.pp-channel-fields label{min-width:0;display:flex;flex-direction:column;gap:3px;color:hsl(var(--muted-foreground));font-size:11px}.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:9px;font-weight:500}.pp-network-layout{width:min(100%,560px);display:grid;grid-template-columns:minmax(132px,.36fr) minmax(0,.64fr);align-items:start;gap:24px}.pp-network-region{position:relative;display:flex;flex-direction:column;gap:7px;margin-bottom:12px;color:hsl(var(--muted-foreground));font-size:12.5px}.pp-region-trigger{width:100%;height:36px;display:flex;align-items:center;justify-content:space-between;gap:12px;padding:0 11px;border:1px solid hsl(var(--border));border-radius:7px;background:hsl(var(--background));color:hsl(var(--foreground));font:inherit;font-size:13px;cursor:pointer;transition:border-color .12s ease,background-color .12s ease}.pp-region-trigger:hover,.pp-region-trigger[aria-expanded=true]{border-color:hsl(var(--foreground) / .22);background:hsl(var(--foreground) / .025)}.pp-region-trigger:focus-visible{outline:none;border-color:hsl(var(--ring));box-shadow:0 0 0 3px hsl(var(--ring) / .12)}.pp-region-chevron{width:15px;height:15px;color:hsl(var(--muted-foreground));transition:transform .15s ease}.pp-region-chevron.is-open{transform:rotate(180deg)}.pp-region-menu{position:absolute;top:calc(100% + 6px);right:0;left:0;z-index:31;padding:5px;border:1px solid hsl(var(--border));border-radius:10px;background:hsl(var(--panel));box-shadow:0 12px 28px hsl(var(--foreground) / .12)}.pp-region-option{width:100%;height:36px;display:flex;align-items:center;justify-content:space-between;padding:0 9px;border:0;border-radius:7px;background:transparent;color:hsl(var(--foreground));font:inherit;font-size:13px;text-align:left;cursor:pointer}.pp-region-option:hover,.pp-region-option:focus-visible,.pp-region-option.is-selected{outline:none;background:hsl(var(--foreground) / .055)}.pp-region-option.is-selected{font-weight:600}.pp-region-option svg{width:15px;height:15px;color:hsl(var(--primary))}.pp-network-modes{display:flex;flex-direction:column;gap:9px}.pp-network-option{min-height:28px;display:flex;align-items:center;gap:9px;color:hsl(var(--muted-foreground));font-size:12.5px;font-weight:560;cursor:pointer}.pp-network-option:has(input:checked){color:hsl(var(--foreground))}.pp-network-option:has(input:disabled){cursor:default;opacity:.58}.pp-network-option input{width:15px;height:15px;margin:0;accent-color:hsl(var(--foreground))}.pp-network-fields{display:flex;flex-direction:column;gap:12px;min-width:0}.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{width:100%;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:40px;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 (prefers-reduced-motion: reduce){.pp-channel-card-inner,.pp-channel-card-front,.pp-config-actions .pp-deploy{transition:none}}@media (max-width: 1120px){.pp-release-preview{grid-template-columns:minmax(320px,.9fr) minmax(300px,1.1fr)}.pp-sidebar{flex-basis:190px;width:190px}}@media (max-width: 860px){.layout{--pp-sidebar-width: 204px}.layout:has(.sidebar.is-collapsed){--pp-sidebar-width: 56px}.pp-root.is-deploy{--pp-publish-content-width: min(88%, calc(100% - 36px) )}.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-release-overview{flex:0 0 auto;min-height:460px;border-right:0;border-bottom:0}.pp-release-preview{min-width:0;grid-template-columns:minmax(0,1fr);grid-template-rows:220px auto}.pp-release-info{min-height:200px}.pp-files-area{min-height:520px}.pp-config{width:100%;min-height:680px;border-top:0;border-left:0}.pp-config-scroll{padding-inline:0;padding-bottom:84px}.pp-config-actions{bottom:max(14px,env(safe-area-inset-bottom))}.pp-flow-backdrop{padding:12px}}@media (max-width: 520px){.pp-network-layout{grid-template-columns:minmax(0,1fr);gap:16px}.pp-env-section{width:100%}}.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-workspace-gutter: 12px;--cw-workbench-toolbar-height: 64px;--cw-workspace-ink: 222 24% 13%;--cw-workspace-accent: 162 44% 32%;--cw-workspace-accent-soft: 156 34% 92%;--cw-workspace-warm: 42 28% 96%;flex:1;min-height:0;display:flex;flex-direction:column;height:100%;color:hsl(var(--foreground));background:#fff}.cw-workspace-header{position:relative;z-index:12;flex:0 0 auto;min-height:56px;display:grid;grid-template-columns:minmax(180px,1fr) auto minmax(180px,1fr);align-items:center;gap:16px;margin:8px var(--cw-workspace-gutter) 0;padding:6px 14px;border:0;border-radius:16px;background:#f6f6f8d1;box-shadow:none;-webkit-backdrop-filter:blur(7px);backdrop-filter:blur(7px)}.cw-workspace-identity{min-width:0}.cw-workspace-identity>strong{min-width:0;overflow:hidden;color:hsl(var(--cw-workspace-ink));font-size:15px;font-weight:700;letter-spacing:-.025em;text-overflow:ellipsis;white-space:nowrap}.cw-workspace-actions{grid-column:3;justify-self:end}.cw-discard-edit{padding:7px 10px;border:0;border-radius:8px;background:transparent;color:hsl(var(--muted-foreground));cursor:pointer;font:inherit;font-size:12.5px;font-weight:560;transition:background-color .15s ease,color .15s ease}.cw-discard-edit:hover:not(:disabled){background:hsl(var(--destructive) / .08);color:hsl(var(--destructive))}.cw-discard-edit:focus-visible{outline:2px solid hsl(var(--destructive) / .22);outline-offset:2px}.cw-discard-edit:disabled{cursor:wait;opacity:.48}.cw-workspace-stepper{grid-column:2;width:max-content;max-width:100%;display:flex;align-items:center;justify-content:center;gap:12px}.cw-workspace-stepper button{position:relative;z-index:1;min-width:124px;display:flex;flex-direction:row;align-items:center;justify-content:center;min-height:36px;padding:0 14px;border:0;border-radius:10px;background:#ededf1c7;color:#474747;cursor:pointer;font:inherit;text-align:center;transition:background-color .18s cubic-bezier(.22,1,.36,1),color .15s ease,box-shadow .18s ease}.cw-workspace-stepper button:not(:last-child):after{content:none}.cw-workspace-stepper button:hover:not(:disabled),.cw-workspace-stepper button.is-complete{color:hsl(var(--cw-workspace-ink))}.cw-workspace-stepper button:hover:not(:disabled){background:#e4e4e9d6}.cw-workspace-stepper button.is-active{background:#dadae0db;color:#1a1a1a;box-shadow:none}.cw-workspace-stepper button:focus-visible{outline:none}.cw-workspace-stepper button:focus-visible .cw-workspace-step-marker{outline:2px solid hsl(var(--cw-workspace-ink) / .28);outline-offset:3px}.cw-workspace-stepper button:disabled{cursor:wait;opacity:.62}.cw-workspace-step-marker{width:20px;height:20px;flex:0 0 20px;display:inline-flex;align-items:center;justify-content:center;border:0;border-radius:50%;background:hsl(var(--foreground) / .06);color:hsl(var(--muted-foreground));box-shadow:none;font-size:10.5px;font-weight:650;transition:border-color .15s ease,background-color .15s ease,color .15s ease}.cw-workspace-stepper button:hover:not(:disabled) .cw-workspace-step-marker{background:hsl(var(--foreground) / .1)}.cw-workspace-stepper button.is-active .cw-workspace-step-marker,.cw-workspace-stepper button.is-complete .cw-workspace-step-marker{border:0}.cw-workspace-stepper button.is-active .cw-workspace-step-marker{background:#ffffff80;color:#2e2e2e}.cw-workspace-stepper button.is-complete .cw-workspace-step-marker{background:#ffffff94;color:#2e2e2e}.cw-workspace-step-marker .cw-i{width:13px;height:13px}.cw-workspace-stepper button>strong{font-size:14px;font-weight:650}@media (prefers-reduced-motion: reduce){.cw-workspace-stepper button,.cw-workspace-step-marker{transition:none}}.cw-workspace-main{flex:1;min-width:0;min-height:0;display:flex;overflow:hidden;background:#fff}.cw-workspace-alert{position:absolute;z-index:30;top:94px;right:18px;max-width:min(420px,calc(100% - 36px));padding:10px 13px;border:1px solid hsl(var(--destructive) / .2);border-radius:9px;background:hsl(var(--background));box-shadow:0 12px 36px hsl(var(--foreground) / .12);color:hsl(var(--destructive));font-size:12.5px}.cw-editor{flex:1;width:100%;min-height:0;display:flex;align-items:stretch}.cw-editor>.abc-root{flex-basis:42%;min-width:380px}.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{position:relative;flex:1 1 58%;width:auto;max-width:780px;min-width:0;min-height:0;display:flex;flex-direction:column}.cw-detail-scroll{flex:1;min-height:0;overflow-y:auto;scrollbar-gutter:stable both-edges;padding:24px 16px 96px}.cw-build-next{position:absolute;right:auto;bottom:20px;left:50%;z-index:8;transform:translate(-50%)}.cw-build-next.studio-update-action{background:#111;color:#fff}.cw-build-next.studio-update-action:not(:disabled):hover{background:#29292b;box-shadow:0 7px 18px #00000029;transform:translate(-50%)}.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-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-start{display:inline-flex;align-items:center;justify-content:center;gap:6px;min-height:30px;padding:6px 10px;border:none;border-radius:8px;background:#111;box-shadow:none;color:#fff;font:inherit;font-size:12px;font-weight:600;cursor:pointer;transition:background-color .18s cubic-bezier(.22,1,.36,1),box-shadow .18s ease,transform .15s ease}.cw-debug-start:hover:not(:disabled){background:#29292b;box-shadow:0 7px 18px #00000029}.cw-debug-start:active:not(:disabled){transform:translateY(0) scale(.98)}.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-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-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-validation-workspace{position:relative;flex:1;min-width:0;min-height:0;display:flex;background:hsl(var(--background))}.cw-optimization-panel{min-width:0;min-height:0;display:flex;flex-direction:column;padding:22px 16px 16px;border-right:1px solid hsl(var(--border));background:hsl(var(--cw-workspace-warm))}.cw-optimization-head{display:flex;flex-direction:column;gap:5px;padding:0 4px 18px}.cw-optimization-head>span{color:hsl(var(--cw-workspace-ink));font-size:16px;font-weight:700;letter-spacing:-.02em}.cw-optimization-head>small{color:hsl(var(--muted-foreground));font-size:11px;line-height:1.45}.cw-optimization-list{display:flex;flex-direction:column;gap:8px}.cw-optimization-option{position:relative;width:100%;display:flex;align-items:flex-start;gap:9px;padding:11px;border:1px solid hsl(var(--border) / .82);border-radius:11px;background:hsl(var(--panel) / .62);color:hsl(var(--foreground));cursor:pointer;transition:background-color .14s ease,border-color .14s ease,box-shadow .14s ease}.cw-optimization-option:hover{border-color:hsl(var(--cw-workspace-ink) / .24);background:hsl(var(--panel))}.cw-optimization-option.is-disabled{cursor:not-allowed;opacity:.62}.cw-optimization-option.is-disabled:hover{border-color:hsl(var(--border) / .82);background:hsl(var(--panel) / .62)}.cw-optimization-option:has(input:focus-visible){outline:2px solid hsl(var(--cw-workspace-ink) / .34);outline-offset:2px}.cw-optimization-option input{position:absolute;width:1px;height:1px;overflow:hidden;opacity:0;pointer-events:none}.cw-optimization-check{width:17px;height:17px;flex:0 0 17px;display:inline-flex;align-items:center;justify-content:center;margin-top:1px;border:1px solid hsl(var(--foreground) / .24);border-radius:5px;background:hsl(var(--panel));color:#fff}.cw-optimization-check .cw-i{width:11px;height:11px;stroke-width:2.4}.cw-optimization-copy{min-width:0;display:flex;flex-direction:column;gap:4px}.cw-optimization-copy strong{color:hsl(var(--cw-workspace-ink));font-size:12.5px;font-weight:650}.cw-optimization-copy small{color:hsl(var(--muted-foreground));font-size:10.5px;line-height:1.45}.cw-validation-content{flex:1;min-width:0;min-height:0;display:flex;overflow:hidden;background:#fff}.cw-ab-workspace{flex:1;min-width:0;min-height:0;display:grid;grid-template-rows:minmax(0,1fr) auto;overflow:hidden;background:#fff}.cw-ab-stage{position:relative;flex:1;min-width:0;min-height:0;overflow-x:hidden;overflow-y:auto;padding:8px var(--cw-workspace-gutter)}.cw-ab-grid{min-height:100%;display:grid;grid-template-columns:repeat(3,minmax(0,1fr));grid-auto-rows:minmax(420px,1fr);align-items:stretch;gap:12px}.cw-ab-add{min-height:420px;border:1px dashed hsl(var(--foreground) / .2);border-radius:16px;background:hsl(var(--background) / .5)}.cw-ab-card{min-width:0;min-height:420px;display:flex;flex-direction:column;perspective:1400px}.cw-ab-card-inner{position:relative;width:100%;min-height:420px;flex:1;transform-style:preserve-3d;transition:transform .44s cubic-bezier(.22,1,.36,1)}.cw-ab-card-inner.is-flipped{transform:rotateY(180deg)}.cw-ab-card-face{position:absolute;top:0;right:0;bottom:0;left:0;min-width:0;display:flex;flex-direction:column;overflow:hidden;border:1px dashed hsl(var(--foreground) / .2);border-radius:16px;background:hsl(var(--background));backface-visibility:hidden;-webkit-backface-visibility:hidden;transition:border-color .16s ease,background-color .16s ease}.cw-ab-card-back{transform:rotateY(180deg);overflow-x:hidden;overflow-y:auto}.cw-ab-card-head{min-height:54px;display:flex;align-items:center;justify-content:space-between;gap:10px;padding:9px 11px 9px 14px}.cw-ab-card-title{min-width:0;display:flex;flex-direction:column;gap:2px}.cw-ab-card-title strong{font-size:13.5px;font-weight:680}.cw-ab-card-title span{max-width:150px;overflow:hidden;color:hsl(var(--muted-foreground));font-size:10.5px;text-overflow:ellipsis;white-space:nowrap}.cw-ab-card-actions{flex:0 0 auto;display:flex;align-items:center;gap:4px}.cw-ab-config-trigger,.cw-ab-remove{min-height:28px;display:inline-flex;align-items:center;justify-content:center;gap:4px;padding:0 8px;border:0;border-radius:7px;background:hsl(var(--secondary) / .58);color:hsl(var(--muted-foreground));cursor:pointer;font:inherit;font-size:11px;font-weight:400}.cw-ab-config-trigger{background:#fdf1ce;color:#825917}.cw-ab-config-trigger:hover:not(:disabled){background:#fae7b2;color:#6f4811}.cw-ab-remove:hover{background:hsl(var(--secondary) / .62);color:hsl(var(--foreground))}.cw-ab-config-trigger:disabled,.cw-ab-remove:disabled{cursor:default;opacity:.45}.cw-ab-remove{width:28px;padding:0;background:transparent}.cw-ab-config-head{min-height:68px;display:flex;align-items:center;justify-content:space-between;gap:12px;padding:14px 16px 10px;background:hsl(var(--background) / .94)}.cw-ab-config-head>div{min-width:0;display:flex;flex-direction:column;gap:3px}.cw-ab-config-head strong{font-size:16px;font-weight:680}.cw-ab-config-head span{color:hsl(var(--muted-foreground));font-size:12px}.cw-ab-config-done{min-height:32px;padding:0 11px;border:0;border-radius:8px;background:hsl(var(--foreground));color:hsl(var(--background));cursor:pointer;font:inherit;font-size:12px;font-weight:650}.cw-ab-config-done-wrap{position:relative;flex:0 0 auto;display:inline-flex;border-radius:8px}.cw-ab-config-done:disabled{background:hsl(var(--secondary) / .82);color:hsl(var(--muted-foreground) / .68);cursor:not-allowed}.cw-ab-config-done-tip{position:absolute;z-index:8;right:0;bottom:calc(100% + 7px);width:max-content;max-width:190px;padding:6px 8px;border-radius:7px;background:hsl(var(--foreground));color:hsl(var(--background));font-size:11px;font-weight:400;line-height:1.4;opacity:0;pointer-events:none;transform:translateY(3px);transition:opacity .14s ease,transform .14s ease}.cw-ab-config-done-wrap.is-disabled:hover .cw-ab-config-done-tip,.cw-ab-config-done-wrap.is-disabled:focus-visible .cw-ab-config-done-tip{opacity:1;transform:translateY(0)}.cw-ab-config-done-wrap:focus-visible{outline:2px solid hsl(var(--foreground) / .18);outline-offset:2px}.cw-ab-config{flex:0 0 auto;display:grid;grid-template-columns:minmax(0,1fr);align-content:start;gap:12px;padding:12px 16px 16px;background:hsl(var(--secondary) / .16)}.cw-ab-config>label,.cw-ab-config fieldset{min-width:0;display:flex;flex-direction:column;gap:6px;margin:0;padding:0;border:0}.cw-ab-config>label>span,.cw-ab-config legend{color:hsl(var(--muted-foreground));font-size:13px;font-weight:650}.cw-ab-config legend{width:100%;display:flex;align-items:center;justify-content:space-between;gap:10px}.cw-ab-config legend em{padding:3px 7px;border-radius:999px;background:hsl(var(--secondary));color:hsl(var(--muted-foreground));font-size:10.5px;font-style:normal;font-weight:550}.cw-ab-config input[type=text],.cw-ab-config>label>input,.cw-ab-config>label>textarea{width:100%;min-height:40px;padding:8px 11px;border:1px solid hsl(var(--border));border-radius:8px;background:hsl(var(--background));color:hsl(var(--foreground));font:inherit;font-size:13px}.cw-ab-config>label>textarea{min-height:58px;max-height:132px;resize:vertical;line-height:1.55}.cw-ab-optimization-list{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:8px}.cw-ab-optimization-list label{display:inline-flex;align-items:center;gap:7px;padding:8px 9px;border-radius:8px;background:hsl(var(--background) / .82);color:hsl(var(--foreground));font-size:12.5px;cursor:not-allowed;opacity:.5}.cw-ab-optimization-list input{width:15px;height:15px;margin:0;accent-color:hsl(var(--foreground))}.cw-ab-config>p{margin:0;color:hsl(var(--muted-foreground));font-size:12.5px;line-height:1.5}.cw-ab-conversation{flex:1;min-height:0;overflow-y:auto;padding:14px}.cw-ab-empty{height:100%;min-height:210px;display:grid;place-items:center;color:hsl(var(--muted-foreground));font-size:12px}.cw-ab-launch{display:flex;flex-direction:column;align-items:center;justify-content:center;gap:9px;text-align:center}.cw-ab-launch-hint{color:hsl(var(--muted-foreground));font-size:10.5px}.cw-ab-starting{align-content:center;gap:8px}.cw-ab-starting .cw-i{width:18px;height:18px}.cw-ab-start{min-width:118px;min-height:32px;display:inline-flex;align-items:center;justify-content:center;gap:7px;padding:0 13px;border:0;border-radius:9px;background:hsl(var(--secondary) / .72);color:hsl(var(--foreground));cursor:pointer;font:inherit;font-size:11.5px;font-weight:580;transition:background-color .16s ease,box-shadow .16s ease}.cw-ab-start:hover:not(:disabled){background:hsl(var(--secondary));box-shadow:none}.cw-ab-start:disabled{background:hsl(var(--secondary) / .42);color:hsl(var(--muted-foreground) / .62);cursor:not-allowed}.cw-ab-start .cw-i{width:15px;height:15px}.cw-ab-deploy-footer{flex:0 0 auto;display:flex;justify-content:flex-end;padding:0 12px 12px}.cw-ab-deploy{min-height:32px;padding:0 13px;border:0;border-radius:8px;background:#111;color:#fff;cursor:pointer;font:inherit;font-size:11.5px;font-weight:620;transition:background-color .16s ease,box-shadow .16s ease}.cw-ab-deploy:hover:not(:disabled){background:#29292b;box-shadow:0 6px 16px #00000024}.cw-ab-deploy:disabled{cursor:not-allowed;opacity:.42}.cw-ab-add{display:flex;flex-direction:column;align-items:center;justify-content:center;gap:7px;color:hsl(var(--muted-foreground));cursor:pointer;font:inherit;transition:border-color .16s ease,background-color .16s ease,color .16s ease}.cw-ab-add:hover{border-color:hsl(var(--foreground) / .38);background:hsl(var(--secondary) / .24);color:hsl(var(--foreground))}.cw-ab-add .cw-i{width:22px;height:22px}.cw-ab-add strong{font-size:13px}.cw-ab-add span{font-size:10.5px}.cw-ab-composer{position:relative;z-index:2;min-width:0;padding:0 var(--cw-workspace-gutter) 18px;background:#fff}.cw-ab-composer .cw-debug-composerbox{width:min(100%,860px);min-height:48px;margin:0 auto;border-color:hsl(var(--foreground) / .14);border-radius:14px;background:hsl(var(--background) / .92);box-shadow:0 12px 32px hsl(var(--foreground) / .06);-webkit-backdrop-filter:blur(12px);backdrop-filter:blur(12px)}.cw-debug.is-standalone{flex:1;width:100%;min-width:0;border-left:0;background:transparent}.cw-debug.is-standalone .cw-debug-head{height:58px;padding-inline:22px;background:hsl(var(--panel) / .7)}.cw-debug.is-standalone .cw-debug-title{font-size:15px}.cw-debug.is-standalone .cw-debug-body{padding:22px clamp(18px,5vw,72px) 28px}.cw-debug.is-standalone .cw-debug-chat{width:min(100%,840px);margin:0 auto}.cw-debug.is-standalone .cw-debug-chat-empty{min-height:260px;border:1px dashed hsl(var(--border));border-radius:16px;background:hsl(var(--panel) / .56)}.cw-debug.is-standalone .cw-debug-composer{padding:12px 210px 20px clamp(18px,5vw,72px);background:transparent}.cw-debug.is-standalone .cw-debug-composerbox{width:min(100%,840px);min-height:48px;margin:0 auto;border-color:hsl(var(--foreground) / .14);border-radius:14px;box-shadow:0 12px 32px hsl(var(--foreground) / .06)}.cw-debug.is-standalone .cw-debug-overlay{background:hsl(var(--background) / .68)}.cw-debug.is-standalone .cw-debug-overlay-content{width:min(100%,390px);padding:28px;border-radius:16px}.cw-validation-prototype{flex:1;min-width:0;min-height:0;overflow-y:auto;padding:clamp(26px,4vw,56px)}.cw-validation-page-head{display:flex;align-items:flex-end;justify-content:space-between;gap:24px;margin:0 auto 28px;max-width:1040px}.cw-eyebrow{color:hsl(var(--cw-workspace-accent));font-family:ui-monospace,SFMono-Regular,Menlo,Monaco,Consolas,monospace;font-size:10px;font-weight:700;letter-spacing:.15em}.cw-validation-page-head h2{margin:5px 0 4px;color:hsl(var(--cw-workspace-ink));font-size:clamp(24px,3vw,34px);font-weight:720;letter-spacing:-.045em}.cw-validation-page-head p{margin:0;color:hsl(var(--muted-foreground));font-size:13px}.cw-prototype-action{min-height:40px;display:inline-flex;align-items:center;justify-content:center;gap:7px;padding:0 14px;border:1px solid hsl(var(--cw-workspace-ink));border-radius:8px;background:hsl(var(--cw-workspace-ink));color:hsl(var(--background));font:inherit;font-size:12px;font-weight:650}.cw-prototype-action:disabled{cursor:not-allowed;opacity:.72}.cw-dataset-summary,.cw-variant-grid,.cw-metric-board,.cw-prototype-table,.cw-run-list,.cw-prototype-note{width:min(100%,1040px);margin-inline:auto}.cw-dataset-summary{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));margin-bottom:14px;border:1px solid hsl(var(--border));border-radius:12px;background:hsl(var(--panel));box-shadow:0 10px 32px hsl(var(--foreground) / .035)}.cw-dataset-summary>div{display:flex;flex-direction:column;gap:4px;padding:17px 20px}.cw-dataset-summary>div+div{border-left:1px solid hsl(var(--border))}.cw-dataset-summary strong{color:hsl(var(--cw-workspace-ink));font-size:22px;letter-spacing:-.04em}.cw-dataset-summary span{color:hsl(var(--muted-foreground));font-size:10.5px}.cw-prototype-table{overflow:hidden;border:1px solid hsl(var(--border));border-radius:12px;background:hsl(var(--panel))}.cw-prototype-row{min-height:54px;display:grid;grid-template-columns:minmax(180px,1.3fr) minmax(100px,.7fr) minmax(170px,1fr) 82px;align-items:center;gap:16px;padding:10px 16px;border-top:1px solid hsl(var(--border));color:hsl(var(--muted-foreground));font-size:11.5px}.cw-prototype-row.is-head{min-height:38px;border-top:0;background:hsl(var(--secondary) / .42);color:hsl(var(--muted-foreground));font-size:10px;font-weight:650;letter-spacing:.04em;text-transform:uppercase}.cw-prototype-row>strong{color:hsl(var(--foreground));font-size:12px;font-weight:600}.cw-status-pill,.cw-run-status,.cw-run-kind{justify-self:start;padding:3px 7px;border-radius:999px;background:hsl(var(--secondary));color:hsl(var(--muted-foreground));font-size:10px;font-weight:600}.cw-variant-grid{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:14px;margin-bottom:14px}.cw-variant-card{position:relative;overflow:hidden;padding:20px;border:1px solid hsl(var(--border));border-radius:14px;background:hsl(var(--panel));box-shadow:0 12px 34px hsl(var(--foreground) / .04)}.cw-variant-card:before{content:"";position:absolute;top:0;left:0;width:100%;height:3px;background:hsl(var(--foreground) / .22)}.cw-variant-card.is-candidate:before{background:hsl(var(--cw-workspace-accent))}.cw-variant-head{display:flex;align-items:center;justify-content:space-between;margin-bottom:28px;color:hsl(var(--muted-foreground));font-size:10px;font-weight:650;letter-spacing:.06em;text-transform:uppercase}.cw-variant-head small{padding:3px 7px;border-radius:999px;background:hsl(var(--secondary));font-size:9.5px;letter-spacing:0;text-transform:none}.cw-variant-card>strong{color:hsl(var(--cw-workspace-ink));font-size:17px;letter-spacing:-.025em}.cw-variant-card>p{min-height:42px;margin:7px 0 22px;color:hsl(var(--muted-foreground));font-size:12px;line-height:1.6}.cw-variant-card dl{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:8px;margin:0}.cw-variant-card dl>div{padding:9px 10px;border-radius:8px;background:hsl(var(--secondary) / .5)}.cw-variant-card dt{color:hsl(var(--muted-foreground));font-size:9.5px}.cw-variant-card dd{margin:3px 0 0;color:hsl(var(--foreground));font-family:ui-monospace,SFMono-Regular,Menlo,Monaco,Consolas,monospace;font-size:10.5px}.cw-metric-board{overflow:hidden;border:1px solid hsl(var(--border));border-radius:12px;background:hsl(var(--panel))}.cw-metric-head,.cw-metric-row{display:grid;grid-template-columns:minmax(170px,1fr) 100px 100px 88px;align-items:center;gap:12px;padding:11px 16px}.cw-metric-head{grid-template-columns:auto auto minmax(0,1fr);min-height:48px;border-bottom:1px solid hsl(var(--border))}.cw-metric-head .cw-i{width:15px;color:hsl(var(--cw-workspace-accent))}.cw-metric-head strong{font-size:12px}.cw-metric-head span{justify-self:end;color:hsl(var(--muted-foreground));font-size:10.5px}.cw-metric-row{min-height:44px;color:hsl(var(--muted-foreground));font-size:11px}.cw-metric-row+.cw-metric-row{border-top:1px solid hsl(var(--border) / .7)}.cw-metric-row strong{color:hsl(var(--foreground));font-family:ui-monospace,SFMono-Regular,Menlo,Monaco,Consolas,monospace;font-size:11px}.cw-metric-row em{color:hsl(var(--cw-workspace-accent));font-size:10.5px;font-style:normal;font-weight:650}.cw-run-list{overflow:hidden;border:1px solid hsl(var(--border));border-radius:12px;background:hsl(var(--panel))}.cw-run-row{min-height:72px;display:grid;grid-template-columns:36px minmax(220px,1fr) 70px 110px 72px;align-items:center;gap:12px;padding:11px 16px}.cw-run-row+.cw-run-row{border-top:1px solid hsl(var(--border))}.cw-run-icon{width:32px;height:32px;display:inline-flex;align-items:center;justify-content:center;border-radius:9px;background:hsl(var(--cw-workspace-accent-soft));color:hsl(var(--cw-workspace-accent))}.cw-run-icon .cw-i{width:14px;height:14px}.cw-run-row>div{min-width:0}.cw-run-row strong{color:hsl(var(--foreground));font-size:12px}.cw-run-row p{margin:3px 0 0;overflow:hidden;color:hsl(var(--muted-foreground));font-size:10.5px;text-overflow:ellipsis;white-space:nowrap}.cw-run-row time{color:hsl(var(--muted-foreground));font-size:10.5px}.cw-run-status.is-running{background:hsl(var(--cw-workspace-accent-soft));color:hsl(var(--cw-workspace-accent))}.cw-prototype-note{display:flex;align-items:center;gap:7px;margin-top:14px;color:hsl(var(--muted-foreground));font-size:10.5px}.cw-prototype-note .cw-i{width:13px;height:13px}.cw-publish-loading{flex:1;display:flex;flex-direction:column;align-items:center;justify-content:center;gap:7px;color:hsl(var(--muted-foreground));font-size:12px}.cw-publish-loading .cw-i{width:22px;height:22px;margin-bottom:5px;color:hsl(var(--cw-workspace-accent))}.cw-publish-loading strong{color:hsl(var(--foreground));font-size:14px}.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:36px;min-height:36px;gap:8px;padding:0 10px 0 12px;border:1px solid hsl(var(--border));border-radius:6px;background-color:hsl(var(--background));color:hsl(var(--foreground));cursor:pointer;font:inherit;font-size:12px;font-weight:500;line-height:1.35;letter-spacing:0;transition:border-color .12s ease,box-shadow .12s ease,background-color .12s ease}.cw-a2a-space-trigger:hover:not(:disabled){border-color:hsl(var(--foreground) / .24);background-color:hsl(var(--muted) / .18)}.cw-a2a-space-trigger[aria-expanded=true]{border-color:hsl(var(--ring) / .42);background-color:hsl(var(--background));box-shadow:0 0 0 3px hsl(var(--ring) / .1)}.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>span.is-placeholder{color:hsl(var(--muted-foreground));font-weight:400}.cw-a2a-space-trigger-icon{width:18px;height:18px;flex-shrink:0;color:hsl(var(--muted-foreground));transition:transform .16s ease}.cw-a2a-space-trigger[aria-expanded=true] .cw-a2a-space-trigger-icon{transform:rotate(180deg)}.cw-a2a-space-menu{position:absolute;z-index:30;top:calc(100% + 6px);left:0;width:100%;overflow:hidden;padding:4px;border:1px solid hsl(var(--border));border-radius:6px;background:hsl(var(--background));color:hsl(var(--foreground));box-shadow:0 8px 24px hsl(var(--foreground) / .08);font-size:12px}.cw-picker-search{padding:4px 4px 6px;border-bottom:1px solid hsl(var(--border) / .72)}.cw-picker-search-input{width:100%;height:30px;padding:0 9px;border:1px solid hsl(var(--border));border-radius:5px;outline:none;background:hsl(var(--background));color:hsl(var(--foreground));font:inherit;font-size:12px}.cw-picker-search-input:focus{border-color:hsl(var(--ring) / .5);box-shadow:0 0 0 2px hsl(var(--ring) / .1)}.cw-picker-options{max-height:188px;overflow-y:auto;padding-top:4px;overscroll-behavior:contain}.cw-picker-empty{padding:14px 10px;color:hsl(var(--muted-foreground));text-align:center}.cw-a2a-space-option{display:flex;align-items:center;width:100%;min-height:34px;padding:8px 10px;border:0;border-radius:4px;background:transparent;color:hsl(var(--foreground));cursor:pointer;font:inherit;font-size:12px;font-weight:500;line-height:1.35;text-align:left;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.cw-a2a-space-option:hover,.cw-a2a-space-option:focus-visible{outline:none;background:hsl(var(--muted) / .5)}.cw-a2a-space-option.is-selected{background:hsl(var(--primary) / .08);color:hsl(var(--foreground))}.cw-a2a-space-refresh{flex-shrink:0;width:36px;height:36px;border:1px solid hsl(var(--border));border-radius:6px;background:hsl(var(--background));color:hsl(var(--foreground));transition:border-color .12s ease,background-color .12s ease}.cw-a2a-space-refresh:hover:not(:disabled){border-color:hsl(var(--foreground) / .24);background:hsl(var(--muted) / .4)}.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-viking-kb-picker{gap:6px}.cw-viking-kb-menu{padding:3px;box-shadow:0 6px 18px hsl(var(--foreground) / .06)}.cw-viking-kb-menu .cw-picker-options{max-height:min(112px,calc(100vh - 310px))}.cw-viking-kb-menu .cw-a2a-space-option{min-height:28px;padding:5px 9px;line-height:1.25}.cw-viking-kb-refresh{color:hsl(var(--foreground) / .72)}.cw-viking-kb-refresh:hover:not(:disabled){border-color:hsl(var(--foreground) / .28);background:hsl(var(--muted) / .45);color:hsl(var(--foreground))}.cw-viking-kb-refresh:disabled{color:hsl(var(--muted-foreground))}.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-tool-config{padding:14px;border:1px solid hsl(var(--border));border-radius:12px;background:hsl(var(--muted) / .28)}.cw-tool-config-head{display:flex;flex-direction:column;gap:3px}.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-agent-type-options{display:grid;grid-template-columns:repeat(auto-fit,minmax(150px,1fr));gap:8px}.cw-agent-type-option{position:relative;min-width:0;min-height:58px;display:flex;align-items:center;gap:10px;padding:10px 12px;border:1px solid hsl(var(--border) / .72);border-radius:10px;background:#fff;color:hsl(var(--foreground));cursor:pointer;transition:border-color .15s ease,background-color .15s ease}.cw-agent-type-option:hover{border-color:hsl(var(--foreground) / .2);background:hsl(var(--secondary) / .28)}.cw-agent-type-option.is-on{border-color:hsl(var(--foreground) / .3);background:hsl(var(--secondary) / .42)}.cw-agent-type-option.is-disabled{color:hsl(var(--muted-foreground) / .52);cursor:not-allowed}.cw-agent-type-radio{width:15px;height:15px;flex:0 0 15px;margin:0;accent-color:hsl(var(--foreground))}.cw-agent-type-copy{min-width:0;display:flex;flex-direction:column;gap:2px}.cw-agent-type-copy strong{font-size:13px;font-weight:650}.cw-agent-type-copy small{overflow:hidden;color:hsl(var(--muted-foreground));font-size:10.5px;line-height:1.35;text-overflow:ellipsis;white-space:nowrap}.cw-agent-type-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-agent-type-option.is-disabled:hover .cw-agent-type-disabled-hint,.cw-agent-type-option.is-disabled:focus .cw-agent-type-disabled-hint,.cw-agent-type-option.is-disabled:focus-visible .cw-agent-type-disabled-hint{opacity:1;transform:translateY(0)}.cw-agent-type-option:has(.cw-agent-type-radio:focus-visible){box-shadow:inset 0 0 0 2px hsl(var(--ring) / .45)}.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-workspace-header{grid-template-columns:minmax(160px,1fr) auto minmax(160px,1fr);gap:16px;padding-inline:16px}.cw-debug{width:280px}.cw-tree{width:208px}}@media (max-width: 1080px){.cw-workspace-header{grid-template-columns:minmax(140px,1fr) auto minmax(140px,1fr)}.cw-editor{flex-wrap:nowrap;overflow:hidden}.cw-tree{height:auto}.cw-detail{flex-basis:58%;width:auto;max-width:560px;height:auto;min-height:0}.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-root{--cw-workspace-gutter: 8px}.cw-workspace-header{min-height:108px;grid-template-columns:minmax(0,1fr);gap:8px;margin:8px var(--cw-workspace-gutter) 0;padding:9px 10px}.cw-workspace-stepper{grid-column:1;width:min(100%,340px);justify-self:center}.cw-workspace-actions{position:absolute;top:10px;right:12px;grid-column:1}.cw-validation-workspace{display:flex}.cw-ab-stage{padding:8px var(--cw-workspace-gutter)}.cw-ab-grid{grid-template-columns:repeat(3,minmax(0,1fr))}.cw-ab-composer{padding-inline:var(--cw-workspace-gutter)}.cw-editor{flex-direction:column;flex-wrap:nowrap;overflow-x:hidden;overflow-y:auto}.cw-editor>.abc-root{width:100%;min-width:0}.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-detail-scroll{padding:20px 12px 90px}.cw-build-next{bottom:14px}.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-workspace-stepper button{padding-inline:4px}.cw-optimization-list,.cw-ab-grid,.cw-ab-config{grid-template-columns:minmax(0,1fr)}.cw-ab-composer{padding-bottom:12px}.cw-dataset-summary>div+div{border-top:1px solid hsl(var(--border));border-left:0}}.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}}.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}}.package-create{flex:1;min-width:0;min-height:0;display:flex;color:hsl(var(--foreground))}.package-create-preview{height:100%}.package-create-preview>*{flex:1;min-width:0;min-height:0}.package-source-pane{padding:16px 18px 18px}.package-source-label{margin-bottom:10px;color:hsl(var(--foreground));font-size:15px;font-weight:650}.package-dropzone{min-height:152px;display:flex;flex-direction:column;align-items:center;justify-content:center;gap:7px;padding:20px;border:1px dashed hsl(var(--border));border-radius:12px;background:hsl(var(--secondary) / .16);text-align:center;cursor:pointer;transition:border-color .16s ease,background-color .16s ease}.package-dropzone:focus-visible{outline:2px solid hsl(var(--ring) / .55);outline-offset:3px}.package-dropzone.is-dragging{border-color:hsl(var(--primary) / .62);background:hsl(var(--primary) / .045)}.package-dropzone.is-ready{background:hsl(var(--background))}.package-dropzone>strong{max-width:100%;overflow:hidden;font-size:15px;font-weight:650;text-overflow:ellipsis;white-space:nowrap}.package-dropzone>span{max-width:420px;color:hsl(var(--muted-foreground));font-size:13px;line-height:1.6}.package-upload-actions{display:flex;align-items:center;justify-content:center;gap:8px;margin-top:5px}.package-upload-actions button{min-height:36px;padding:0 16px;border-radius:7px;font:inherit;font-size:13px;font-weight:600;cursor:pointer;transition:background-color .14s ease,border-color .14s ease,color .14s ease}.package-upload-secondary{border:1px solid hsl(var(--border));background:hsl(var(--background));color:hsl(var(--foreground))}.package-upload-secondary:hover:not(:disabled){border-color:hsl(var(--foreground) / .24);background:hsl(var(--secondary))}.package-upload-actions button:disabled{cursor:default;opacity:.45}.package-upload-actions button:focus-visible{outline:2px solid hsl(var(--ring) / .55);outline-offset:2px}.package-dropzone input{display:none}.package-create-error{flex:0 0 auto;margin-top:12px;padding:10px 12px;border:1px solid hsl(var(--destructive) / .2);border-radius:8px;background:hsl(var(--destructive) / .07);color:hsl(var(--destructive));font-size:13px;line-height:1.5}@media (max-width: 860px){.package-dropzone{min-height:140px}}@media (prefers-reduced-motion: reduce){.package-dropzone,.package-upload-actions button{transition:none}}.studio-update-trigger{display:inline-flex;align-items:center;justify-content:center;gap:7px;min-width:112px;min-height:32px;padding:0 10px;border:1px solid #1664ff;border-radius:8px;background:#1664ff;color:#fff;font:inherit;font-size:12px;font-weight:500;cursor:pointer;transition:border-color .14s ease,background-color .14s ease,color .14s ease}.studio-update-trigger.is-idle{gap:0;width:32px;min-width:32px;padding:0;overflow:hidden;white-space:nowrap;transition:width .18s ease,gap .18s ease,padding .18s ease,border-color .14s ease,background-color .14s ease,color .14s ease}.studio-update-trigger.is-idle:hover,.studio-update-trigger.is-idle:focus-visible{gap:7px;width:124px;padding:0 10px;border-color:#1664ff;background:#1664ff;color:#fff}.studio-update-trigger.is-idle>span{max-width:0;overflow:hidden;opacity:0;transform:translate(-4px);transition:max-width .18s ease,opacity .12s ease,transform .18s ease}.studio-update-trigger.is-idle:hover>span,.studio-update-trigger.is-idle:focus-visible>span{max-width:86px;opacity:1;transform:translate(0)}.studio-update-trigger.is-submitting{border-color:hsl(var(--border));background:hsl(var(--background));color:hsl(var(--foreground));cursor:pointer}.studio-update-trigger.is-error{border-color:hsl(var(--border));background:hsl(var(--background));color:hsl(var(--destructive))}.studio-update-trigger.is-published{border-color:hsl(var(--border));background:hsl(var(--background));color:hsl(var(--foreground))}.studio-update-icon{width:17px;height:17px;flex:0 0 17px}.studio-update-dialog{display:grid;grid-template-columns:30px minmax(0,1fr);column-gap:10px;width:500px}.studio-update-dialog>.studio-update-dialog-mark{grid-column:1;grid-row:1}.studio-update-dialog>.confirm-title{grid-column:2;grid-row:1;align-self:start;margin:5px 0 12px}.studio-update-dialog>:not(.studio-update-dialog-mark,.confirm-title){grid-column:1 / -1}.studio-update-field{position:relative;display:grid;gap:6px;margin-bottom:12px;color:hsl(var(--muted-foreground));font-size:12px}.studio-update-version-trigger{display:flex;align-items:center;justify-content:space-between;gap:8px;width:100%;height:36px;padding:0 10px 0 12px;border:1px solid hsl(var(--border));border-radius:8px;background:hsl(var(--background));color:hsl(var(--foreground));font:inherit;font-size:13px;font-variant-numeric:tabular-nums;font-weight:500;text-align:left;cursor:pointer;transition:border-color .12s ease,box-shadow .12s ease,background-color .12s ease}.studio-update-version-trigger:hover{border-color:hsl(var(--foreground) / .24);background:hsl(var(--muted) / .18)}.studio-update-version-trigger[aria-expanded=true]{border-color:hsl(var(--ring) / .42);background:hsl(var(--background));box-shadow:0 0 0 3px hsl(var(--ring) / .1)}.studio-update-version-trigger:focus-visible{outline:none;box-shadow:0 0 0 3px hsl(var(--ring) / .12)}.studio-update-version-trigger>svg{width:16px;height:16px;flex:0 0 16px;color:hsl(var(--muted-foreground));stroke:currentColor;stroke-width:1.6;stroke-linecap:round;stroke-linejoin:round;transition:transform .16s ease}.studio-update-version-trigger[aria-expanded=true]>svg{transform:rotate(180deg)}.studio-update-version-menu{position:absolute;z-index:50;top:calc(100% + 6px);left:0;width:100%;max-height:190px;padding:4px;overflow-y:auto;border:1px solid hsl(var(--border));border-radius:8px;background:hsl(var(--panel, var(--background)));box-shadow:0 12px 28px hsl(var(--foreground) / .1),0 2px 8px hsl(var(--foreground) / .05);overscroll-behavior:contain}.studio-update-version-option{display:flex;align-items:center;justify-content:space-between;gap:8px;width:100%;min-height:34px;padding:7px 9px;border:0;border-radius:6px;background:transparent;color:hsl(var(--foreground));font:inherit;font-size:12px;font-variant-numeric:tabular-nums;font-weight:500;text-align:left;cursor:pointer}.studio-update-version-option:hover,.studio-update-version-option:focus-visible{outline:none;background:hsl(var(--muted) / .5)}.studio-update-version-option.is-selected{background:hsl(var(--primary) / .08)}.studio-update-version-option>svg{width:15px;height:15px;flex:0 0 15px;color:hsl(var(--primary));stroke:currentColor;stroke-width:1.8;stroke-linecap:round;stroke-linejoin:round}.studio-update-dialog-mark{display:inline-grid;flex:0 0 30px;width:30px;height:30px;margin-bottom:12px;place-items:center;border-radius:8px;background:hsl(var(--secondary));color:hsl(var(--foreground))}.studio-update-dialog-mark svg{width:18px;height:18px}.studio-update-versions{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:10px 16px;margin:0 0 18px;padding:12px;border:1px solid hsl(var(--border));border-radius:9px;background:hsl(var(--canvas) / .5)}.studio-update-versions div:last-child{grid-column:1 / -1}.studio-update-versions dt{margin-bottom:3px;color:hsl(var(--muted-foreground));font-size:11px}.studio-update-versions dd{margin:0;overflow:hidden;color:hsl(var(--foreground));font-size:12px;font-variant-numeric:tabular-nums;text-overflow:ellipsis;white-space:nowrap}.studio-update-changelog{margin:0 0 18px;padding:12px;border:1px solid hsl(var(--border));border-radius:9px}.studio-update-changelog>div{margin-bottom:7px;color:hsl(var(--foreground));font-size:12px;font-weight:500}.studio-update-changelog ul{display:grid;gap:5px;max-height:min(180px,25vh);margin:0;padding:0 6px 0 18px;overflow-y:auto;overscroll-behavior:contain;scrollbar-gutter:stable}.studio-update-changelog li,.studio-update-changelog p{margin:0;color:hsl(var(--muted-foreground));font-size:12px;line-height:1.55}.studio-update-confirm{border-color:transparent;background:hsl(var(--primary));color:hsl(var(--primary-foreground))}.studio-update-confirm:hover{background:hsl(var(--primary) / .88)}.studio-update-error{margin-bottom:12px;color:hsl(var(--destructive))}.studio-update-error-panel{min-width:0}.studio-update-error-meta{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:10px;margin:0 0 12px}.studio-update-error-meta>div{min-width:0;padding:10px 12px;border:1px solid hsl(var(--border));border-radius:8px;background:hsl(var(--canvas) / .5)}.studio-update-error-meta dt{margin-bottom:3px;color:hsl(var(--muted-foreground));font-size:11px}.studio-update-error-meta dd{margin:0;overflow:hidden;color:hsl(var(--foreground));font-family:ui-monospace,SFMono-Regular,Menlo,Monaco,Consolas,monospace;font-size:11px;text-overflow:ellipsis;white-space:nowrap}.studio-update-log-header{display:flex;align-items:center;justify-content:space-between;gap:12px;padding:8px 10px;border:1px solid hsl(var(--border));border-bottom:0;border-radius:8px 8px 0 0;background:hsl(var(--muted) / .28);color:hsl(var(--foreground));font-size:11px;font-weight:500}.studio-update-log-header>span{display:inline-flex;align-items:center;gap:6px}.studio-update-log-header i{width:6px;height:6px;border-radius:50%;background:hsl(var(--muted-foreground))}.studio-update-log-header i.is-active{background:#1664ff;box-shadow:0 0 0 3px #1664ff1c}.studio-update-log-header i.is-complete{background:#29ae60}.studio-update-log-header i.is-error{background:hsl(var(--destructive))}.studio-update-log-header small{color:hsl(var(--muted-foreground));font-size:10px;font-weight:400}.studio-update-log-header button{padding:2px 0;border:0;background:transparent;color:hsl(var(--primary));font:inherit;cursor:pointer}.studio-update-log-header button:hover{text-decoration:underline;text-underline-offset:2px}.studio-update-log-header button:disabled{color:hsl(var(--muted-foreground));cursor:default;text-decoration:none}.studio-update-log-lines{min-height:92px;max-height:min(210px,29vh);padding:11px 12px;overflow-y:auto;border:1px solid hsl(var(--border));border-radius:0 0 8px 8px;background:hsl(var(--foreground) / .035);color:hsl(var(--foreground));font-family:inherit;font-size:11px;line-height:1.55;overflow-wrap:anywhere;overscroll-behavior:contain;scrollbar-gutter:stable}.studio-update-log-lines:focus-visible{outline:2px solid hsl(var(--ring) / .35);outline-offset:-2px}.studio-update-log-lines>div+div{margin-top:3px}.studio-update-log-lines p{margin:0;color:hsl(var(--muted-foreground))}.studio-update-console-link{display:inline-flex;align-items:center;gap:5px;margin-top:10px;color:hsl(var(--primary));font-size:11px;font-weight:500;text-decoration:none}.studio-update-console-link:hover{text-decoration:underline;text-underline-offset:2px}.studio-update-progress-summary{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:10px;margin:14px 0 18px}.studio-update-progress-summary>div{display:grid;gap:4px;padding:10px 12px;border:1px solid hsl(var(--border));border-radius:8px;background:hsl(var(--canvas) / .5)}.studio-update-progress-summary span{color:hsl(var(--muted-foreground));font-size:11px}.studio-update-progress-summary strong{overflow:hidden;color:hsl(var(--foreground));font-size:12px;font-variant-numeric:tabular-nums;font-weight:500;text-overflow:ellipsis;white-space:nowrap}.studio-update-progress{display:grid;gap:0;margin:0 0 14px;padding:0;list-style:none}.studio-update-progress li{position:relative;display:grid;grid-template-columns:18px minmax(0,1fr);gap:9px;min-height:38px;color:hsl(var(--muted-foreground));font-size:12px}.studio-update-progress li:not(:last-child):after{position:absolute;top:14px;bottom:-2px;left:5px;width:1px;background:hsl(var(--border));content:""}.studio-update-progress li.is-complete:not(:last-child):after{background:#1664ff}.studio-update-progress-dot{position:relative;z-index:1;width:11px;height:11px;margin-top:2px;border:2px solid hsl(var(--border));border-radius:50%;background:hsl(var(--background))}.studio-update-progress li.is-active,.studio-update-progress li.is-complete{color:hsl(var(--foreground))}.studio-update-progress li.is-active .studio-update-progress-dot{border-color:#1664ff;box-shadow:0 0 0 3px #1664ff1f}.studio-update-progress li.is-complete .studio-update-progress-dot{border-color:#1664ff;background:#1664ff}.studio-update-progress li>div{display:grid;gap:3px;min-width:0}.studio-update-progress small{color:hsl(var(--muted-foreground));font-size:11px}.studio-update-progress-note{margin:12px 0 18px;color:hsl(var(--muted-foreground));font-size:11px;line-height:1.55}@media (max-width: 720px){.studio-update-dialog{width:calc(100vw - 32px)}}.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}}.auth-expired-backdrop{position:fixed;top:0;right:0;bottom:0;left:0;z-index:140;display:grid;place-items:center;padding:20px;background:hsl(var(--foreground) / .22);backdrop-filter:blur(5px) saturate(.88);-webkit-backdrop-filter:blur(5px) saturate(.88)}.auth-expired-dialog{position:relative;width:min(400px,calc(100vw - 40px));overflow:hidden;border:1px solid hsl(var(--border));border-radius:16px;background:hsl(var(--panel));box-shadow:0 28px 80px hsl(var(--foreground) / .2),0 2px 8px hsl(var(--foreground) / .06);animation:auth-expired-enter .18s cubic-bezier(.22,1,.36,1) both}.auth-expired-mark{display:grid;width:32px;height:32px;margin:32px auto 0;place-items:center;color:hsl(var(--foreground))}.auth-expired-mark svg{width:21px;height:21px;stroke-width:1.8}.auth-expired-copy{padding:22px 32px 28px;text-align:center}.auth-expired-copy h2{margin:0;color:hsl(var(--foreground));font-size:19px;font-weight:650;letter-spacing:-.01em}.auth-expired-copy>p:last-child{margin:11px 0 0;color:hsl(var(--muted-foreground));font-size:13px;line-height:1.7}.auth-expired-copy .auth-expired-error{margin-top:10px;color:hsl(var(--destructive))}.auth-expired-actions{padding:0 16px 16px}.auth-expired-actions button{width:100%;height:38px;border:1px solid hsl(var(--foreground));border-radius:9px;background:hsl(var(--foreground));color:hsl(var(--background));font:inherit;font-size:13px;font-weight:650;cursor:pointer;transition:transform .12s ease,opacity .12s ease}.auth-expired-actions button:hover{opacity:.88}.auth-expired-actions button:active{transform:translateY(1px)}.auth-expired-actions button:focus-visible{outline:3px solid hsl(var(--ring) / .28);outline-offset:2px}.auth-expired-actions button:disabled{cursor:wait;opacity:.58}@keyframes auth-expired-enter{0%{opacity:0;transform:translateY(8px) scale(.985)}to{opacity:1;transform:translateY(0) scale(1)}}@media (prefers-reduced-motion: reduce){.auth-expired-dialog{animation: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;padding:0;border:0;background:transparent;color:inherit;cursor:pointer;font-weight:600;font-size:15px;letter-spacing:-.01em;font-family:inherit;text-align:left}.brand-title{overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.brand-logo,.brand-title,.brand{cursor:pointer}.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;height:36px;min-height:36px;padding:8px 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)}.new-chat--conversation>.icon{transform-origin:center}.new-chat--conversation:hover>.icon{animation:sidebar-plus-return .65s cubic-bezier(.22,1,.36,1) both}.sidebar-agent-face{overflow:visible}.sidebar-agent-face__eye{transform-box:fill-box;transform-origin:center}.new-chat--agents:hover .sidebar-agent-face__eye{animation:sidebar-agent-blink .76s ease-in-out both}@keyframes sidebar-plus-return{0%{transform:rotate(0)}48%{transform:rotate(48deg)}to{transform:rotate(0)}}@keyframes sidebar-agent-blink{0%,34%,48%,62%,to{transform:scaleY(1)}41%,55%{transform:scaleY(.08)}}@media (prefers-reduced-motion: reduce){.new-chat--conversation:hover>.icon,.new-chat--agents:hover .sidebar-agent-face__eye{animation:none}}.studio-update-action{min-width:104px;min-height:40px;display:inline-flex;align-items:center;justify-content:center;gap:7px;padding:0 17px;border:0;border-radius:999px;background:#111;color:#fff;box-shadow:none;-webkit-backdrop-filter:blur(7px);backdrop-filter:blur(7px);cursor:pointer;font:inherit;font-size:12.5px;font-weight:650;transition:background-color .24s cubic-bezier(.22,1,.36,1),color .18s ease,box-shadow .24s ease,backdrop-filter .24s ease}.studio-update-action:not(:disabled):hover{border:0;background:#29292b;color:#fff;box-shadow:0 7px 18px #00000029}.studio-update-action:focus-visible{outline:2px solid hsl(var(--ring) / .55);outline-offset:2px}.studio-update-action:disabled{cursor:default;opacity:.42}.sidebar.is-collapsed .new-chat{align-self:center;width:36px;height:36px;min-height:36px;gap:0;padding:9px;overflow:hidden;white-space:nowrap}.sidebar.is-collapsed .sidebar-nav-label,.sidebar.is-collapsed .sidebar-history{display:none}.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))}.agentsel--navbar{position:absolute;top:calc(100% + 7px);left:0;z-index:44;width:min(clamp(264px,26vw,288px),calc(100vw - 48px));height:min(640px,calc(100dvh - 74px));margin-left:0}.agentsel--navbar .agentsel-main{width:100%;flex-basis:auto}.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{position:relative;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}.transcript.is-streaming{overflow-anchor:none}.welcome{position:relative;flex:1;display:flex;flex-direction:column;align-items:center;justify-content:center;padding:0 16px clamp(96px,18vh,152px);gap:40px}.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}.transcript.is-streaming>.turn--assistant:last-child{min-height:max(0px,calc(100% - 180px))}.turn--subagent{isolation:isolate;position:relative;width:100%;max-width:768px;margin-top:34px;margin-bottom:48px;padding:30px 16px 14px;gap:10px;border:1px solid hsl(215 20% 88% / .82);border-radius:14px;background:#f9fafbad;box-shadow:inset 0 1px #fffc,0 14px 36px #33445b0f;backdrop-filter:blur(18px) saturate(115%);-webkit-backdrop-filter:blur(18px) saturate(115%)}.turn--subagent:before{position:absolute;z-index:-1;top:0;right:0;bottom:0;left:0;overflow:hidden;border-radius:inherit;background:radial-gradient(circle at 12% 8%,hsl(210 38% 92% / .55),transparent 38%),radial-gradient(circle at 88% 78%,hsl(220 22% 91% / .42),transparent 42%),linear-gradient(120deg,#ffffff8f,#f2f4f742);content:"";pointer-events:none}.transcript.is-streaming>.turn--subagent:last-child{min-height:0}.subagent-run-label{position:absolute;top:0;left:14px;display:inline-flex;min-height:36px;max-width:calc(100% - 28px);padding:4px 9px 4px 4px;align-items:center;gap:8px;border:1px solid hsl(215 18% 86%);border-radius:10px;background:hsl(var(--background));box-shadow:0 4px 12px #39496012;transform:translateY(-50%)}.subagent-run-handoff{display:inline-flex;height:26px;padding:0 8px 0 6px;flex:0 0 auto;align-items:center;gap:5px;border-radius:7px;background:#eff2f5;color:#606b7b;font-size:12px;font-weight:400;white-space:nowrap}.subagent-run-handoff svg{width:15px;height:15px;flex:0 0 15px}.subagent-run-title{min-width:0;overflow:hidden;color:hsl(var(--foreground));font-size:14.5px;font-weight:400;text-overflow:ellipsis;white-space:nowrap}.subagent-run-description{display:-webkit-box;margin:0;padding:0 2px 4px;overflow:hidden;color:#636c79;font-size:13.5px;line-height:1.6;-webkit-box-orient:vertical;-webkit-line-clamp:2}.turn--subagent .turn-meta{position:absolute;bottom:-38px;left:0;margin-top:0}@media (max-width: 700px){.turn--subagent{width:100%;padding:30px 10px 12px}.subagent-run-label{left:10px;max-width:calc(100% - 20px)}}.bubble{line-height:1.65;font-size:16px}.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:16px;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:14.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:14.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:0;padding:0;border-left:0;color:hsl(var(--muted-foreground));font-size:14px;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}.feedback-btn:hover,.feedback-btn--good,.feedback-btn--bad,.feedback-btn--good:hover,.feedback-btn--bad:hover{background:none;color:hsl(var(--foreground))}.feedback-btn[aria-busy=true]{opacity:1}.feedback-btn--good[aria-busy=true]:hover,.feedback-btn--bad[aria-busy=true]:hover{color:hsl(var(--foreground))}.feedback-btn .icon{width:18px;height:18px}.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--new-chat{position:relative}.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-color:hsl(var(--border) / .55);border-radius:16px;box-shadow:0 8px 32px #00000007,0 24px 72px 8px #00000005}.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;left:52px;bottom:10px;display:flex;align-items:center;min-height:36px}.composer--new-chat.composer--skill-mode .new-chat-mode{left:10px}.composer--new-chat .comp-send{position:absolute;right:10px;bottom:10px}.composer--new-chat .comp-send .icon{width:20px;height:20px}.prompt-suggestions{position:absolute;top:calc(100% + 18px);left:0;z-index:1;display:grid;width:100%;gap:3px}.prompt-suggestion{display:flex;align-items:center;gap:12px;width:100%;min-height:46px;padding:8px 14px;border:0;border-radius:12px;background:transparent;color:hsl(var(--muted-foreground));font:inherit;font-size:15px;line-height:1.5;text-align:left;cursor:pointer;opacity:0;transform:translateY(10px);animation:prompt-suggestion-enter .44s cubic-bezier(.22,1,.36,1) forwards;transition:background .14s ease,color .14s ease,transform .14s ease}.prompt-suggestion:nth-child(2){animation-delay:65ms}.prompt-suggestion:nth-child(3){animation-delay:.13s}.prompt-suggestion:hover{background:hsl(var(--foreground) / .025);color:hsl(var(--foreground))}.prompt-suggestion:focus-visible{outline:2px solid hsl(var(--primary) / .42);outline-offset:-2px}.prompt-suggestion:disabled{cursor:not-allowed;opacity:.5}.prompt-suggestion>svg{flex:0 0 auto;width:18px;height:18px;stroke:currentColor;stroke-linecap:round;stroke-linejoin:round;stroke-width:1.35;transform-origin:center;transition:transform .22s cubic-bezier(.22,1,.36,1)}.prompt-suggestion:nth-child(1):hover>svg{transform:rotate(-8deg) scale(1.06)}.prompt-suggestion:nth-child(2):hover>svg{transform:rotate(6deg) scale(1.07)}.prompt-suggestion:nth-child(3):hover>svg{transform:rotate(-5deg) scale(1.06)}@keyframes prompt-suggestion-enter{to{opacity:1;transform:translateY(0)}}@media (prefers-reduced-motion: reduce){.prompt-suggestion{opacity:1;transform:none;animation:none;transition:none}.prompt-suggestion>svg{transition:none}.prompt-suggestion:hover>svg{transform:none}}.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;container-type:inline-size}.navbar-default{min-width:0}.navbar-title-group{display:flex;align-items:center;min-width:0;gap:6px}.agent-info-trigger{display:inline-flex;width:30px;height:30px;flex:0 0 30px;align-items:center;justify-content:center;padding:0;border:0;border-radius:7px;background:transparent;color:hsl(var(--muted-foreground));cursor:pointer;transition:background .15s ease,color .15s ease}.agent-info-trigger:hover,.agent-info-trigger[aria-expanded=true]{background:hsl(var(--foreground) / .06);color:hsl(var(--foreground))}.agent-info-trigger:focus-visible{outline:2px solid hsl(var(--ring));outline-offset:1px}.agent-info-trigger svg{width:17px;height:17px}.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;min-width:0;max-width:33.333cqw}.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;max-width:100%}.agent-dd-trigger:hover{background:hsl(var(--foreground) / .05)}.agent-dd-current{min-width:0;max-width:100%;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)}@keyframes ddpop{0%{opacity:0;transform:translateY(-4px)}to{opacity:1;transform:translateY(0)}}.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-action{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-action+.account-action{margin-top:2px}.account-action:hover{background:hsl(var(--foreground) / .05)}.account-action .icon{width:16px;height:16px;color:hsl(var(--muted-foreground))}.system-info-dialog{width:360px;padding:0;overflow:hidden}.system-info-head{display:flex;align-items:center;justify-content:space-between;margin:0 20px;padding:20px 0 16px;border-bottom:1px solid hsl(var(--border))}.system-info-head h2{margin:0;font-size:17px;font-weight:650}.system-info-meta{margin:0;padding:18px 20px 20px}.system-info-meta div{display:flex;flex-direction:column;align-items:flex-start;gap:8px}.system-info-meta dt{color:hsl(var(--muted-foreground));font-size:13px}.system-info-meta dd{max-width:100%;margin:0;overflow-wrap:anywhere;font-family:inherit;font-size:13px;font-weight:400;font-variant-numeric:tabular-nums}.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:28px;bottom:18px;right:18px;display:flex;width:288px;min-height:0;overflow:hidden;padding:16px;flex-direction:column;background:hsl(var(--background));border:1px solid hsl(var(--border));border-radius:18px;box-shadow:0 8px 24px hsl(var(--foreground) / .035);z-index:2}.topo.is-loading{bottom:auto;min-height:88px;display:grid;place-items:center}.topo.is-drawer{position:static;width:auto;min-height:0;max-height:none;overflow:visible;padding:22px;background:transparent;border:0;border-radius:0;box-shadow:none}.topo.is-loading.is-drawer{min-height:112px}.topo-loading-label{font-size:12px;line-height:1.5}.topo-agent-card{flex:0 0 auto;min-width:0;padding:0 0 16px;border:0;border-bottom:1px solid hsl(var(--border) / .72);border-radius:0;background:transparent}.topo-agent-heading{display:flex;min-width:0;flex-direction:column;gap:4px}.topo-agent-heading h2{margin:0;overflow:hidden;color:hsl(var(--foreground));font-size:15px;font-weight:650;line-height:1.4;letter-spacing:-.01em;text-overflow:ellipsis;white-space:nowrap}.topo-agent-heading>span{overflow:hidden;color:hsl(var(--muted-foreground));font-size:11.5px;line-height:1.4;text-overflow:ellipsis;white-space:nowrap}.topo-description{display:-webkit-box;margin:12px 0 0;overflow:hidden;color:hsl(var(--muted-foreground));font-size:12px;line-height:1.6;overflow-wrap:anywhere;-webkit-box-orient:vertical;-webkit-line-clamp:3}.topo-module-stack{display:grid;grid-template-rows:minmax(124px,.95fr) minmax(142px,1.15fr) minmax(106px,.75fr);flex:1;min-width:0;min-height:0;gap:0}.topo-module-card{display:flex;min-width:0;min-height:0;padding:14px 0;flex-direction:column;border:0;border-radius:0;background:transparent}.topo-module-card+.topo-module-card{border-top:1px solid hsl(var(--border) / .72)}.topo-module-title{position:static;display:inline-flex;align-items:center;gap:6px;min-height:20px;margin-bottom:0;color:hsl(var(--muted-foreground));font-size:13px;font-weight:600;line-height:1;width:100%}.topo-module-label{display:inline-flex;align-items:center;height:20px;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.topo-section-count{display:inline-flex;align-items:center;justify-content:center;min-width:18px;height:18px;padding:0 5px;border-radius:999px;background:hsl(var(--muted) / .72);color:hsl(var(--muted-foreground));font-size:11px;font-weight:650;font-variant-numeric:tabular-nums;line-height:1;white-space:nowrap}.topo-remove-capability:disabled,.topo-capability-add-slot:disabled{cursor:not-allowed;opacity:.45}.topo-module-scroll{box-sizing:border-box;flex:1;min-height:24px;padding-top:9px;overflow-y:auto;overscroll-behavior:contain;scrollbar-color:hsl(var(--border)) transparent;scrollbar-width:thin}.topo-module-scroll::-webkit-scrollbar{width:4px}.topo-module-scroll::-webkit-scrollbar-track{background:transparent}.topo-module-scroll::-webkit-scrollbar-thumb{border-radius:999px;background:hsl(var(--border))}.topo-module-scroll:focus-visible{outline:2px solid hsl(var(--ring) / .45);outline-offset:3px;border-radius:5px}.topo-tools-scroll{max-height:104px}.topo-skills-scroll{max-height:152px}.topo-topology-scroll{max-height:184px}.topo-tool-list{display:flex;min-width:0;flex-direction:column}.topo-tool{position:relative;display:flex;align-items:center;gap:6px;min-width:0;padding:7px 2px 7px 14px;color:hsl(var(--foreground));font-size:12.5px;line-height:1.4}.topo-tool:before{content:"";position:absolute;top:13px;left:2px;width:5px;height:5px;border:1px solid hsl(var(--muted-foreground) / .7);border-radius:2px}.topo-tool:first-child{padding-top:0}.topo-tool:first-child:before{top:6px}.topo-tool:last-child{padding-bottom:1px}.topo-tool+.topo-tool{border-top:1px solid hsl(var(--border) / .72)}.topo-capability-title,.topo-skill-title{display:flex;align-items:center;min-width:0;gap:6px}.topo-capability-title{flex:1}.topo-capability-name{min-width:0;overflow:hidden;font-size:13px;text-overflow:ellipsis;white-space:nowrap}.topo-capability-copy{display:flex;min-width:0;flex-direction:column;gap:1px}.topo-capability-copy code{overflow:hidden;color:hsl(var(--muted-foreground));font-family:ui-monospace,SFMono-Regular,Menlo,Consolas,monospace;font-size:9.5px;font-weight:450;line-height:1.25;text-overflow:ellipsis;white-space:nowrap}.topo-capability-add-slot{display:flex;width:100%;min-height:34px;margin:0;padding:5px 10px;align-items:center;justify-content:center;gap:6px;border:1px dashed hsl(var(--border));border-radius:9px;background:hsl(var(--muted) / .18);color:hsl(var(--muted-foreground));font:inherit;font-size:11.5px;cursor:pointer;transition:border-color .15s ease,background .15s ease,color .15s ease}.topo-capability-add-dock{flex:0 0 auto;padding-top:6px;background:hsl(var(--background))}.topo-capability-add-slot>span:first-child{font-size:15px;line-height:1}.topo-capability-add-slot:hover:not(:disabled){border-color:hsl(var(--primary) / .55);background:hsl(var(--primary) / .055);color:hsl(var(--primary))}.topo-capability-add-slot:focus-visible{outline:2px solid hsl(var(--ring) / .38);outline-offset:2px}.topo-custom-badge{display:inline-flex;align-items:center;height:17px;padding:0 5px;flex-shrink:0;border-radius:5px;background:hsl(var(--primary) / .1);color:hsl(var(--primary));font-size:9.5px;font-weight:650;line-height:1}.topo-remove-capability{display:inline-flex;align-items:center;justify-content:center;width:20px;height:20px;margin-left:auto;padding:0;flex-shrink:0;border:0;border-radius:6px;background:transparent;color:hsl(var(--muted-foreground));font-size:15px;line-height:1;cursor:pointer}.topo-remove-capability:hover:not(:disabled){background:hsl(var(--destructive) / .1);color:hsl(var(--destructive))}.topo-skill-list{display:flex;min-width:0;flex-direction:column}.topo-skill{display:flex;min-width:0;flex-direction:column;gap:2px;padding:8px 0}.topo-skill:first-child{padding-top:0}.topo-skill:last-child{padding-bottom:1px}.topo-skill+.topo-skill{border-top:1px solid hsl(var(--border) / .72)}.topo-skill-name{min-width:0;overflow:hidden;color:hsl(var(--foreground));font-family:-apple-system,BlinkMacSystemFont,Segoe UI,sans-serif;font-size:13px;font-weight:500;line-height:1.45;text-overflow:ellipsis;white-space:nowrap}.topo-skill-title{width:100%}.topo-skill-description{display:-webkit-box;overflow:hidden;color:hsl(var(--muted-foreground));font-size:12px;line-height:1.45;overflow-wrap:anywhere;-webkit-box-orient:vertical;-webkit-line-clamp:2}.topo-empty{color:hsl(var(--muted-foreground));font-size:11.5px;line-height:1.5}.topo-topology{min-height:0}.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;min-height:34px;padding:6px 7px;border:0;border-radius:8px;background:hsl(var(--muted) / .5);font-size:12px;transition:background .15s ease,box-shadow .15s ease,opacity .15s ease}.topo-icon{width:14px;height:14px;flex-shrink:0;opacity:.78}.topo-name{flex:1;min-width:0;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;font-size:13px;font-weight:550}.topo-badge{flex-shrink:0;font-size:10.5px;padding:1px 5px;border-radius:5px;background:hsl(var(--muted));color:hsl(var(--muted-foreground))}.topo-node.is-active{background:hsl(var(--foreground) / .08);animation:topo-active-fade 1.8s ease-in-out infinite}.topo-node.is-active .topo-icon{opacity:1}.topo-node.is-onpath{background:hsl(var(--primary) / .04);box-shadow:inset 2px 0 hsl(var(--primary) / .4)}.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:5px;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-seg+.topo-path-seg:before{content:"";width:7px;height:1px;margin-right:5px;flex-shrink:0;background:hsl(var(--border))}.topo-path-name{color:hsl(var(--muted-foreground))}.topo-path-name.is-current{color:hsl(var(--primary));font-weight:600}@keyframes topo-active-fade{0%,to{background:hsl(var(--foreground) / .05)}50%{background:hsl(var(--foreground) / .14)}}@media (min-width: 1280px){.agent-info-trigger{display:none}.topo:not(.is-drawer) .topo-module-scroll{max-height:none}.main:has(>.topo)>.transcript{padding-right:322px}.main:has(>.topo)>.conversation-composer-slot{padding-right:322px;padding-left:16px}.conversation-composer-slot>.composer{margin-right:auto;margin-left:auto}}@media (max-width: 1279px){.topo{display:none}.topo.is-drawer{display:block}.topo.is-drawer .topo-module-stack{display:flex;flex-direction:column}}@media (prefers-reduced-motion: reduce){.topo-node{transition:none}.topo-node.is-active,.topo-remote{animation:none}}.session-capability-dialog-layer{position:fixed;top:0;right:0;bottom:0;left:0;z-index:110;display:grid;padding:24px;place-items:center}.session-capability-dialog-scrim{position:absolute;top:0;right:0;bottom:0;left:0;width:100%;height:100%;padding:0;border:0;background:#1013187a;-webkit-backdrop-filter:blur(3px);backdrop-filter:blur(3px)}.session-capability-dialog{position:relative;display:flex;width:min(560px,calc(100vw - 32px));max-height:min(720px,calc(100vh - 48px));flex-direction:column;overflow:hidden;border:1px solid hsl(var(--border));border-radius:16px;background:hsl(var(--background));box-shadow:0 24px 80px #0d121c40,0 2px 8px #0d121c1f;animation:session-capability-dialog-in .18s cubic-bezier(.22,1,.36,1)}.session-capability-dialog.is-wide{width:min(980px,calc(100vw - 48px));height:min(720px,calc(100dvh - 48px))}@keyframes session-capability-dialog-in{0%{opacity:0;transform:translateY(8px) scale(.985)}to{opacity:1;transform:translateY(0) scale(1)}}.session-capability-dialog-head{display:grid;min-height:76px;padding:16px 18px;grid-template-columns:38px minmax(0,1fr) 32px;align-items:center;gap:12px;border-bottom:1px solid hsl(var(--border))}.session-capability-dialog-head.is-iconless{grid-template-columns:minmax(0,1fr) 32px}.session-capability-dialog-mark{display:grid;width:38px;height:38px;border-radius:11px;background:hsl(var(--primary) / .09);color:hsl(var(--primary));place-items:center}.session-capability-dialog-mark svg{width:20px;height:20px}.session-capability-dialog-head h2{margin:0;color:hsl(var(--foreground));font-size:15px;font-weight:680;letter-spacing:-.01em}.session-capability-dialog-head p{margin:4px 0 0;color:hsl(var(--muted-foreground));font-size:11.5px;line-height:1.45}.session-capability-dialog-close{display:grid;width:32px;height:32px;padding:0;border:0;border-radius:8px;background:transparent;color:hsl(var(--muted-foreground));cursor:pointer;place-items:center}.session-capability-dialog-close:hover{background:hsl(var(--muted) / .7);color:hsl(var(--foreground))}.session-capability-dialog-close svg{width:18px;height:18px}.session-capability-search{display:flex;min-width:0;flex:0 0 40px;height:40px;padding:0 12px;align-items:center;gap:8px;border:1px solid hsl(var(--border));border-radius:6px;background:hsl(var(--background));color:hsl(var(--muted-foreground))}.session-capability-search:focus-within{border-color:hsl(var(--ring) / .65);box-shadow:0 0 0 3px hsl(var(--ring) / .1)}.session-capability-search svg{width:16px;height:16px;flex:0 0 auto}.session-capability-search input{width:100%;min-width:0;height:100%;padding:0;border:0;outline:0;background:transparent;color:hsl(var(--foreground));font:inherit;font-size:12px}.session-capability-search input::placeholder{color:hsl(var(--muted-foreground) / .8)}.session-tool-dialog-body{display:flex;min-height:0;padding:16px;flex-direction:column;gap:12px}.session-tool-picker{display:flex;min-height:120px;overflow-y:auto;flex-direction:column;gap:7px;overscroll-behavior:contain}.session-tool-option,.session-skill-option{display:flex;min-width:0;align-items:center;gap:10px;border:1px solid hsl(var(--border) / .85);border-radius:10px;background:hsl(var(--background))}.session-tool-option{min-height:72px;padding:10px 11px}.session-tool-option:hover,.session-skill-option:hover{border-color:hsl(var(--foreground) / .2);background:hsl(var(--muted) / .22)}.session-tool-option-icon{display:grid;width:32px;height:32px;flex:0 0 32px;border-radius:9px;background:hsl(var(--muted) / .75);color:hsl(var(--foreground) / .78);place-items:center}.session-tool-option-icon svg{width:17px;height:17px}.session-tool-option-copy,.session-skill-option-copy{display:flex;min-width:0;flex:1;flex-direction:column}.session-tool-option-copy{gap:2px}.session-tool-option-copy strong,.session-skill-option-copy strong{overflow:hidden;color:hsl(var(--foreground));font-size:12.5px;font-weight:620;text-overflow:ellipsis;white-space:nowrap}.session-skill-option-copy strong{font-family:-apple-system,BlinkMacSystemFont,Segoe UI,sans-serif}.session-tool-option-copy code{color:hsl(var(--muted-foreground));font-family:ui-monospace,SFMono-Regular,Menlo,Consolas,monospace;font-size:10px}.session-tool-option-copy>span,.session-skill-option-copy>span{display:-webkit-box;overflow:hidden;color:hsl(var(--muted-foreground));font-size:11px;line-height:1.35;-webkit-box-orient:vertical;-webkit-line-clamp:2}.session-tool-option>button,.session-skill-option>button{display:inline-flex;min-width:58px;height:30px;padding:0 10px;flex:0 0 auto;align-items:center;justify-content:center;gap:4px;border:0;border-radius:8px;background:hsl(var(--foreground));color:hsl(var(--background));font:inherit;font-size:11px;font-weight:600;cursor:pointer}.session-tool-option>button:disabled,.session-skill-option>button:disabled{opacity:.42;cursor:default}.session-skill-option>button svg{width:13px;height:13px}.session-skill-dialog-body{display:flex;min-height:0;flex:1;flex-direction:column}.session-skill-source-tabs{display:flex;min-height:48px;padding:0 18px;align-items:stretch;gap:24px;border-bottom:1px solid hsl(var(--border))}.session-skill-source-tabs button{position:relative;display:inline-flex;padding:0 2px;align-items:center;gap:7px;border:0;background:transparent;color:hsl(var(--muted-foreground));font:inherit;font-size:12.5px;font-weight:600;cursor:pointer}.session-skill-source-tabs button:after{content:"";position:absolute;right:0;bottom:-1px;left:0;height:2px;border-radius:2px 2px 0 0;background:transparent}.session-skill-source-tabs button:hover,.session-skill-source-tabs button.is-active{color:hsl(var(--foreground))}.session-skill-source-tabs button.is-active:after{background:hsl(var(--foreground))}.session-skill-source-tabs button>span{display:inline-flex;height:18px;padding:0 6px;align-items:center;border-radius:5px;background:hsl(var(--muted));color:hsl(var(--muted-foreground));font-size:9.5px;font-weight:600}.session-public-skill-browser{display:flex;min-height:0;height:min(548px,calc(100vh - 204px));flex:1;flex-direction:column}.session-public-skill-head{display:flex;min-height:68px;padding:13px 16px;align-items:center;gap:12px}.session-public-skill-head .session-capability-search{flex:1}.session-public-skill-head>span{flex:0 0 auto;color:hsl(var(--muted-foreground));font-size:10.5px}.session-public-skill-list{display:grid;min-height:0;padding:12px;overflow-y:auto;flex:1;grid-template-columns:repeat(2,minmax(0,1fr));align-content:start;gap:8px;overscroll-behavior:contain}.session-public-skill-list>.session-capability-empty,.session-public-skill-list>.session-capability-loading,.session-public-skill-list>.session-capability-error{grid-column:1 / -1}.session-public-skill-option{min-height:106px;padding:11px}.session-public-skill-option .session-skill-option-copy small{overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.session-skill-browser{display:grid;min-height:0;height:min(548px,calc(100vh - 204px));flex:1;grid-template-columns:minmax(260px,.8fr) minmax(360px,1.4fr)}.session-skill-spaces,.session-skill-results{display:flex;min-width:0;min-height:0;flex-direction:column}.session-skill-spaces{border-right:1px solid hsl(var(--border));background:hsl(var(--muted) / .16)}.session-skill-pane-head{display:flex;min-height:92px;padding:13px 14px;flex-direction:column;gap:10px}.session-skill-pane-head>div{display:flex;min-width:0;align-items:center;gap:7px}.session-skill-pane-head strong{overflow:hidden;color:hsl(var(--foreground));font-size:12.5px;font-weight:650;text-overflow:ellipsis;white-space:nowrap}.session-skill-pane-head>div>span{display:inline-flex;min-width:19px;height:18px;padding:0 5px;align-items:center;justify-content:center;border-radius:999px;background:hsl(var(--muted));color:hsl(var(--muted-foreground));font-size:10px}.session-skill-pane-list{display:flex;min-height:0;padding:10px;overflow-y:auto;flex:1;flex-direction:column;gap:7px;overscroll-behavior:contain}.session-skill-space{display:flex;width:100%;min-height:76px;padding:10px;align-items:flex-start;gap:9px;border:1px solid transparent;border-radius:10px;background:transparent;color:hsl(var(--foreground));font:inherit;text-align:left;cursor:pointer}.session-skill-space:hover{background:hsl(var(--background) / .72)}.session-skill-space.is-active{border-color:hsl(var(--primary) / .28);background:hsl(var(--background));box-shadow:0 1px 3px hsl(var(--foreground) / .06)}.session-skill-space>span:last-child{display:flex;min-width:0;flex:1;flex-direction:column;gap:3px}.session-skill-space strong,.session-skill-space small{overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.session-skill-space strong{font-size:12px;font-weight:620}.session-skill-space small{color:hsl(var(--muted-foreground));font-size:10.5px}.session-skill-space em{color:hsl(var(--muted-foreground));font-size:10px;font-style:normal}.session-skill-option{min-height:82px;padding:11px}.session-skill-option-copy{gap:4px}.session-skill-option-copy small{color:hsl(var(--muted-foreground) / .84);font-size:9.5px}.session-capability-empty,.session-capability-loading,.session-capability-error{display:flex;min-height:120px;align-items:center;justify-content:center;color:hsl(var(--muted-foreground));font-size:12px;text-align:center}.session-capability-error{color:hsl(var(--destructive))}@media (max-width: 720px){.session-capability-dialog-layer{padding:12px}.session-capability-dialog.is-wide{width:calc(100vw - 24px);height:calc(100dvh - 24px)}.session-skill-browser{height:min(620px,calc(100vh - 170px));grid-template-columns:1fr;grid-template-rows:minmax(180px,.75fr) minmax(260px,1.25fr)}.session-public-skill-browser{height:min(620px,calc(100vh - 170px))}.session-public-skill-list{grid-template-columns:1fr}.session-skill-spaces{border-right:0;border-bottom:1px solid hsl(var(--border))}}@media (prefers-reduced-motion: reduce){.session-capability-dialog{animation:none}}.drawer--agent-info{right:auto;left:0;width:min(400px,92vw);border-right:1px solid hsl(var(--border));border-left:0;box-shadow:12px 0 40px hsl(var(--foreground) / .14);animation:agent-info-slide-in .22s cubic-bezier(.22,1,.36,1)}.agent-info-drawer-body{flex:1;min-height:0;overflow-y:auto;overscroll-behavior:contain}@keyframes agent-info-slide-in{0%{transform:translate(-100%)}to{transform:translate(0)}}@media (prefers-reduced-motion: reduce){.drawer--agent-info,.agent-info-scrim{animation: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/index.html b/veadk/webui/index.html index e0e685bb..255aa47d 100644 --- a/veadk/webui/index.html +++ b/veadk/webui/index.html @@ -5,8 +5,8 @@ VeADK Studio - - + +